Skip to content

Commit

Permalink
SHA-512: add ref to NIST standard
Browse files Browse the repository at this point in the history
  • Loading branch information
inkydragon committed Jan 15, 2024
1 parent 11a4c73 commit a658829
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/constants.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# SHA initial hash values and constants
"""SHA initial hash values and constants
Reference:
- SHA-1, SHA2: FIPS 180-4: https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf
"""

# Hash constant words K for SHA1
const K1 = UInt32[
Expand Down
10 changes: 8 additions & 2 deletions src/types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -198,13 +198,19 @@ SHA2_512_CTX() = SHA2_512_CTX(copy(SHA2_512_initial_hash_value), 0, zeros(UInt8,
"""
SHA2_512_224_CTX()
Construct an empty SHA2_512/224 context.
Construct an empty SHA2_512/224 context and set the initial hash value.
For the source of the initial value,
refer to [FIPS 180-4, 5.3.6.1 SHA-512/224](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf)
"""
SHA2_512_224_CTX() = SHA2_512_224_CTX(copy(SHA2_512_224_initial_hash_value), 0, zeros(UInt8, blocklen(SHA2_512_224_CTX)), false)
"""
SHA2_512_256_CTX()
Construct an empty SHA2_512/256 context.
Construct an empty SHA2_512/256 context and set the initial hash value.
For the source of the initial value,
refer to [FIPS 180-4, 5.3.6.2 SHA-512/256](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf)
"""
SHA2_512_256_CTX() = SHA2_512_256_CTX(copy(SHA2_512_256_initial_hash_value), 0, zeros(UInt8, blocklen(SHA2_512_256_CTX)), false)

Expand Down

0 comments on commit a658829

Please sign in to comment.