def mix
bend-collections-laws-crypto@1.0.0.0 · spec/crypto/blake/blake2b.bend:129
import bend-collections-laws-crypto@1.0.0.0/spec/crypto/blake/blake2b.bend as Blake2b
import Base
import bend-collections-laws-crypto@1.0.0.0/src/crypto/blake/blake2b/types.bend as T
129
130
131
132
133
134def mix(+s: T.State, +a: Nat, +b: Nat, +c: Nat, +d: Nat, x: T.Lane, y: T.Lane) -> T.State:
135 +a1 = add(add(at(s,a),at(s,b)),x)
136 +d1 = rotr(xor(at(s,d),a1),32n)
137 +c1 = add(at(s,c),d1)
138 +b1 = rotr(xor(at(s,b),c1),24n)
139 +a2 = add(add(a1,b1),y)
140 +d2 = rotr(xor(d1,a2),16n)
141 +c2 = add(c1,d2)
142 +b2 = rotr(xor(b1,c2),63n)
143 put(put(put(put(s,a,a2),b,b2),c,c2),d,d2)