def finv
import bend-collections-laws-crypto@1.0.0.0/spec/crypto/curve25519/field.bend as Fieldimport 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)
- bend-collections-laws-crypto@1.0.0.0/spec/crypto/ed25519:dconst
- bend-collections-laws-crypto@1.0.0.0/spec/crypto/ed25519:base
- bend-collections-laws-crypto@1.0.0.0/proofs/crypto/ed25519/pcodec:r_d
- bend-collections-laws-crypto@1.0.0.0/spec/crypto/curve25519/x25519:finish
- bend-collections-laws-crypto@1.0.0.0/proofs/crypto/curve25519/rel:r_inv
- …