def dec_y

bend-collections@1.0.0.0 · src/crypto/ed25519/point.bend:156

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

156def dec_y(+c: Cs, +y: List<&2, U32>, +x0: U32, bad: Bool) -> Maybe<&2, Pt>:
157  match bad:
158    case True{}:
159      None{}
160    case False{}:
161      +yy = F.sq(y)
162      +u = F.sub(yy, F.one())
163      +v = F.add(F.mul(cs_d(c), yy), F.one())
164      +v3 = F.mul(F.sq(v), v)
165      +v7 = F.mul(F.sq(v3), v)
166      +x = F.mul(F.mul(u, v3), F.pow_p58(F.mul(u, v7)))
167      +vxx = F.mul(v, F.sq(x))
168      dec_root(c, x, y, x0, u, vxx, F.eq(vxx, u), F.eq(vxx, F.neg(u)))

Uses (16)

Used by (1)