def hmac
import bend-collections-laws-crypto@1.0.0.0/spec/crypto/hmac.bend as Hmacimport Base
54# HMAC(K, text) = H((K0 ^ opad) || H((K0 ^ ipad) || text)) (steps 4-9).
55def hmac(+key: List<&2, U32>, text: List<&2, U32>) -> List<&2, U32>:
56 +k = k0(key)
57 hash(List.append(&2, U32, xor_pad(k, opad()),
58 hash(List.append(&2, U32, xor_pad(k, ipad()), text))))
Uses (8)
Used by (11)
- bend-collections-laws-crypto@1.0.0.0/spec/crypto/secp256k1/ecdsa:hmac
- bend-collections-laws-crypto@1.0.0.0/proofs/crypto/mac/hmac:sign_correct
- bend-collections-laws-crypto@1.0.0.0/spec/crypto/hkdf:t_blocks
- bend-collections-laws-crypto@1.0.0.0/proofs/crypto/mac/hmac:hmac_len
- bend-collections-laws-crypto@1.0.0.0/proofs/crypto/mac/hmac:sign_len
- …