def lift_if

bend-collections@1.0.0.0 · spec/crypto/secp256k1/schnorr.bend:57

import bend-collections@1.0.0.0/spec/crypto/secp256k1/schnorr.bend as Schnorr
import Base
import bend-collections@1.0.0.0/spec/crypto/secp256k1/curve.bend as CV

57# lift_x(x): the point with x-coordinate x and even y, if x < p and
58# x^3 + 7 is a square
59def lift_if(+one: Nat, +x: Nat, ok: Bool) -> Maybe<&2, CV.SPoint>:
60  match ok:
61    case True{}: CV.decompress(p(one), x, 0n)
62    case False{}: None{}

Uses (6)

Used by (1)