more %stack

This commit is contained in:
Nicholas Ward 2022-09-09 12:45:17 -07:00
parent d8f2e04c2b
commit 5ca5a3b3c8
2 changed files with 4 additions and 14 deletions

View File

@ -171,9 +171,7 @@
%macro sha2_majority
// stack: x, y, z
DUP3
DUP3
DUP3
%stack ((a: 3)) -> (a, a)
// stack: x, y, z, x, y, z
AND
// stack: x and y, z, x, y, z
@ -181,12 +179,8 @@
// stack: x, z, x and y, y, z
AND
// stack: x and z, x and y, y, z
SWAP2
// stack: y, x and y, x and z, z
SWAP1
// stack: x and y, y, x and z, z
SWAP3
// stack: z, y, x and z, x and y
%stack ((a: 2), (b: 2)) -> (b, a)
// stack: y, z, x and z, x and y
AND
// stack: y and z, x and z, x and y
OR

View File

@ -4,11 +4,7 @@
// stack: e, e, f, g, h, K[i], W[i]
%sha2_bigsigma_1
// stack: Sigma_1(e), e, f, g, h, K[i], W[i]
SWAP3
// stack: g, e, f, Sigma_1(e), h, K[i], W[i]
SWAP2
// stack: f, e, g, Sigma_1(e), h, K[i], W[i]
SWAP1
%stack (sig, (efg: 3)) -> (efg, sig)
// stack: e, f, g, Sigma_1(e), h, K[i], W[i]
%sha2_choice
// stack: Ch(e, f, g), Sigma_1(e), h, K[i], W[i]