def hram
bend-collections-laws-crypto@1.0.0.0 · src/crypto/ed25519/ed25519.bend:20
import bend-collections-laws-crypto@1.0.0.0/src/crypto/ed25519/ed25519.bend as Ed25519
import Base
import bend-collections-laws-crypto@1.0.0.0/src/crypto/hash.bend as H
import bend-collections-laws-crypto@1.0.0.0/src/crypto/ed25519/scalar.bend as SC
20
21def hram(rb: List<&2, U32>, +a: List<&2, U32>, +msg: List<&2, U32>) -> List<&2, U32>:
22 match rb:
23 case Nil{}:
24 SC.reduce(H.sha512(cat(Nil{}, cat(a, msg))))
25 case Con{x, xt}:
26 SC.reduce(H.sha512(cat(Con{x, xt}, cat(a, msg))))