crypto-algorithms
crypto-algorithms copied to clipboard
Incorrect reference hash for "aaaaaaaaaa"
The sha256 output of "aaaaaaaaaa" should be 0xbf2cb58a68f684d95a3b78ef8f661c9a4e5b09e82cc8f9cc88cce90528caeb27.
@srosen911 Why are tests successful then? I completely agree that the hash is incorrect.
a@kondenzator:/tmp/crypto-algorithms$ printf "aaaaaaaaaa" | sha256sum
bf2cb58a68f684d95a3b78ef8f661c9a4e5b09e82cc8f9cc88cce90528caeb27 -
One hundred thousand
sha256_init(&ctx);
for (idx = 0; idx < 100000; ++idx)
sha256_update(&ctx, text3, strlen(text3));
sha256_final(&ctx, buf);
pass = pass && !memcmp(hash3, buf, SHA256_BLOCK_SIZE);