def even_r

bend-collections-laws-crypto@1.0.0.0 · proofs/crypto/secp256k1/pschn.bend:102

import bend-collections-laws-crypto@1.0.0.0/proofs/crypto/secp256k1/pschn.bend as Pschn
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/src/crypto/secp256k1/field.bend as F
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/schnorr.bend as SC
import bend-collections-laws-crypto@1.0.0.0/proofs/crypto/secp256k1/fwrap.bend as FW
import bend-collections-laws-crypto@1.0.0.0/proofs/crypto/secp256k1/penc.bend as PE

102def even_r(+one: Nat, +h1: {one == 1n : Nat}, +y: List<&2, Nat>, +x: List<&2, Nat>, +hx: {FS.reduced(one, FS.order(one), x) == True{} : Bool}) -> {FS.reduced(one, FS.order(one), S.select(SC.is_odd(y), S.neg(x), x)) == True{} : Bool}:
103  %Equal.sym(Nat, F.parity(y), Nat.mod(FS.value(one, y), 2n), FW.parity_f(one, h1, y)) : {FS.reduced(one, FS.order(one), S.select(_, S.neg(x), x)) == True{} : Bool}
104  ev_qr(one, h1, Nat.mod(FS.value(one, y), 2n), x, hx, PE.mod2_lt(FS.value(one, y)))

Uses (15)

Used by (2)