12 lines
No EOL
379 B
Text
12 lines
No EOL
379 B
Text
import "./IVconstants" as IVconstants
|
|
import "./shaRound" as sha256
|
|
|
|
// A function that takes 4 bool[256] arrays as inputs
|
|
// and applies 2 rounds of sha256 compression.
|
|
def main(u32[8] a, u32[8] b, u32[8] c, u32[8] d) -> (u32[8]):
|
|
|
|
u32[8] IV = IVconstants()
|
|
u32[8] digest1 = sha256([...a, ...b], IV)
|
|
u32[8] digest2 = sha256([...c, ...d], digest1)
|
|
|
|
return digest2 |