def hmac
import bend-collections@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))))