def hash_scalar
import bend-collections-laws-crypto@1.0.0.0/src/crypto/secp256k1/ecdsa.bend as Ecdsaimport Base
import bend-collections-laws-crypto@1.0.0.0/src/crypto/secp256k1/scalar.bend as S
import bend-collections-laws-crypto@1.0.0.0/src/crypto/secp256k1/bytes.bend as B
28# a 32-byte string as a scalar mod n (bits2int with qlen = hlen = 256,
29# reduced: SEC 1 section 4.1.3 step 5, RFC 6979 section 2.3.2)
30def hash_scalar(+h: List<&2, U32>) -> List<&2, Nat>:
31 S.reduce(B.of_be(h))
Uses (5)
Used by (8)
- bend-collections-laws-crypto@1.0.0.0/src/crypto/secp256k1/ecdsa:sign_d
- bend-collections-laws-crypto@1.0.0.0/proofs/crypto/secp256k1/pscal:hash_r
- bend-collections-laws-crypto@1.0.0.0/proofs/crypto/secp256k1/pscal:hash_v
- bend-collections-laws-crypto@1.0.0.0/src/crypto/secp256k1/ecdsa:verify_q
- bend-collections-laws-crypto@1.0.0.0/src/crypto/secp256k1/ecdsa:recover_sig
- …