Skip to content

SHA1 - NIST FIPS-180 2 NSRL Test Data#804

Closed
WingZer0o wants to merge 3 commits intoRustCrypto:masterfrom
WingZer0o:sha1-NIST-Test-Samples
Closed

SHA1 - NIST FIPS-180 2 NSRL Test Data#804
WingZer0o wants to merge 3 commits intoRustCrypto:masterfrom
WingZer0o:sha1-NIST-Test-Samples

Conversation

@WingZer0o
Copy link

https://www.nist.gov/itl/ssd/software-quality-group/nsrl-test-data

I was doing some more reading on the topic of conversation for FIPS and wanted to try and implement some more code. I propose that we add 3 tests that are specified in the above document for SHA1.

  • A file containing the ASCII string "abc" results in a 160 bit message digest of a9993e36 4706816a ba3e2571 7850c26c 9cd0d89d.
  • A file containing the ASCII string "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq"results in a 160-bit message digest of 84983e44 1c3bd26e baae4aa1 f95129e5 e54670f1.
  • A file containing the binary-coded form of the ASCII string which consists of 1,000,000 repetitions of the character "a" results in a SHA-1 message digest of 34aa973c d4c4daa4 f61eeb2b dbad2731 6534016f.

@WingZer0o WingZer0o changed the title SHA1 - NIST FIPS-180 2 NSRL Test Data for SHA1 SHA1 - NIST FIPS-180 2 NSRL Test Data Mar 21, 2026
@newpavlov
Copy link
Member

We already test the "abc" and "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq" vectors as part of the sha1_kat test. I think we previously had the 1 million "a" test, but intentionally replaced it with sha1_rand.

Finally, use of the hex crate and std items is unnecessary.

@newpavlov newpavlov closed this Mar 21, 2026
@WingZer0o
Copy link
Author

@newpavlov Thanks for the feedback! I'll look into it a little more.

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

Successfully merging this pull request may close these issues.

2 participants