def finv

bend-collections-laws-crypto@1.0.0.0 · spec/crypto/curve25519/field.bend:96

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

96# a^(p - 2): the inverse of a nonzero a (Fermat), 0 for 0 (RFC 7748 section 5)
97def finv(+p: Nat, a: Nat) -> Nat:
98  fpow(p, a, Nat.sub(p, 2n))

Uses (3)

Used by (13)