-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #115 from GaloisInc/110-sha2-parse
Add preprocessing for SHA2
- Loading branch information
Showing
4 changed files
with
118 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/** | ||
* Secure hash algorithm SHA256. | ||
* | ||
* @copyright Galois, Inc | ||
* @author Marcella Hastings <marcella@galois.com> | ||
*/ | ||
module Primitive::Keyless::Hash::SHA2::Instantiations::SHA = | ||
Primitive::Keyless::Hash::SHA2::Specification | ||
where | ||
type w = 32 | ||
|
||
// 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 | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/** | ||
* Secure hash algorithm SHA384. | ||
* | ||
* @copyright Galois, Inc | ||
* @author Marcella Hastings <marcella@galois.com> | ||
*/ | ||
module Primitive::Keyless::Hash::SHA2::Instantiations::SHA384 = | ||
Primitive::Keyless::Hash::SHA2::Specification | ||
where | ||
type w = 64 | ||
|
||
// Per [FIPS-180-4], these are the the first sixty-four bits of the | ||
// fractional parts of the square roots of the 9th - 16th prime numbers. | ||
H0 = [ | ||
0xcbbb9d5dc1059ed8, 0x629a292a367cd507, | ||
0x9159015a3070dd17, 0x152fecd8f70e5939, | ||
0x67332667ffc00b31, 0x8eb44a8768581511, | ||
0xdb0c2e0d64f98fa7, 0x47b5481dbefa4fa4 | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/** | ||
* Secure hash algorithm SHA512. | ||
* | ||
* @copyright Galois, Inc | ||
* @author Marcella Hastings <marcella@galois.com> | ||
*/ | ||
module Primitive::Keyless::Hash::SHA2::Instantiations::SHA512 = | ||
Primitive::Keyless::Hash::SHA2::Specification | ||
where | ||
type w = 64 | ||
|
||
// Per [FIPS-180-4], these are the the first sixty-four bits of the | ||
// fractional parts of the square roots of the first 8 prime numbers. | ||
H0 = [ | ||
0x6a09e667f3bcc908, 0xbb67ae8584caa73b, | ||
0x3c6ef372fe94f82b, 0xa54ff53a5f1d36f1, | ||
0x510e527fade682d1, 0x9b05688c2b3e6c1f, | ||
0x1f83d9abfb41bd6b, 0x5be0cd19137e2179 | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters