Commit 1f9a9f8c authored by Igor Gnatenko's avatar Igor Gnatenko

gchecksum: add SHA-384 support

Signed-off-by: default avatarIgor Gnatenko <ignatenko@src.gnome.org>
parent b278e8ea
......@@ -100,14 +100,16 @@ typedef struct
guchar digest[SHA256_DIGEST_LEN];
} Sha256sum;
#define SHA512_BLOCK_LEN 128 /* 1024 bits message block */
/* SHA2 is common thing for SHA-384, SHA-512, SHA-512/224 and SHA-512/256 */
#define SHA2_BLOCK_LEN 128 /* 1024 bits message block */
#define SHA384_DIGEST_LEN 48
#define SHA512_DIGEST_LEN 64
typedef struct
{
guint64 H[8];
guint8 block[SHA512_BLOCK_LEN];
guint8 block[SHA2_BLOCK_LEN];
guint8 block_len;
guint64 data_len[2];
......@@ -1084,16 +1086,17 @@ sha256_sum_digest (Sha256sum *sha256,
}
/*
* SHA-512 Checksum
* SHA-384, SHA-512, SHA-512/224 and SHA-512/256 Checksums
*
* Implemented following FIPS-180-2 standard at
* http://csrc.nist.gov/publications/fips/fips180-2/fips180-2.pdf.
* Implemented following FIPS-180-4 standard at
* http://csrc.nist.gov/publications/fips/fips180-4/fips180-4.pdf.
* References in the form [§x.y.z] map to sections in that document.
*
* Author: Eduardo Lima Mitev <elima@igalia.com>
* Author(s): Eduardo Lima Mitev <elima@igalia.com>
* Igor Gnatenko <ignatenko@src.gnome.org>
*/
/* SHA-384 and SHA-512 functions [§4.1.3] */
/* SHA-384, SHA-512, SHA-512/224 and SHA-512/256 functions [§4.1.3] */
#define Ch(x,y,z) ((x & y) ^ (~x & z))
#define Maj(x,y,z) ((x & y) ^ (x & z) ^ (y & z))
#define SHR(n,x) (x >> n)
......@@ -1113,27 +1116,8 @@ sha256_sum_digest (Sha256sum *sha256,
(b)[(i) + 6] = (guint8) (n >> 8); \
(b)[(i) + 7] = (guint8) (n ); } G_STMT_END
static void
sha512_sum_init (Sha512sum *sha512)
{
/* Initial Hash Value [§5.3.4] */
sha512->H[0] = 0x6a09e667f3bcc908;
sha512->H[1] = 0xbb67ae8584caa73b;
sha512->H[2] = 0x3c6ef372fe94f82b;
sha512->H[3] = 0xa54ff53a5f1d36f1;
sha512->H[4] = 0x510e527fade682d1;
sha512->H[5] = 0x9b05688c2b3e6c1f;
sha512->H[6] = 0x1f83d9abfb41bd6b;
sha512->H[7] = 0x5be0cd19137e2179;
sha512->block_len = 0;
sha512->data_len[0] = 0;
sha512->data_len[1] = 0;
}
/* SHA-384 and SHA-512 constants [§4.2.3] */
static const guint64 SHA512_K[80] = {
static const guint64 SHA2_K[80] = {
0x428a2f98d728ae22, 0x7137449123ef65cd,
0xb5c0fbcfec4d3b2f, 0xe9b5dba58189dbbc,
0x3956c25bf348b538, 0x59f111f1b605d019,
......@@ -1176,9 +1160,48 @@ static const guint64 SHA512_K[80] = {
0x5fcb6fab3ad6faec, 0x6c44198c4a475817
};
static void
sha384_sum_init (Sha512sum *sha512)
{
/* Initial Hash Value [§5.3.4] */
sha512->H[0] = 0xcbbb9d5dc1059ed8;
sha512->H[1] = 0x629a292a367cd507;
sha512->H[2] = 0x9159015a3070dd17;
sha512->H[3] = 0x152fecd8f70e5939;
sha512->H[4] = 0x67332667ffc00b31;
sha512->H[5] = 0x8eb44a8768581511;
sha512->H[6] = 0xdb0c2e0d64f98fa7;
sha512->H[7] = 0x47b5481dbefa4fa4;
sha512->block_len = 0;
sha512->data_len[0] = 0;
sha512->data_len[1] = 0;
}
static void
sha512_sum_init (Sha512sum *sha512)
{
/* Initial Hash Value [§5.3.5] */
sha512->H[0] = 0x6a09e667f3bcc908;
sha512->H[1] = 0xbb67ae8584caa73b;
sha512->H[2] = 0x3c6ef372fe94f82b;
sha512->H[3] = 0xa54ff53a5f1d36f1;
sha512->H[4] = 0x510e527fade682d1;
sha512->H[5] = 0x9b05688c2b3e6c1f;
sha512->H[6] = 0x1f83d9abfb41bd6b;
sha512->H[7] = 0x5be0cd19137e2179;
sha512->block_len = 0;
sha512->data_len[0] = 0;
sha512->data_len[1] = 0;
}
static void
sha512_transform (guint64 H[8],
guint8 const data[SHA512_BLOCK_LEN])
guint8 const data[SHA2_BLOCK_LEN])
{
gint i;
gint t;
......@@ -1186,7 +1209,7 @@ sha512_transform (guint64 H[8],
guint64 M[16];
guint64 W[80];
/* SHA-512 hash computation [§6.3.2] */
/* SHA-512 hash computation [§6.4.2] */
/* prepare the message schedule */
for (i = 0; i < 16; i++)
......@@ -1224,7 +1247,7 @@ sha512_transform (guint64 H[8],
{
guint64 T1, T2;
T1 = h + SIGMA1 (e) + Ch (e, f, g) + SHA512_K[t] + W[t];
T1 = h + SIGMA1 (e) + Ch (e, f, g) + SHA2_K[t] + W[t];
T2 = SIGMA0 (a) + Maj (a, b, c);
h = g;
g = f;
......@@ -1262,7 +1285,7 @@ sha512_sum_update (Sha512sum *sha512,
sha512->data_len[1]++;
/* try to fill current block */
block_left = SHA512_BLOCK_LEN - sha512->block_len;
block_left = SHA2_BLOCK_LEN - sha512->block_len;
if (block_left > 0)
{
gsize fill_len;
......@@ -1273,7 +1296,7 @@ sha512_sum_update (Sha512sum *sha512,
length -= fill_len;
offset += fill_len;
if (sha512->block_len == SHA512_BLOCK_LEN)
if (sha512->block_len == SHA2_BLOCK_LEN)
{
sha512_transform (sha512->H, sha512->block);
sha512->block_len = 0;
......@@ -1281,14 +1304,14 @@ sha512_sum_update (Sha512sum *sha512,
}
/* process complete blocks */
while (length >= SHA512_BLOCK_LEN)
while (length >= SHA2_BLOCK_LEN)
{
memcpy (sha512->block, buffer + offset, SHA512_BLOCK_LEN);
memcpy (sha512->block, buffer + offset, SHA2_BLOCK_LEN);
sha512_transform (sha512->H, sha512->block);
length -= SHA512_BLOCK_LEN;
offset += SHA512_BLOCK_LEN;
length -= SHA2_BLOCK_LEN;
offset += SHA2_BLOCK_LEN;
}
/* keep remaining data for next block */
......@@ -1304,7 +1327,7 @@ sha512_sum_close (Sha512sum *sha512)
{
guint l;
gint zeros;
guint8 pad[SHA512_BLOCK_LEN * 2] = { 0, };
guint8 pad[SHA2_BLOCK_LEN * 2] = { 0, };
guint pad_len = 0;
gint i;
......@@ -1338,12 +1361,25 @@ sha512_sum_close (Sha512sum *sha512)
PUT_UINT64 (sha512->H[i], sha512->digest, i * 8);
}
static gchar *
sha384_sum_to_string (Sha512sum *sha512)
{
return digest_to_string (sha512->digest, SHA384_DIGEST_LEN);
}
static gchar *
sha512_sum_to_string (Sha512sum *sha512)
{
return digest_to_string (sha512->digest, SHA512_DIGEST_LEN);
}
static void
sha384_sum_digest (Sha512sum *sha512,
guint8 *digest)
{
memcpy (digest, sha512->digest, SHA384_DIGEST_LEN);
}
static void
sha512_sum_digest (Sha512sum *sha512,
guint8 *digest)
......@@ -1393,6 +1429,9 @@ g_checksum_type_get_length (GChecksumType checksum_type)
case G_CHECKSUM_SHA256:
len = SHA256_DIGEST_LEN;
break;
case G_CHECKSUM_SHA384:
len = SHA384_DIGEST_LEN;
break;
case G_CHECKSUM_SHA512:
len = SHA512_DIGEST_LEN;
break;
......@@ -1470,6 +1509,9 @@ g_checksum_reset (GChecksum *checksum)
case G_CHECKSUM_SHA256:
sha256_sum_init (&(checksum->sum.sha256));
break;
case G_CHECKSUM_SHA384:
sha384_sum_init (&(checksum->sum.sha512));
break;
case G_CHECKSUM_SHA512:
sha512_sum_init (&(checksum->sum.sha512));
break;
......@@ -1568,6 +1610,7 @@ g_checksum_update (GChecksum *checksum,
case G_CHECKSUM_SHA256:
sha256_sum_update (&(checksum->sum.sha256), data, length);
break;
case G_CHECKSUM_SHA384:
case G_CHECKSUM_SHA512:
sha512_sum_update (&(checksum->sum.sha512), data, length);
break;
......@@ -1618,6 +1661,10 @@ g_checksum_get_string (GChecksum *checksum)
sha256_sum_close (&(checksum->sum.sha256));
str = sha256_sum_to_string (&(checksum->sum.sha256));
break;
case G_CHECKSUM_SHA384:
sha512_sum_close (&(checksum->sum.sha512));
str = sha384_sum_to_string (&(checksum->sum.sha512));
break;
case G_CHECKSUM_SHA512:
sha512_sum_close (&(checksum->sum.sha512));
str = sha512_sum_to_string (&(checksum->sum.sha512));
......@@ -1689,6 +1736,14 @@ g_checksum_get_digest (GChecksum *checksum,
}
sha256_sum_digest (&(checksum->sum.sha256), buffer);
break;
case G_CHECKSUM_SHA384:
if (checksum_open)
{
sha512_sum_close (&(checksum->sum.sha512));
str = sha384_sum_to_string (&(checksum->sum.sha512));
}
sha384_sum_digest (&(checksum->sum.sha512), buffer);
break;
case G_CHECKSUM_SHA512:
if (checksum_open)
{
......
......@@ -33,6 +33,7 @@ G_BEGIN_DECLS
* @G_CHECKSUM_MD5: Use the MD5 hashing algorithm
* @G_CHECKSUM_SHA1: Use the SHA-1 hashing algorithm
* @G_CHECKSUM_SHA256: Use the SHA-256 hashing algorithm
* @G_CHECKSUM_SHA384: Use the SHA-384 hashing algorithm (Since: 2.51)
* @G_CHECKSUM_SHA512: Use the SHA-512 hashing algorithm (Since: 2.36)
*
* The hashing algorithm to be used by #GChecksum when performing the
......@@ -47,6 +48,7 @@ typedef enum {
G_CHECKSUM_MD5,
G_CHECKSUM_SHA1,
G_CHECKSUM_SHA256,
G_CHECKSUM_SHA384,
G_CHECKSUM_SHA512
} GChecksumType;
......
......@@ -577,6 +577,193 @@ const char *SHA256_sums[] = {
"df3a0c35d5345d6d792415c1310bd4589cdf68bac96ed599d6bb0c1545ffc86c"
};
const gchar *SHA384_sums[] = {
"38b060a751ac96384cd9327eb1b1e36a21fdb71114be07434c0cc7bf63f6e1da274edebfe76f65fbd51ad2f14898b95b",
"0dc52f16d3eca9ca8498ef2d3dc4874b3ff09ddaabbaad2b40694f028b5ce96b4f1beef0f7909216561d97f3ed52f898",
"1f523ff2c063b7e066a7939cb32835e2419fcb17a84cde41db20e6bf232a7e8bbf604b8e72a78a71b1143fed864db2fd",
"549608d5e5f1ed4de18574ad672fdfe4e90adee52212900d6aa7dee0da385ad52fb01f4a7e3389a878abb06f179856cf",
"db3ecef9235f7ae209e0d80b1cc410bcb7ea5e89723655a1bd2164d2f8dbc55a88a5c290027aa3b0f304624ee66d7d63",
"a7e6a7f853669ff6fbd8546da356fcfb2a101f673317dbc8694a133d17fcf7aa47c7f45ece36f74982713632d45e08fa",
"33374d882fd9fabf7a68c15442ee3c867eaee873660f227fa9c075b2c7d0d0847302d7362a4e44dd6c5611082e7d7e03",
"1d470f2ab6903d018db216d833c9dc593b0807ba8b2c3b262f3821ef157d3877dfe2771289681e64a32bd543044729fb",
"d743cda479245f11b02c027811fd365d3b19162678cd463ac5c25736df1348534eca57fc6c11226d2e42643274517ac9",
"898e462929c5b044f168f28480285ae9358bef0efb4178d16b4c6881dc1fe33f4878a201caf15e6fd4a3b2a60c399177",
"091bd8d09c0b65cf2df743296059e9b4a5204a639749ed8d8b84f6d96a1108ef371129e1377e93ca81df5512017abfa0",
"7eda4e628dd8c86b0219ef6cc3b6a8f8fd43bf014b3e17d235fc0efabe2496948970bb7b9381c0b16b0c582393c8d4a7",
"6ec427b055ecb6893dc1f124406cdc1b6d978fd67323876739fd51d5efd4e734f7438a4457fd12bae9b3d3bfa24b31a9",
"86748bdf10e8824de5a7e0e10401b0e56398f90e8b403e9617b3f9d8d364cc6542d7386685e2a11550eff335da121f10",
"46048fdb1112566f73260153eb15b265ca1c8baeb94e299465f5104de6eb686d04514fb80cbff214b3895c6ee05bc4ab",
"b8163ed91081d10e611865911bc9d441da490b5d0bcab4ace75c44d2e092d86b22105560b63f89896e52ea032385afba",
"a359baab8486a764723496f4676b604cbf6fc988975b5f9ae63589b22dd9474c9784f97bc7f65446b6954e4c1845286c",
"1f811cfd2f506408a76231d9e2f36521445506484b4c3fbc06aace043702a838eafaf5acf00ac34e833288192f603b27",
"3a36180fb8e4036443058d8bf458d462acf0ba502346319884b129c0f3e02315d753448234c802027d60274c05deccd8",
"2e45933dd1a1e6a6928a732d58abeb180c225e5e7b99c64eb6f233a7b99ee4635c17f44ca544cf620cf4289deb4c08cf",
"c357c3b780e1c2b39eb2a945122ebaec4ff6465e87b733220394e1cb0de112ae96b7832e81b5cbe0aee6f4e226ea4cbb",
"4541eef600241af98fbd7ef0ae051251c165876a7ee7836fbe307672339da2e3dc75ba348d1ce25aa7761f3f3812435a",
"1ec1444aa377ed39fea4f233e8083e2a3b7c467b9ca0725638eb7b7ce2d4a2e8c1b65df371db0ddf608de12c09c50357",
"c7359bc73401fbae01f673960f2151b3df8d80397a086cbd2809e91f70185db26379c52bcb98fe43e7331530bdd90e41",
"260c27c51fc73b0422b89dd2d5523da65d23d1447f8888e9a7b7971d39179a98fb1336db2652b8329a6715a6e45cfa4a",
"17ab2a4374f66611b44d072223392aac47619917f67c563be63506a2445438dac1f08aff2289b6306c63015e17f6d756",
"50ae7f616544ef154a5abc45ab755a9b39ff62a85565bad855a5446b2c5b0eee21c1707c4d00aadf38c0b5db0b961472",
"7001f37f83b37c0802cf5a4f5ae7c99b76af103465a35d396bcae22733b9b701d20fcee38efa73b80d7676e4ee067696",
"acced5edd17f02a3d4d8fd161dffc2d20c3198ebe95bb4b261d68b0184233549576513402148950d2a0d6b3d6844f584",
"45f35ba985744959bba9fb05a42f40f13fb83e13a790d300e51427c51cf3336a57f3415e3929edf746eccc3943f03287",
"a661b26f153becac9986ce69f2e941c3c2236ee8b8ca0e8848826e6d8787598dda69ae15e509476cf0c7423e9359e04f",
"5fee0cf0b2326ac6178bc8b503465d9b2006b21b31ab1d71a19251f1e5e132204abd50566b5f5b1a689ab2185d369250",
"60be6e4e5c333bfc2cf3766b9c11520e89d61701c8de9b0c2998a2ad6f28213b807e7bf9ef8eba25a1d0e57a8a60a092",
"cdd74eda2c2abd8be3108be5a78e119f56c6695ef58963aab81040daec2a48a7391c85ff89e8c97aa567199baabfa63e",
"a41e7f8ed505508ffa0bd15203c5c40516d443346faa4f3ea902c987b11d1d9235464fc4694aff5e601c128d246ee108",
"9cb7d4d38c1212ad80805d57ce34dac09df2e6094ca4f4a29b30188b6289fd4ff8896312fec927d393d70f2439f44df5",
"49b553e1e616ac5714f749e856f604dd59fc5d8c404fc1ec40ea6699769fee9eaf05a7fe3e70aa6999efaa2a30bd3a4c",
"58e0a56466cc30d767274a96d1d6361a30e837adbb08786af782994679f87ad39b49d7ec23b18cd13512da10ef533c4a",
"e7e303d2aa1747b1c0ee55f2ebf771f124d1148a7482cffcfeb3748aca02b115b3c5f161dfa66b4edb05fd5ff08163c2",
"619e5ee9fa3042860c15fc7ac487effeb5cc525f050aef88198d2eb41ac770284c55c3f330c609b1f4751757bc0dad7e",
"a0bc5c74a22b66174865386592f7447bd4337d0cf156ab87e5cfa603b5e7b65d551cfb2f9308ecc4fd68f77961a6518e",
"c9b202d9d654be8b15f9d0e6de0a0cf933404e210fed2adc10defa505b3f864fd0dcaa5f1ef74a2b6f27008fbbcfc387",
"2122ed7b325076d20268173dedfa87721598002389eb345a1bfeaa3d74212f552a6614bd4853e998d70416f7e742578d",
"ca737f1014a48f4c0b6dd43cb177b0afd9e5169367544c494011e3317dbf9a509cb1e5dc1e85a941bbee3d7f2afbc9b1",
"ed892481d8272ca6df370bf706e4d7bc1b5739fa2177aae6c50e946678718fc67a7af2819a021c2fc34e91bdb63409d7",
"64ec7149fa7113fceac47ad4b1aac8aad3da081edd956670fbe720c37e764ff746a6098ce3b1fe5cba172f9c78bdb092",
"85e6b0436e37262ac89afed06b7293cb5c4d1b02f5ee8947089352501d76c09844065017b9ea1e661f7669dec61da5e8",
"1e5810ba32c0cceb8953676d01ee0e23f9e1eece4fe7ac6b5c3dbe4b3e3a80d2c3ae04dfae07fd7f011ec7dc0206e4a7",
"40b72fb30ea9df3e084f1044d60594fc692b41c5b455a1473819da33865594af21173a648bf77ddb433863bdb2f549c7",
"73ca43f78cc16e1dc388e7e0c70ce98a411145893fdca7480669d4055e1c8d79cfec73de1c8759f58d6a1a45501b06a8",
"1ea9c6bb6a37ea2a86938cb4f5a49ddcd7172ff8aa9e159c80bb2c9e1340949946a0ead46a1e1321b0671d2091c123a0",
"ec183d2df6e95ccb554753fc7fdf5e925a3f8d7a7d65f29f49c49b9f1782b553f2d8dd02dc3d482f72d4b104eeef6b9c",
"639e81eccb6c0475149360dc6c4ef17a3b7a177c6365de8e9c2cf6206a09fa35871f5b09d8aedaa73f2d25c8079c11bd",
"a4a3c0672b9caaf638203ec5f59732b0ec2833c2d4268690dabd4826a7e69e1e8411a5c4136256e0f85cccface30e34d",
"d2c6d095c43c483ae7bbcabb9dfa395c4f6744e2fb372afa05b08b96e4b0f31eff793d2ea4e1a7987c2a3c7ad9a41ceb",
"893737a01c71cac766a0540a958ea8cfb76bc07f7491e725780f270e60cd2cc3e78c776ac09b4b182b6bb788a683a1c1",
"756a266a57f2eef3ebb0f25b421e128993e7e78585d40d52d167107893fd093c23c2abfa860bfc9f8257d319c4d63bc9",
"aeb27fe17ab1088f28758a6cb76fa85be060a10f049034c8a5bac616b4abe3f75b4a8ce9183fd688e415565fff51e102",
"83070b470f5da7029c0146f934445d233b5367fb7cb6ac218be976db71b7011d2853c5d47594002268398691d5755b19",
"3f2e1aba81d4662cd03a19da044d74afd07ffbc73d99d49515d7991f02e75256bdbe56cdfbb6f340b2aae0b8a57af35b",
"8e88cb931508d906d5264353aa1bf78c3d3b48247277b819d56fec4fa0842067630924b5d0635fdea27caa35eddc4d43",
"54a17c1f2453f297947922b2df622b249097e30668af87a0faea941249156026f029f4ed0b5e5ac8737a582ecc2e9e42",
"9e97e741f5a416f145b6bc226881ef30ca640ec0515f66447b82bd9d3e04efdc939b415dd161e4821ffef81dab93f853",
"1ce35a3d0221edf54a21cc302c132d36d4a40d32600362ea7143be3b2247882d5b912d72bacd2398f555805150197704",
"b386eb4ac1044eaf51a634bec4fe768d6b15caa1349a17e9c6964fa3476061e9aa36bce8ac2827dbaeff494cb13347e3",
"0f59ee1d7925ecba97426ba3f3391149fecadb0e91730fcd4dd8c3b7e33ac4ab6d176fae7f89f256bcc39e0f38614a00",
"704480c7512c0e2cecbbd7362a0cb80a3af4cf2f8bf47c043d7eee46664a1d12c3eee7774acf22ec51b412ff42b28e01",
"2d134ab108e0d48f163565d56e03d2b429d86ddc3ffe99fc1af9224e43b8a4e347e9cffb5a53f2089afec62fc0fc0535",
"aceda520bd0290eb0f1dfa55bc5cc33d86c76be3f649b721db7fb8108977645f13b9eaa56c8ff31940685eaaf1c9045f",
"25e9f8229348a67f7b206efdf72c761acd44bff13aa79577087f2a279683ae2190d2e50c2781ae13a36d27a6e0181a78",
"8e263e257424ae9ca402f76637c22f676d101ce7445161c846b6b20a82ba1a1a062be4b095cf38bd2f85b207fc69dd8d",
"a8b8a738d201b371a2a58f9f44a7378b21645c3b188d4b3dd44cd657643c40ce5db0ad47cf2ad0d906472e843999c2ce",
"9305f1e51aaad4bcaf1eedd796d224801e651a2d1024a5ed938f04cb6f31cd9ad917a3da123746f74489607bade382b9",
"846aa275cde54b1dc18e54d3f8cdbea72880b24344022dbe41f2a2411acbaa3ceb9981cca41f3bedaf11ec4f1cafccf8",
"22ec68e8240936a821bfd74fd70456d0930c5e822aeacafb7a5a56278d3f7cc7ccfb2077ccbfacabd48722bea6cdacab",
"83f85752a7ebf35248bed9ebafb7bd8f8057822fe0217653032b682b0c65f1bcb7d72d7153b753aba0391acaa00caf0e",
"807dd327e8261f03b0f0033eb5a20434455513ba767937dde25689105ce5e0afc73d5ae71fad853fbd9f5834dc0029f5",
"4474115e088371995e38864664f25858c787cd5fab3ba27e82a495417493045fa2db4c308bf361e457ea8b95fe214623",
"e300fe5cfcc832b44055e36e662a3f064a0355d3e02b913a3b4e0c1645e89f06440cc1f6cbfd800a187f071bec87586c",
"b1725159fc6cc41071234ca1c68ba5c53cfb5160f08b82a3f920e1afdec7c8e10fe47fe9ca880e0c6a28268235196226",
"f355cb21971890b902d11eb761d42fac9792f6f4522167973d11ada18689cb644d719dab95817c04e8f51e3af60455f6",
"c3bd83e2d4425f12b9408f557e6df726faaa68640b823cf987823a9a8a7bab370311ff700f921536eb7bcc0a952876a8",
"cc4870dd388f8f010d4f1853f70ff57b20dc55522c5211b7aa9adb9d87fe9a00747ac4800c7e933fbfd42466317200a7",
"026e8903c649d5f0d11689ad0a1d2505f8813dee1bc91f318992d595273b589cd1ae5288423687c5bc81a8deac20901b",
"1e9a40bdddf2e4219bb41e57d04d676005c9c9726f22d6a9084a017cad077fc72f9eb585dd56c7c6e98d2765fa638fa7",
"fac0e5025c57b9ee5259063882a0fae893a4d58b4a04966b7d30c07e6f8c94e506ca045eb7fb2ebf90a50098f67b1d21",
"b8fc895e7b16c9b77693add7142cc29479feac2200164db6c726640791f3343d67f1140191f6c098dd107489adf048bf",
"5a4f5827cea371f056314eb44d430cf01a351afde1602dc73c041bba3f857b0f89ed834c504062af234cf5d226d4fd68",
"e1e0262c44a178aa6e66b5f06a95d5c1460546fdc6fb3d4d46c9f91abf90276968eab30c8158d0f69c39be0ab46d36af",
"22f0857e546c8c9177da942a5f6d7bb4006e06ea75cf1e2f0c33abd5fbd04da7ffaeac9809ef5deae5c92e91373c3146",
"e00dfb7d2961e1c6131d4d833d7cb717606cdd2f700ee0a58cafdddd1d13bedc4e3d42baafad9291df4fa750613b5d54",
"7bd7ee14674440ee1108d8223aeaee4ba79b3dcde6131aa3180df738ac5ff8d56fb8b1e28b76569e64e8f2d01888caf6",
"90968444daa8606a654f16085567d449d9825fe4e9121eedebccd1931b1008a05314cadd3d4517ad244710bc2cd366d7",
"5479100553d648f7aa0383d976ee17644b382935370a45d1ee4719b603c8756c6768da8054dbc0b350de956b4f7cc1d9",
"2cfe35f7d56b98eed9c503add7d928fa40f36481d9081537c036e2b580461ae949942a44cd39305dd97eafd35d57e0dc",
"1af78690ff86c3f8fc618addffd185f02d34a1c7bd1a7c2437671351431bfe88473cb77f11b10019b940862675cababe",
"5438a88ae5c8c6b749e13277473604ad308f2632420bed254424476cbb37fb3c6f2dbe1d215c88baecca36364d9d7f15",
"f12ba197468e48837fce68cbccbeff29a86975cb52ab79b330fa36e1adb59d13a3565542b8224db0a2e6e18ff74ce4d3",
"9d1e560cc3f3f0b31a27005c9cd8aa7bdf3d5654893a09fe9ce8ebd70808fdedc30f1a8891618f8213c3a950e2c2d7a0",
"9a982423774d784389a44cc5be202c377f9ac24c2dc391ccad5b767528f25b71c8a344aabe5eef5708f29f70af959797",
"03f2b41094daf982ff9e3e88a617326bdac3edbc799bb4be9230d2f9ec7be0dd429fb0e2668b79773a81c3648033449f",
"6a9c2a01dd1d3f8848338e7d8576b45e0f4bda52518544bb64872bda7757b147f33f98367b30eb85fcbaafd76f60cc0c",
"83ea416d4e44772b41fa05de1252b2498e0d9f6c94499b916f4d6020129c3efcf82b56ea3e5aa096da8afc323c31fd37",
"aa10bd53633bf4e5710cde88017782ae5db69bc7e6cdbdca043ffd7745983b0e1d0c29e12bce574d565fe945f206f119",
"f1fe5c15d79e35b90f2e1b721ca818289773fe402a961578c6e3aebc320599201e8226576a367477293d40fbb4f3fc28",
"0faf4a5144a4814bdd525e90d8ef7ae5036757294c5688ede0799136e199b775e57feaee0cf71f8bdce491d1d2f024d6",
"63b6f20d0120aaa85d921f4dab46a5c714c3929ef8538c734d7a7332244e873790c7a5dc6a68bc25346957e3cc9750e4",
"0e30f7de204cc8b8823df223fd47e6d1610fb513f7c82097c655bc711693224ac2094500a7d88c82fb63d466ff344b28",
"59d2e7dcec3f682bcee635523f40274ea438798e6824a069021b6f405f3aeb28507339f4fa62d2d2ceb880232e087407",
"47c01ac096b61aa079a31ba38624e4a133db1b74c167e6367a5286836a6c43cf2ce43acb732368530d55ac51c0d2b20b",
"28e83816e04a37c8c4aafba1e10bd7b0f174ceaaf96790e247fee67444ec49e9b45778d52264679ad849b8381fa02606",
"b0a51ea444b0453b5a507e61cd8c4aadf0f16410112c41f9d0d87249240964f04dd2fa4509e3a94db1aa60f8efc9b5d0",
"e7727e316fdf5e9ca39bbbabd11d1a34164e4c888397846ebb199925b224162480c98cd28d4e9ed6a62f58e71e45e84c",
"680a954c79572c04f5b676a0c41c05373c1fd4392df600d168d12a92d93c40be45bd57d07dec9034368361128f51dc99",
"5c67745118531a6aa3d8297240c009a398d8538acbeebffd015299dba7cc09889c7a2dc89b2f5cabd3aae2f64de68ec0",
"972ba5fb43f49682599cd2139f3b472a97729e2ec1af230f4f8e82481f038fee55be151d92fcd876fa8aee1a940d9e99",
"2956fcb6e5fc8751944c41749a2df73e4c9d1ca97bf692a9bcd32f3741d40129917a09afe84cb422e3c3cbe9233930fe",
"be42a35c6d7d8f0b1ec568ad13511f16de412cf68f024c288d36dd385aabbb39a71b47e8d3ced67436f9b10f86ff79d7",
"bfc033db0076c92c90dd999af55c5a87aff33c39e1beb497d2c5b04413da304d6e4fa0757760650d3c83cebcec850665",
"5e428bf59fbac06779cf39e4c936af3449345cb0b5cf024e12f9d65b5335d48e36bc5794394e4ba6a69e376bed6c5fa2",
"2319b8a3c5d4ccc8309cea7671ba574dea6cf5a22544e5484e7cc505f4c9962d39e56038268fdd3a718439666dae4130",
"1bb8004796e666a7e190299ce4a9c0d2a3a873880d1a8514b691d083874ba87f14ca8e1012eea375d0ac2c7ea4f90c93",
"cdce59bb1419cf9414d118af0394c33cf6b00f011ae440e69814ac38062cb3a74325973753afcd7fb8e861896f655042",
"9c5f45af32bb9f5592e11f0f3b7843f48d8cdf8488d342ef5204a603701a28cc9fd203b2687c36b175724ec6a7b49c28",
"5ec187f20b00f03c65acbf2aefd41366cf13d5f65e5547e59827e31394c9dfd4b29e4c15eab2c895ca1dfe42f51bf1e0",
"37a98ad9163c780affc45d17e1c9d90385219e1fd06e1b892adafd85b7e5e93b6589dea59824c5b1ffe1f6948a6f8abc",
"1dba0337f96f1b8d389836da99f3b4d5b3f032016db5633b70523a4943c39a0bb7ac0113ff2fda8c9249504a82154985",
"4be93bcfa6659f0ce77403929e4ca829ee6ab2e6c3fccd9705827a63210d61c84d532232d10d6419fdf7530923d4d3ca",
"2c193964714b91f9a042de286978c3946562e32e411ed665d7f528dda482c40ce03af2c1d51994ee8ecafa31995d2a97",
"c0dc5fd7ecef76c407aede2e9ff953da2614a93af881e991929a9ed741d35bcba018507465c823038d8253d7793a4a6c",
"d86d195ac354c1864eba1a375fd7b8928e18c35add5fcff0eccbb9fe693841af213e5ea97c74255cf78caef05b5c333c",
"fa869704b0cd658df32859f9c39c4758d63d07a5bcb1b89d8a650f13723e09512db19e519362fd1616ff9c2931fb1ae1",
"ebaf8055f0b50a2940f355365cebd4cce547351bc3269d15e654e3fd8f4114b4ed1c2c86c1f8946bff4372f607ce04a6",
"ae2da6aae51736c0739e0082dc6e40b9b837210d9b89c3c7836c4353ec1426c5eb623ab1cdbf4950d3ef08dca449b181",
"9303a95a7f774b10b45922e67e1f4ea4262036a0f7fc6d7684d0ffc7bb8af858be4d3ddcce7bb7ede1aab5dc7239c32b",
"48c50f106e9e5c8abe13709796fc9475d15146e4583a630c333e03c537bbed82e3fdd995a35faa6a39408bbb4de650f3",
"677eb2d2c478d1df4e4c4526b6f2adfdfda823a78d9bdce68ffcc53b51c7385467d86b44f51e00c7b93ef49d611c197b",
"60bbe0d86e267db4499e80b5086695f9548b551698853e6dc5c269ff443c2faf01094ced08122fe917ac745bcf9167b1",
"634951aec5be9bf3ffcb76bac539e18c68c32086cce136234b951b7296be926778adddfa12881298f01b4c5395dcd30b",
"a2a8fe4f0f49bf109f356ee64a3d2327b22f5665e1b4598545ffbbbaedd6b83a15019a226446846050790e4a82390cb1",
"c1712b70cf9c560ffa7732f10340908a459983fe945ac52f7a5e2c032bbeed266e8d87ddb758d1aa1a369a835b640083",
"71ba3a1f425710378a448ac09af30215ef82ebac92ee36a2170e8236df7472ee34ea457432fe7159ddbbac5fcac6074a",
"35671f92bc408566d5feea3f5b40acc15fafbbb028fbac3ba75703bd67cac291c89a4a5681fddbcb73bd6a3c57d80a55",
"e6c99d9df949c9c838521b10efccbec1d477f24106270e3f404b924311ad0a980e5c76bcfc97dd49c209def6584348a6",
"8f43643d2c5cab090c7dc6322551758ab24e7752d3aece0f54f84062e487ad06ce73dfe8462c21a75043a3044b22716a",
"86c9a0b7c05609b87aa033ba84a3caac8673fbbb30988a8bf08ec29e837aaa2cd286a75e3efb23d625298ac26fbeeaff",
"5f9ef7622ad76d9fe0e54162035ec80adc38cfc037e487167453cfbff5762892f6f644213dc0900461cc824030b644f7",
"82aa3a493c757c10642f18b0d2c9fc8aac149460c52aed421a52b0bd3375891912aa9b8b96fe1d5043f1bbace8468e57",
"7bdd9da6f2522203d626dd92e9ae86cd34d09148ec13de3e99baad4f03dae30e5bb9b61a0d7448a484c621360292c4b0",
"714fee42888779ef61ab3d9070c50d036e21298263401a01449e7dfe1e332c12a873338837bf520ca70dc67e223820c6",
"41d1f3202d615686c8a93e99b2464a3a4ed33502960e931ea0a1359bc0d7b324058e6dd4319b473b3239fea0ab0dfbc0",
"70aeab1154487423db987dfcc49b3ddb070566217265355cfe369d59009cb4d421a04dd698df2784565e5e399b5e5a03",
"df3ac16ddc84b701b16d6de7cc0dde96fcad5611e4ce70aea261b71c72862dd9aa0053243417d1ae99b2b7662f9f7c40",
"cfcada0c1dcd0ac88dc68c381b3d70b3c684cac55be6b3deb3d010260910540e3fc55e01dda4b830f16fa0ef1c5d82b0",
"133e10e620019f79a67665a343586482e142787250e9b35506c3e3b66a745b6475ab1de8e4e801feb413bcc51548b326",
"530cd917d04f302e2da298689f5fcc90a9aa0047c823c873905709e404dee10c1eb79e7d6835c7417ae4191980639bae",
"a2b472e47feb5a6570dd58b95ae170ff91a192dcdecb1bc1cc70e214a51816db4f995a36fad3ba59da438e8cf0c1554b",
"2e4e5db2ed86ec4e624eecb7c97e19bfaf8084e5637781c5dcda0b1893d240d340e122c7886fb5eb815a64cf7ee91b30",
"1a4f43b0175b5e5cba118e2bb12131fb402b7d039364a0f736226cd8f3350c82618dae2d536672046f9e4538d7b991c9",
"2976c4948dd90223669a76fb6589e57643b87bee5f84414c5836b8d11be0e3383200bf71a7c684f61e77b10ef74a051c",
"003c01194b02d8bc27e86a87e0f3d20ec8f73b50ef016e88630790cbccba5b40473ad5b841af42023d37a0c97bedcd2a",
"09ea80665108b1d81d4eabfb20f2244c6a95d766d6e0569b7b588e86b1c7ec041af35fbefcb63e44923197b01e7b35f9",
"ab7772e9ee3ed234e6b25f8f1ec83e71d81ccb3b50ab500ca9c3cc1bf5a1d1b1e510c4bceb1412a6b8f76e028488a301",
"705de94139c912fbf5206fb4e25e21cf494693b6d742f415d5f612d3367e7045f4fefe8f434034dbb5b9547512673b53",
"73901bffe76b302dfeeb44f99e5d67d26cece0e8e7d2bd6cf38a3568a44b26f50b38a640dc19b27b2092397221cbc624",
"fcb3b5b2f653e4ad52761f5318d87c0221afd576b4c5284a3ee9deeeb60964e71b2097cd5a69c790599b81a9cb96094c",
"0157f14a737a42fd71984d5315d3f45bc60e500768cc3cc67631467d85f5fac35de341eddc34d67cae0be027d493aed1",
"abaa4828c22f9b759c9d08dfe9d521658d90a5ab0d36c218f35d189dd90d2a5864175d8a9dd967af7c925c1141ed2739",
"471bb865c4919443fdbf5b1242f2a0d4b1844d71436bb7eb10b4a16c25b2ed1ba328a0ebc2c54f1bb837324d53eb0c80",
"8893062264263322b741eb1e59b9342dec9c9ac566cbebc067f81ee1aaf4ee1e1e2a65ea454d491647d97bbd66e7221c",
"14656e46c052c373e3ec6973b92bfbf3e500808ba3437b97674e9895ff4299787a845539851cbcd529855fd255e8f741",
"e649c7e5b2e83c361b617d3e8445ff7aaf869038d086acf6fe869aec8402f26cd7179536f8d10191688fb69b95a2f635",
"c3df8427160197cf1e9f71def9a1e67cff7c57d649590720fb11b83d30245a654c03007f219bb11a2f6906f47b031abf",
"2cfa1eefc4d53b08e3142b78860becc51ed759c045746ac998a0a9474b994a4cfdc54de9d6db428f2a289b26913857ec",
"2af353a8c8835f6cd58444daa0a5f7284fd909848e181edde94491bb715a2bf6c7c141234ee84dc12fd3b65921d52493",
"f14039e20bc2283ab72f7ef423d8466d92617e9efb3b4ec35b4b94a93231b6c524c6817fe5b7e83aefe597c81834c132",
"91e680e587f1288c38f3ab5ab64b7f8d8b088c2500847a076375a1ab91d326c8224c387c09ebc9481343adbd1f7ccf97",
"3010d06978a08ab3f77ac955d982c5f612d3dfc5474123564be75c6b7a55286aed88b716957689b6186d9942ed407abe",
"1f411cd6eaa1b0ebf9dc107b937bd7c56555ed56424c0ded47c70be7b98303a5da7fbf1a67ed71c6d0c61949b94d7315",
"ebf54cc29cacd2529d7ce34e983d93b436459ef6024cfabbf9b015e5b5911b36f25afb0b6c64ea017b1fb6a62596997a",
"059e327ff689985ece1bcc0b6c3f958930abade7159b4f2758e9721fd32d574b2d6861bb9975d7e95b693d092d391a47",
"dd08a94bdf21b2a31d93969b0f3fa35d8740830c58304fae9fc40bb1be6c2df34053801e9b06f6878f441a0152d88abc",
"da5441a006cb855ad65e86d21b541529a73cfd852a328c8bc8402988972f78d773b3531129127746fb53131f03ea5dee",
"396d84c9c1a2ee76b0163c38533cbc8bc453089e87b9790a62bf5175e614713fea4f16378b416fd8650351345cd44c07"
};
const gchar *SHA512_sums[] = {
"cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e",
"b2396a002fe7aec008808687d7cbacb340b7f7a090008382f3c95870f6fb10415f61f5737c102d4bfec58fe525407ea2001e761dab1da8a501d9523921f0ec21",
......@@ -1013,6 +1200,11 @@ main (int argc, char *argv[])
add_checksum_string_test (G_CHECKSUM_SHA256, "SHA256", SHA256_sums);
add_checksum_bytes_test (G_CHECKSUM_SHA256, "SHA256", SHA256_sums);
for (length = 0; length <= FIXED_LEN; length++)
add_checksum_test (G_CHECKSUM_SHA384, "SHA384", SHA384_sums[length], length);
add_checksum_string_test (G_CHECKSUM_SHA384, "SHA384", SHA384_sums);
add_checksum_bytes_test (G_CHECKSUM_SHA384, "SHA384", SHA384_sums);
for (length = 0; length <= FIXED_LEN; length++)
add_checksum_test (G_CHECKSUM_SHA512, "SHA512", SHA512_sums[length], length);
add_checksum_string_test (G_CHECKSUM_SHA512, "SHA512", SHA512_sums);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment