def hram

bend-collections@1.0.0.0 · src/crypto/ed25519/ed25519.bend:20

import bend-collections@1.0.0.0/src/crypto/ed25519/ed25519.bend as Ed25519
import Base
import bend-collections@1.0.0.0/src/crypto/hash.bend as H
import bend-collections@1.0.0.0/src/crypto/ed25519/scalar.bend as SC

20# k = SHA-512(R || A || M) mod L
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))))

Uses (5)

Used by (2)