def hmac
import bend-collections@1.0.0.0/spec/crypto/secp256k1/ecdsa.bend as Ecdsaimport Base
import bend-collections@1.0.0.0/spec/crypto/hmac.bend as HM
47# HMAC-SHA256 (the key is looked at first; the value is HM.hmac's)
48def hmac(key: List<&2, U32>, msg: List<&2, U32>) -> List<&2, U32>:
49 match key:
50 case Nil{}: HM.hmac(Nil{}, msg)
51 case k <> t: HM.hmac(k <> t, msg)