1
0
Fork 0
mirror of synced 2025-09-23 12:18:44 +00:00
ZoKrates/stdlib/hashes/sha256/1024bit.code
2019-01-31 13:29:16 +01:00

13 lines
No EOL
433 B
Text

import "./IVconstants.code" as IVconstants
import "./shaRoundNoBoolCheck.code" as sha256
// A function that takes 4 field[256] arrays as inputs
// and applies 2 rounds of sha256 compression.
// It returns an array of 256 field elements.
def main(field[256] a, field[256] b, field[256] c, field[256] d) -> (field[256]):
IV = IVconstants()
digest1 = sha256(a, b, IV)
digest2 = sha256(c, d, digest1)
return digest2