libbb: add comment on sha384
authorDenys Vlasenko <vda.linux@googlemail.com>
Mon, 26 Nov 2018 12:00:28 +0000 (13:00 +0100)
committerDenys Vlasenko <vda.linux@googlemail.com>
Mon, 26 Nov 2018 12:00:28 +0000 (13:00 +0100)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
libbb/hash_md5_sha.c

index a53a382ce2e59d781a3ecadad4ff390d0c68bc6c..9db79ea8bedf506fed0e5bff179c1def0b7f9002 100644 (file)
@@ -794,6 +794,11 @@ static const uint32_t init512_lo[] = {
 };
 #endif /* NEED_SHA512 */
 
+// Note: SHA-384 is identical to SHA-512, except that initial hash values are
+// 0xcbbb9d5dc1059ed8, 0x629a292a367cd507, 0x9159015a3070dd17, 0x152fecd8f70e5939,
+// 0x67332667ffc00b31, 0x8eb44a8768581511, 0xdb0c2e0d64f98fa7, 0x47b5481dbefa4fa4,
+// and the output is constructed by omitting last two 64-bit words of it.
+
 /* Initialize structure containing state of computation.
    (FIPS 180-2:5.3.2)  */
 void FAST_FUNC sha256_begin(sha256_ctx_t *ctx)