def fsqrt

bend-collections-laws-crypto@1.0.0.0 · spec/crypto/secp256k1/field.bend:66

import bend-collections-laws-crypto@1.0.0.0/spec/crypto/secp256k1/field.bend as Field
import Base

66# a^((p + 1) / 4): a square root of a whenever a is a square mod p
67# (p = 3 mod 4)
68def fsqrt(+m: Nat, a: Nat) -> Nat:
69  mpow(m, a, Nat.div(Nat.add(m, 1n), 4n))

Uses (4)

Used by (3)