Commit cd12fb906d2591e80da9edcbd4794b9b916d7489

Authored by Jonathan Lynch
Committed by Herbert Xu
1 parent cd7c3bfe54

[CRYPTO] sha256-generic: Extend sha256_generic.c to support SHA-224

Resubmitting this patch which extends sha256_generic.c to support SHA-224 as
described in FIPS 180-2 and RFC 3874. HMAC-SHA-224 as described in RFC4231
is then supported through the hmac interface.

Patch includes test vectors for SHA-224 and HMAC-SHA-224.

SHA-224 chould be chosen as a hash algorithm when 112 bits of security
strength is required.

Patch generated against the 2.6.24-rc1 kernel and tested against
2.6.24-rc1-git14 which includes fix for scatter gather implementation for HMAC.

Signed-off-by: Jonathan Lynch <jonathan.lynch@intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

Showing 5 changed files with 241 additions and 12 deletions Side-by-side Diff

... ... @@ -91,13 +91,16 @@
91 91 SHA-1 secure hash standard (FIPS 180-1/DFIPS 180-2).
92 92  
93 93 config CRYPTO_SHA256
94   - tristate "SHA256 digest algorithm"
  94 + tristate "SHA224 and SHA256 digest algorithm"
95 95 select CRYPTO_ALGAPI
96 96 help
97 97 SHA256 secure hash standard (DFIPS 180-2).
98 98  
99 99 This version of SHA implements a 256 bit hash with 128 bits of
100 100 security against collision attacks.
  101 +
  102 + This code also includes SHA-224, a 224 bit hash with 112 bits
  103 + of security against collision attacks.
101 104  
102 105 config CRYPTO_SHA512
103 106 tristate "SHA384 and SHA512 digest algorithms"
crypto/sha256_generic.c
... ... @@ -9,6 +9,7 @@
9 9 * Copyright (c) Jean-Luc Cooke <jlcooke@certainkey.com>
10 10 * Copyright (c) Andrew McDonald <andrew@mcdonald.org.uk>
11 11 * Copyright (c) 2002 James Morris <jmorris@intercode.com.au>
  12 + * SHA224 Support Copyright 2007 Intel Corporation <jonathan.lynch@intel.com>
12 13 *
13 14 * This program is free software; you can redistribute it and/or modify it
14 15 * under the terms of the GNU General Public License as published by the Free
... ... @@ -218,6 +219,22 @@
218 219 memset(W, 0, 64 * sizeof(u32));
219 220 }
220 221  
  222 +
  223 +static void sha224_init(struct crypto_tfm *tfm)
  224 +{
  225 + struct sha256_ctx *sctx = crypto_tfm_ctx(tfm);
  226 + sctx->state[0] = SHA224_H0;
  227 + sctx->state[1] = SHA224_H1;
  228 + sctx->state[2] = SHA224_H2;
  229 + sctx->state[3] = SHA224_H3;
  230 + sctx->state[4] = SHA224_H4;
  231 + sctx->state[5] = SHA224_H5;
  232 + sctx->state[6] = SHA224_H6;
  233 + sctx->state[7] = SHA224_H7;
  234 + sctx->count[0] = 0;
  235 + sctx->count[1] = 0;
  236 +}
  237 +
221 238 static void sha256_init(struct crypto_tfm *tfm)
222 239 {
223 240 struct sha256_ctx *sctx = crypto_tfm_ctx(tfm);
224 241  
... ... @@ -294,8 +311,17 @@
294 311 memset(sctx, 0, sizeof(*sctx));
295 312 }
296 313  
  314 +static void sha224_final(struct crypto_tfm *tfm, u8 *hash)
  315 +{
  316 + u8 D[SHA256_DIGEST_SIZE];
297 317  
298   -static struct crypto_alg alg = {
  318 + sha256_final(tfm, D);
  319 +
  320 + memcpy(hash, D, SHA224_DIGEST_SIZE);
  321 + memset(D, 0, SHA256_DIGEST_SIZE);
  322 +}
  323 +
  324 +static struct crypto_alg sha256 = {
299 325 .cra_name = "sha256",
300 326 .cra_driver_name= "sha256-generic",
301 327 .cra_flags = CRYPTO_ALG_TYPE_DIGEST,
302 328  
303 329  
304 330  
305 331  
306 332  
307 333  
... ... @@ -303,29 +329,59 @@
303 329 .cra_ctxsize = sizeof(struct sha256_ctx),
304 330 .cra_module = THIS_MODULE,
305 331 .cra_alignmask = 3,
306   - .cra_list = LIST_HEAD_INIT(alg.cra_list),
  332 + .cra_list = LIST_HEAD_INIT(sha256.cra_list),
307 333 .cra_u = { .digest = {
308 334 .dia_digestsize = SHA256_DIGEST_SIZE,
309   - .dia_init = sha256_init,
310   - .dia_update = sha256_update,
311   - .dia_final = sha256_final } }
  335 + .dia_init = sha256_init,
  336 + .dia_update = sha256_update,
  337 + .dia_final = sha256_final } }
312 338 };
313 339  
  340 +static struct crypto_alg sha224 = {
  341 + .cra_name = "sha224",
  342 + .cra_driver_name = "sha224-generic",
  343 + .cra_flags = CRYPTO_ALG_TYPE_DIGEST,
  344 + .cra_blocksize = SHA224_BLOCK_SIZE,
  345 + .cra_ctxsize = sizeof(struct sha256_ctx),
  346 + .cra_module = THIS_MODULE,
  347 + .cra_alignmask = 3,
  348 + .cra_list = LIST_HEAD_INIT(sha224.cra_list),
  349 + .cra_u = { .digest = {
  350 + .dia_digestsize = SHA224_DIGEST_SIZE,
  351 + .dia_init = sha224_init,
  352 + .dia_update = sha256_update,
  353 + .dia_final = sha224_final } }
  354 +};
  355 +
314 356 static int __init init(void)
315 357 {
316   - return crypto_register_alg(&alg);
  358 + int ret = 0;
  359 +
  360 + ret = crypto_register_alg(&sha224);
  361 +
  362 + if (ret < 0)
  363 + return ret;
  364 +
  365 + ret = crypto_register_alg(&sha256);
  366 +
  367 + if (ret < 0)
  368 + crypto_unregister_alg(&sha224);
  369 +
  370 + return ret;
317 371 }
318 372  
319 373 static void __exit fini(void)
320 374 {
321   - crypto_unregister_alg(&alg);
  375 + crypto_unregister_alg(&sha224);
  376 + crypto_unregister_alg(&sha256);
322 377 }
323 378  
324 379 module_init(init);
325 380 module_exit(fini);
326 381  
327 382 MODULE_LICENSE("GPL");
328   -MODULE_DESCRIPTION("SHA256 Secure Hash Algorithm");
  383 +MODULE_DESCRIPTION("SHA-224 and SHA-256 Secure Hash Algorithm");
329 384  
  385 +MODULE_ALIAS("sha224");
330 386 MODULE_ALIAS("sha256");
... ... @@ -12,6 +12,7 @@
12 12 * Software Foundation; either version 2 of the License, or (at your option)
13 13 * any later version.
14 14 *
  15 + * 2007-11-06 Added SHA-224 and SHA-224-HMAC tests
15 16 * 2006-12-07 Added SHA384 HMAC and SHA512 HMAC tests
16 17 * 2004-08-09 Added cipher speed tests (Reyk Floeter <reyk@vantronix.net>)
17 18 * 2003-09-14 Rewritten by Kartikey Mahendra Bhatt
... ... @@ -74,8 +75,9 @@
74 75 static char *tvmem;
75 76  
76 77 static char *check[] = {
77   - "des", "md5", "des3_ede", "rot13", "sha1", "sha256", "blowfish",
78   - "twofish", "serpent", "sha384", "sha512", "md4", "aes", "cast6",
  78 + "des", "md5", "des3_ede", "rot13", "sha1", "sha224", "sha256",
  79 + "blowfish", "twofish", "serpent", "sha384", "sha512", "md4", "aes",
  80 + "cast6", "arc4", "michael_mic", "deflate", "crc32c", "tea", "xtea",
79 81 "arc4", "michael_mic", "deflate", "crc32c", "tea", "xtea",
80 82 "khazad", "wp512", "wp384", "wp256", "tnepres", "xeta", "fcrypt",
81 83 "camellia", "seed", NULL
... ... @@ -918,6 +920,8 @@
918 920  
919 921 test_hash("md4", md4_tv_template, MD4_TEST_VECTORS);
920 922  
  923 + test_hash("sha224", sha224_tv_template, SHA224_TEST_VECTORS);
  924 +
921 925 test_hash("sha256", sha256_tv_template, SHA256_TEST_VECTORS);
922 926  
923 927 //BLOWFISH
... ... @@ -1067,6 +1071,8 @@
1067 1071 HMAC_MD5_TEST_VECTORS);
1068 1072 test_hash("hmac(sha1)", hmac_sha1_tv_template,
1069 1073 HMAC_SHA1_TEST_VECTORS);
  1074 + test_hash("hmac(sha224)", hmac_sha224_tv_template,
  1075 + HMAC_SHA224_TEST_VECTORS);
1070 1076 test_hash("hmac(sha256)", hmac_sha256_tv_template,
1071 1077 HMAC_SHA256_TEST_VECTORS);
1072 1078 test_hash("hmac(sha384)", hmac_sha384_tv_template,
... ... @@ -1299,6 +1305,9 @@
1299 1305 camellia_cbc_dec_tv_template,
1300 1306 CAMELLIA_CBC_DEC_TEST_VECTORS);
1301 1307 break;
  1308 + case 33:
  1309 + test_hash("sha224", sha224_tv_template, SHA224_TEST_VECTORS);
  1310 + break;
1302 1311  
1303 1312 case 100:
1304 1313 test_hash("hmac(md5)", hmac_md5_tv_template,
1305 1314  
... ... @@ -1324,8 +1333,11 @@
1324 1333 test_hash("hmac(sha512)", hmac_sha512_tv_template,
1325 1334 HMAC_SHA512_TEST_VECTORS);
1326 1335 break;
  1336 + case 105:
  1337 + test_hash("hmac(sha224)", hmac_sha224_tv_template,
  1338 + HMAC_SHA224_TEST_VECTORS);
  1339 + break;
1327 1340  
1328   -
1329 1341 case 200:
1330 1342 test_cipher_speed("ecb(aes)", ENCRYPT, sec, NULL, 0,
1331 1343 aes_speed_template);
... ... @@ -1457,6 +1469,10 @@
1457 1469  
1458 1470 case 312:
1459 1471 test_hash_speed("tgr192", sec, generic_hash_speed_template);
  1472 + if (mode > 300 && mode < 400) break;
  1473 +
  1474 + case 313:
  1475 + test_hash_speed("sha224", sec, generic_hash_speed_template);
1460 1476 if (mode > 300 && mode < 400) break;
1461 1477  
1462 1478 case 399:
... ... @@ -173,7 +173,34 @@
173 173 }
174 174 };
175 175  
  176 +
176 177 /*
  178 + * SHA224 test vectors from from FIPS PUB 180-2
  179 + */
  180 +#define SHA224_TEST_VECTORS 2
  181 +
  182 +static struct hash_testvec sha224_tv_template[] = {
  183 + {
  184 + .plaintext = "abc",
  185 + .psize = 3,
  186 + .digest = { 0x23, 0x09, 0x7D, 0x22, 0x34, 0x05, 0xD8, 0x22,
  187 + 0x86, 0x42, 0xA4, 0x77, 0xBD, 0xA2, 0x55, 0xB3,
  188 + 0x2A, 0xAD, 0xBC, 0xE4, 0xBD, 0xA0, 0xB3, 0xF7,
  189 + 0xE3, 0x6C, 0x9D, 0xA7},
  190 + }, {
  191 + .plaintext =
  192 + "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
  193 + .psize = 56,
  194 + .digest = { 0x75, 0x38, 0x8B, 0x16, 0x51, 0x27, 0x76, 0xCC,
  195 + 0x5D, 0xBA, 0x5D, 0xA1, 0xFD, 0x89, 0x01, 0x50,
  196 + 0xB0, 0xC6, 0x45, 0x5C, 0xB4, 0xF5, 0x8B, 0x19,
  197 + 0x52, 0x52, 0x25, 0x25 },
  198 + .np = 2,
  199 + .tap = { 28, 28 }
  200 + }
  201 +};
  202 +
  203 +/*
177 204 * SHA256 test vectors from from NIST
178 205 */
179 206 #define SHA256_TEST_VECTORS 2
... ... @@ -814,6 +841,121 @@
814 841 .psize = 73,
815 842 .digest = { 0xe8, 0xe9, 0x9d, 0x0f, 0x45, 0x23, 0x7d, 0x78, 0x6d, 0x6b,
816 843 0xba, 0xa7, 0x96, 0x5c, 0x78, 0x08, 0xbb, 0xff, 0x1a, 0x91 },
  844 + },
  845 +};
  846 +
  847 +
  848 +/*
  849 + * SHA224 HMAC test vectors from RFC4231
  850 + */
  851 +#define HMAC_SHA224_TEST_VECTORS 4
  852 +
  853 +static struct hash_testvec hmac_sha224_tv_template[] = {
  854 + {
  855 + .key = { 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b,
  856 + 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b,
  857 + 0x0b, 0x0b, 0x0b, 0x0b },
  858 + .ksize = 20,
  859 + /* ("Hi There") */
  860 + .plaintext = { 0x48, 0x69, 0x20, 0x54, 0x68, 0x65, 0x72, 0x65 },
  861 + .psize = 8,
  862 + .digest = { 0x89, 0x6f, 0xb1, 0x12, 0x8a, 0xbb, 0xdf, 0x19,
  863 + 0x68, 0x32, 0x10, 0x7c, 0xd4, 0x9d, 0xf3, 0x3f,
  864 + 0x47, 0xb4, 0xb1, 0x16, 0x99, 0x12, 0xba, 0x4f,
  865 + 0x53, 0x68, 0x4b, 0x22},
  866 + }, {
  867 + .key = { 0x4a, 0x65, 0x66, 0x65 }, /* ("Jefe") */
  868 + .ksize = 4,
  869 + /* ("what do ya want for nothing?") */
  870 + .plaintext = { 0x77, 0x68, 0x61, 0x74, 0x20, 0x64, 0x6f, 0x20,
  871 + 0x79, 0x61, 0x20, 0x77, 0x61, 0x6e, 0x74, 0x20,
  872 + 0x66, 0x6f, 0x72, 0x20, 0x6e, 0x6f, 0x74, 0x68,
  873 + 0x69, 0x6e, 0x67, 0x3f },
  874 + .psize = 28,
  875 + .digest = { 0xa3, 0x0e, 0x01, 0x09, 0x8b, 0xc6, 0xdb, 0xbf,
  876 + 0x45, 0x69, 0x0f, 0x3a, 0x7e, 0x9e, 0x6d, 0x0f,
  877 + 0x8b, 0xbe, 0xa2, 0xa3, 0x9e, 0x61, 0x48, 0x00,
  878 + 0x8f, 0xd0, 0x5e, 0x44 },
  879 + .np = 4,
  880 + .tap = { 7, 7, 7, 7 }
  881 + }, {
  882 + .key = { 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
  883 + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
  884 + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
  885 + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
  886 + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
  887 + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
  888 + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
  889 + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
  890 + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
  891 + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
  892 + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
  893 + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
  894 + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
  895 + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
  896 + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
  897 + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
  898 + 0xaa, 0xaa, 0xaa },
  899 + .ksize = 131,
  900 + /* ("Test Using Larger Than Block-Size Key - Hash Key First") */
  901 + .plaintext = { 0x54, 0x65, 0x73, 0x74, 0x20, 0x55, 0x73, 0x69,
  902 + 0x6e, 0x67, 0x20, 0x4c, 0x61, 0x72, 0x67, 0x65,
  903 + 0x72, 0x20, 0x54, 0x68, 0x61, 0x6e, 0x20, 0x42,
  904 + 0x6c, 0x6f, 0x63, 0x6b, 0x2d, 0x53, 0x69, 0x7a,
  905 + 0x65, 0x20, 0x4b, 0x65, 0x79, 0x20, 0x2d, 0x20,
  906 + 0x48, 0x61, 0x73, 0x68, 0x20, 0x4b, 0x65, 0x79,
  907 + 0x20, 0x46, 0x69, 0x72, 0x73, 0x74 },
  908 + .psize = 54,
  909 + .digest = { 0x95, 0xe9, 0xa0, 0xdb, 0x96, 0x20, 0x95, 0xad,
  910 + 0xae, 0xbe, 0x9b, 0x2d, 0x6f, 0x0d, 0xbc, 0xe2,
  911 + 0xd4, 0x99, 0xf1, 0x12, 0xf2, 0xd2, 0xb7, 0x27,
  912 + 0x3f, 0xa6, 0x87, 0x0e },
  913 + }, {
  914 + .key = { 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
  915 + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
  916 + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
  917 + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
  918 + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
  919 + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
  920 + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
  921 + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
  922 + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
  923 + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
  924 + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
  925 + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
  926 + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
  927 + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
  928 + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
  929 + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
  930 + 0xaa, 0xaa, 0xaa },
  931 + .ksize = 131,
  932 + /* ("This is a test using a larger than block-size key and a")
  933 + (" larger than block-size data. The key needs to be")
  934 + (" hashed before being used by the HMAC algorithm.") */
  935 + .plaintext = { 0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20,
  936 + 0x61, 0x20, 0x74, 0x65, 0x73, 0x74, 0x20, 0x75,
  937 + 0x73, 0x69, 0x6e, 0x67, 0x20, 0x61, 0x20, 0x6c,
  938 + 0x61, 0x72, 0x67, 0x65, 0x72, 0x20, 0x74, 0x68,
  939 + 0x61, 0x6e, 0x20, 0x62, 0x6c, 0x6f, 0x63, 0x6b,
  940 + 0x2d, 0x73, 0x69, 0x7a, 0x65, 0x20, 0x6b, 0x65,
  941 + 0x79, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x61, 0x20,
  942 + 0x6c, 0x61, 0x72, 0x67, 0x65, 0x72, 0x20, 0x74,
  943 + 0x68, 0x61, 0x6e, 0x20, 0x62, 0x6c, 0x6f, 0x63,
  944 + 0x6b, 0x2d, 0x73, 0x69, 0x7a, 0x65, 0x20, 0x64,
  945 + 0x61, 0x74, 0x61, 0x2e, 0x20, 0x54, 0x68, 0x65,
  946 + 0x20, 0x6b, 0x65, 0x79, 0x20, 0x6e, 0x65, 0x65,
  947 + 0x64, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x62, 0x65,
  948 + 0x20, 0x68, 0x61, 0x73, 0x68, 0x65, 0x64, 0x20,
  949 + 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x20, 0x62,
  950 + 0x65, 0x69, 0x6e, 0x67, 0x20, 0x75, 0x73, 0x65,
  951 + 0x64, 0x20, 0x62, 0x79, 0x20, 0x74, 0x68, 0x65,
  952 + 0x20, 0x48, 0x4d, 0x41, 0x43, 0x20, 0x61, 0x6c,
  953 + 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x2e },
  954 + .psize = 152,
  955 + .digest = { 0x3a, 0x85, 0x41, 0x66, 0xac, 0x5d, 0x9f, 0x02,
  956 + 0x3f, 0x54, 0xd5, 0x17, 0xd0, 0xb3, 0x9d, 0xbd,
  957 + 0x94, 0x67, 0x70, 0xdb, 0x9c, 0x2b, 0x95, 0xc9,
  958 + 0xf6, 0xf5, 0x65, 0xd1 },
817 959 },
818 960 };
819 961  
include/crypto/sha.h
... ... @@ -8,6 +8,9 @@
8 8 #define SHA1_DIGEST_SIZE 20
9 9 #define SHA1_BLOCK_SIZE 64
10 10  
  11 +#define SHA224_DIGEST_SIZE 28
  12 +#define SHA224_BLOCK_SIZE 64
  13 +
11 14 #define SHA256_DIGEST_SIZE 32
12 15 #define SHA256_BLOCK_SIZE 64
13 16  
... ... @@ -22,6 +25,15 @@
22 25 #define SHA1_H2 0x98badcfeUL
23 26 #define SHA1_H3 0x10325476UL
24 27 #define SHA1_H4 0xc3d2e1f0UL
  28 +
  29 +#define SHA224_H0 0xc1059ed8UL
  30 +#define SHA224_H1 0x367cd507UL
  31 +#define SHA224_H2 0x3070dd17UL
  32 +#define SHA224_H3 0xf70e5939UL
  33 +#define SHA224_H4 0xffc00b31UL
  34 +#define SHA224_H5 0x68581511UL
  35 +#define SHA224_H6 0x64f98fa7UL
  36 +#define SHA224_H7 0xbefa4fa4UL
25 37  
26 38 #define SHA256_H0 0x6a09e667UL
27 39 #define SHA256_H1 0xbb67ae85UL