def PowP58.value

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

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

145# a^((p - 5) / 8), RFC 8032 section 5.1.3
146def PowP58.value(+one: Nat, +h1: {one == 1n : Nat}, +a: List<&2, U32>, +ha: {tight(a) == True{} : Bool}) -> Type:
147  {Nat.mod(value(F.pow_p58(a)), prime(one)) == fpow(prime(one), value(a), Nat.div(Nat.sub(prime(one), 5n), 8n)) : Nat}

Uses (12)

Used by (1)