1
0
Fork 0
mirror of synced 2025-09-23 12:18:44 +00:00
This commit is contained in:
dark64 2021-07-16 13:19:57 +02:00
parent 8282856028
commit 292164c572
3 changed files with 3 additions and 3 deletions

View file

@ -10,7 +10,7 @@ def main(bool[256] a, bool[256] b, bool[256] c, bool[256] d) -> (bool[256]):
bool[256] dummyblock1 = [true, ...[false; 255]]
// Total length of message is 1024 bits: 0b10000000000
bool[256] dummyblock2 = [...[false; 245], ...[true, ...[false; 10]]]
bool[256] dummyblock2 = [...[false; 245], true, ...[false; 10]]
bool[256] digest = sha256(a, b, c, d, dummyblock1, dummyblock2)
return digest

View file

@ -7,7 +7,7 @@ def main(bool[256] a) -> (bool[256]):
// Hash is computed on 256 bits of input
// padding fits in the remaining 256 bits of the first block
// add dummy block (single "true" followed by "false" + total length)
bool[256] dummyblock1 = [...[true, ...[false; 246]], ...[true, ...[false; 8]]]
bool[256] dummyblock1 = [true, ...[false; 246], true, ...[false; 8]]
bool[256] digest = sha256(a, dummyblock1)
return digest

View file

@ -10,7 +10,7 @@ def main(bool[256] a, bool[256] b) -> (bool[256]):
bool[256] dummyblock1 = [true, ...[false; 255]]
// Total length of message is 512 bits: 0b1000000000
bool[256] dummyblock2 = [...[false; 246], ...[true, ...[false; 9]]]
bool[256] dummyblock2 = [...[false; 246], true, ...[false; 9]]
bool[256] digest = sha256(a, b, dummyblock1, dummyblock2)
return digest