1
0
Fork 0
mirror of synced 2025-09-24 04:40:05 +00:00
ZoKrates/zokrates_stdlib/stdlib/hashes/sha256/1024bit.zok
2020-07-03 18:10:33 +02:00

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