def absorb3
bend-collections@1.0.0.0 · src/crypto/hash.bend:481
import bend-collections@1.0.0.0/src/crypto/hash.bend as Hash
import Base
import bend-collections@1.0.0.0/src/crypto/keccak/types.bend as TK
import bend-collections@1.0.0.0/src/crypto/keccak/permutation.bend as P
import bend-collections@1.0.0.0/src/crypto/sha3/core.bend as C3
481
482
483
484
485def absorb3(fuel: Nat, r: Read3, orig: List<&2, U32>, +q: Nat, s: TK.State) -> Sha3State:
486 match fuel r:
487 case 0n _:
488 St3{s, orig}
489 case 1n+p Short3{}:
490 St3{s, orig}
491 case 1n+p Blk3{w0, w1, w2, w3, w4, w5, w6, w7, w8, w9, w10, w11, w12, w13, w14, w15, w16, +rest}:
492 absorb3(p, read3_0(rest), rest, q, P.rounds(q, 0n, C3.inject(s, w0, w1, w2, w3, w4, w5, w6, w7, w8, w9, w10, w11, w12, w13, w14, w15, w16)))