def fips_compress16

bend-collections-laws-crypto@1.0.0.0 · src/crypto/sha/core.bend:640

import bend-collections-laws-crypto@1.0.0.0/src/crypto/sha/core.bend as Core
import Base
import bend-collections-laws-crypto@1.0.0.0/src/crypto/sha/state.bend as S

640# window_compress16 specialized to the FIPS table: no constant list is walked.
641def fips_compress16(+a: U32, +b: U32, +c: U32, +d: U32,
642  +e: U32, +f: U32, +g: U32, +h: U32,
643  +i: U32, +j: U32, +k: U32, +l: U32,
644  +m: U32, +n: U32, +o: U32, +p: U32, +q: Nat, +s: S.State) -> S.State:
645  s1 = step(s, 1116352408, a)
646  s2 = step(s1, 1899447441, b)
647  s3 = step(s2, 3049323471, c)
648  s4 = step(s3, 3921009573, d)
649  s5 = step(s4, 961987163, e)
650  s6 = step(s5, 1508970993, f)
651  s7 = step(s6, 2453635748, g)
652  s8 = step(s7, 2870763221, h)
653  s9 = step(s8, 3624381080, i)
654  s10 = step(s9, 310598401, j)
655  s11 = step(s10, 607225278, k)
656  s12 = step(s11, 1426881987, l)
657  s13 = step(s12, 1925078388, m)
658  s14 = step(s13, 2162078206, n)
659  s15 = step(s14, 2614888103, o)
660  s16 = step(s15, 3248222580, p)
661  feedforward(s, kr16(q, W{p, o, n, m, l, k, j, i, h, g, f, e, d, c, b, a}, s16))

Uses (7)

Used by (70)