def hash_v

bend-collections-laws-crypto@1.0.0.0 · proofs/crypto/secp256k1/pscal.bend:41

import bend-collections-laws-crypto@1.0.0.0/proofs/crypto/secp256k1/pscal.bend as Pscal
import Base
import bend-collections-laws-crypto@1.0.0.0/spec/crypto/secp256k1/field.bend as FS
import bend-collections-laws-crypto@1.0.0.0/spec/crypto/secp256k1/curve.bend as CV
import bend-collections-laws-crypto@1.0.0.0/spec/crypto/secp256k1/ecdsa.bend as ES
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
import bend-collections-laws-crypto@1.0.0.0/src/crypto/secp256k1/ecdsa.bend as E
import bend-collections-laws-crypto@1.0.0.0/proofs/crypto/secp256k1/bytes.bend as BY

41def hash_v(+one: Nat, +h1: {one == 1n : Nat}, +h: List<&2, U32>, +hl: {B.has_len(32n, h) == True{} : Bool}) -> {FS.value(one, E.hash_scalar(h)) == ES.hash_scalar(one, h) : Nat}:
42  %Equal.sym(Nat, FS.value(one, S.reduce(B.of_be(h))), Nat.mod(FS.value(one, B.of_be(h)), FS.order(one)), sred_v(one, h1, B.of_be(h), BY.of_be_limbs(one, h1, h, hl))) : {_ == Nat.mod(CV.os2ip(h), FS.order(one)) : Nat}
43  %Equal.sym(Nat, FS.value(one, B.of_be(h)), CV.os2ip(h), BY.of_be_value(one, h1, h)) : {Nat.mod(_, FS.order(one)) == Nat.mod(CV.os2ip(h), FS.order(one)) : Nat}
44  {==}

Uses (17)

Used by (4)