def lift_y

bend-collections-laws-crypto@1.0.0.0 · src/crypto/secp256k1/point.bend:165

import bend-collections-laws-crypto@1.0.0.0/src/crypto/secp256k1/point.bend as Point
import Base
import bend-collections-laws-crypto@1.0.0.0/src/crypto/secp256k1/field.bend as F

165# the square root of x^3 + 7 with the given parity, if x^3 + 7 is a square
166def lift_y(+y: List<&2, Nat>, +par: Nat) -> List<&2, Nat>:
167  F.select(Nat.sub(Nat.add(F.parity(y), par), Nat.mul(Nat.mul(F.parity(y), par), 2n)), F.neg(y), y)

Uses (8)

Used by (6)