crypto-algorithms icon indicating copy to clipboard operation
crypto-algorithms copied to clipboard

Incorrect reference hash for "aaaaaaaaaa"

Open srosen911 opened this issue 6 years ago • 2 comments

The sha256 output of "aaaaaaaaaa" should be 0xbf2cb58a68f684d95a3b78ef8f661c9a4e5b09e82cc8f9cc88cce90528caeb27.

srosen911 avatar Jun 20 '18 17:06 srosen911

@srosen911 Why are tests successful then? I completely agree that the hash is incorrect.

a@kondenzator:/tmp/crypto-algorithms$ printf "aaaaaaaaaa" | sha256sum
bf2cb58a68f684d95a3b78ef8f661c9a4e5b09e82cc8f9cc88cce90528caeb27  -

sijanec avatar Jun 10 '20 16:06 sijanec

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);

rdebath avatar Sep 21 '22 07:09 rdebath