def lift_r

bend-collections-laws-crypto@1.0.0.0 · proofs/crypto/secp256k1/penc.bend:161

import bend-collections-laws-crypto@1.0.0.0/proofs/crypto/secp256k1/penc.bend as Penc
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/point.bend as P
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/point.bend as PT

161def lift_r(+one: Nat, +h1: {one == 1n : Nat}, +y: List<&2, Nat>, +par: Nat, +hy: {PT.red(one, y) == True{} : Bool}, +hp: {Nat.is_lt(par, 2n) == True{} : Bool}) -> {PT.red(one, P.lift_y(y, par)) == True{} : Bool}:
162  %Equal.sym(Nat, F.parity(y), Nat.mod(FS.value(one, y), 2n), FW.parity_f(one, h1, y)) : {PT.red(one, F.select(Nat.sub(Nat.add(_, par), Nat.mul(Nat.mul(F.parity(y), par), 2n)), F.neg(y), y)) == True{} : Bool}
163  %Equal.sym(Nat, F.parity(y), Nat.mod(FS.value(one, y), 2n), FW.parity_f(one, h1, y)) : {PT.red(one, F.select(Nat.sub(Nat.add(Nat.mod(FS.value(one, y), 2n), par), Nat.mul(Nat.mul(_, par), 2n)), F.neg(y), y)) == True{} : Bool}
164  pick_r(one, h1, Nat.mod(FS.value(one, y), 2n), par, y, mod2_lt(FS.value(one, y)), hp, hy)

Uses (18)

Used by (1)