def even_v
bend-collections-laws-crypto@1.0.0.0 · proofs/crypto/secp256k1/pschn.bend:98
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/spec/crypto/secp256k1/schnorr.bend as SS
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
98def even_v(+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.value(one, S.select(SC.is_odd(y), S.neg(x), x)) == SS.even(FS.order(one), FS.value(one, y), FS.value(one, x)) : Nat}:
99 %Equal.sym(Nat, F.parity(y), Nat.mod(FS.value(one, y), 2n), FW.parity_f(one, h1, y)) : {FS.value(one, S.select(_, S.neg(x), x)) == SS.even_b(FS.order(one), Nat.mod(FS.value(one, y), 2n), FS.value(one, x)) : Nat}
100 ev_q(one, h1, Nat.mod(FS.value(one, y), 2n), x, hx, PE.mod2_lt(FS.value(one, y)))