Field.fsqrt: def of bend-collections@1.0.0.0 Import: import bend-collections@1.0.0.0/spec/crypto/secp256k1/field.bend as Field Lines 66-69 of bend-collections@1.0.0.0/spec/crypto/secp256k1/field.bend: https://jend.leeeet.dev/read.txt?path=bend-collections@1.0.0.0/spec/crypto/secp256k1/field.bend&start_line=66&end_line=69 import Base # a^((p + 1) / 4): a square root of a whenever a is a square mod p # (p = 3 mod 4) def fsqrt(+m: Nat, a: Nat) -> Nat: mpow(m, a, Nat.div(Nat.add(m, 1n), 4n)) Uses (4): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.add https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.div https://jend.leeeet.dev/definition.txt?path=bend-collections@1.0.0.0/spec/crypto/secp256k1/field.bend&name=mpow