refactor
This commit is contained in:
parent
8282856028
commit
292164c572
3 changed files with 3 additions and 3 deletions
|
@ -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
|
|
@ -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
|
|
@ -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
|
Loading…
Reference in a new issue