-
Notifications
You must be signed in to change notification settings - Fork 7
/
SHA256.cry
26 lines (24 loc) · 919 Bytes
/
SHA256.cry
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/**
* Instantiation of the secure hash algorithm SHA-256 as specified in
* [FIPS-180-4], Section 5.3.3.
*
* @copyright Galois, Inc
* @author Marcella Hastings <[email protected]>
*
* [FIPS-180-4]: National Institute of Standards and Technology. Secure Hash
* Standard (SHS). (Department of Commerce, Washington, D.C.), Federal
* Information Processing Standards Publication (FIPS) NIST FIPS 180-4.
* August 2015.
* @see https://doi.org/10.6028/NIST.FIPS.180-4
*/
module Primitive::Keyless::Hash::SHA2::Instantiations::SHA256 =
Primitive::Keyless::Hash::SHA2::Specification
where
type w = 32
type DigestSize = 256
// Per [FIPS-180-4], these are the first 32 bits of the fractional
// parts of the square roots of the first 8 prime numbers.
H0 = [
0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a,
0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19
]