def hmac

bend-collections@1.0.0.0 · src/crypto/secp256k1/ecdsa.bend:38

import bend-collections@1.0.0.0/src/crypto/secp256k1/ecdsa.bend as Ecdsa
import Base
import bend-collections@1.0.0.0/src/crypto/mac.bend as MAC

38# (the key is looked at first, so that the proof checker keeps an unknown
39# HMAC folded)
40def hmac(key: List<&2, U32>, msg: List<&2, U32>) -> List<&2, U32>:
41  match key:
42    case Nil{}: MAC.sign(Nil{}, msg)
43    case k <> t: MAC.sign(k <> t, msg)

Uses (3)

Used by (5)