31 lines
821 B
Text
31 lines
821 B
Text
import "./1536bit" as sha256
|
|
// Take two bool[256] arrays as input
|
|
// and returns their sha256 full round output as an array of 256 bool.
|
|
def main(u32[8] a, u32[8] b, u32[8] c, u32[8] d) -> (u32[8]):
|
|
|
|
// Hash is computed on the full 1024bit block size
|
|
// padding does not fit in the first two blocks
|
|
// add dummy block (single "1" followed by "0" + total length)
|
|
u32[8] dummyblock1 = [ \
|
|
0x80000000,
|
|
0x00000000,
|
|
0x00000000,
|
|
0x00000000,
|
|
0x00000000,
|
|
0x00000000,
|
|
0x00000000,
|
|
0x00000000
|
|
]
|
|
|
|
u32[8] dummyblock2 = [ \
|
|
0x00000000,
|
|
0x00000000,
|
|
0x00000000,
|
|
0x00000000,
|
|
0x00000000,
|
|
0x00000000,
|
|
0x00000000,
|
|
0x00000400
|
|
]
|
|
|
|
return sha256(a, b, c, d, dummyblock1, dummyblock2)
|