Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect reference hash for "aaaaaaaaaa" #23

Open
srosen911 opened this issue Jun 20, 2018 · 2 comments
Open

Incorrect reference hash for "aaaaaaaaaa" #23

srosen911 opened this issue Jun 20, 2018 · 2 comments

Comments

@srosen911
Copy link

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

@sijanec
Copy link

sijanec commented Jun 10, 2020

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

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

@rdebath
Copy link

rdebath commented Sep 21, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants