def suffix
import bend-collections-laws-crypto@1.0.0.0/src/crypto/sha/core.bend as Coreimport Base
663# FIPS padding suffix for a message of n bytes, computed with modular
664# arithmetic. The proofs state the streaming hash in terms of it.
665def suffix(+n: Nat) -> List<&2, U32>:
666 128 <> List.append(&2, U32,
667 List.replicate(U32, Nat.mod(Nat.sub(119n, Nat.mod(n, 64n)), 64n), 0), bit_length(n))
Uses (8)
Used by (8)
- bend-collections-laws-crypto@1.0.0.0/src/crypto/hash:finish256
- bend-collections-laws-crypto@1.0.0.0/proofs/crypto/hash/laws:Incremental.sha256
- bend-collections-laws-crypto@1.0.0.0/proofs/crypto/sha/conformance:stream_correct
- bend-collections-laws-crypto@1.0.0.0/proofs/crypto/hash/incremental:finish256_eta
- bend-collections-laws-crypto@1.0.0.0/proofs/crypto/hash/incremental:incremental256
- …