package fp448
import "github.com/cloudflare/circl/math/fp448"
Package fp448 provides prime field arithmetic over GF(2^448-2^224-1).
Index ¶
- Constants
- func Add(z, x, y *Elt)
- func AddSub(x, y *Elt)
- func Cmov(x, y *Elt, n uint)
- func Cswap(x, y *Elt, n uint)
- func Inv(z, x *Elt)
- func InvSqrt(z, x, y *Elt) (isQR bool)
- func IsOne(x *Elt) bool
- func IsZero(x *Elt) bool
- func Modp(z *Elt)
- func Mul(z, x, y *Elt)
- func Neg(z, x *Elt)
- func SetOne(x *Elt)
- func Sqr(z, x *Elt)
- func Sub(z, x, y *Elt)
- func ToBytes(b []byte, x *Elt) error
- type Elt
Constants ¶
const Size = 56
Size in bytes of an element.
Functions ¶
func Add ¶
func Add(z, x, y *Elt)
Add calculates z = x+y mod p.
func AddSub ¶
func AddSub(x, y *Elt)
AddSub calculates (x,y) = (x+y mod p, x-y mod p).
func Cmov ¶
Cmov assigns y to x if n is 1.
func Cswap ¶
Cswap interchanges x and y if n is 1.
func Inv ¶
func Inv(z, x *Elt)
Inv calculates z = 1/x mod p.
func InvSqrt ¶
InvSqrt calculates z = sqrt(x/y) iff x/y is a quadratic-residue. If so, isQR = true; otherwise, isQR = false, since x/y is a quadratic non-residue, and z = sqrt(-x/y).
func IsOne ¶
IsOne returns true if x is equal to 1.
func IsZero ¶
IsZero returns true if x is equal to 0.
func Modp ¶
func Modp(z *Elt)
Modp ensures that z is between [0,p-1].
func Mul ¶
func Mul(z, x, y *Elt)
Mul calculates z = x*y mod p.
func Neg ¶
func Neg(z, x *Elt)
Neg calculates z = -x.
func SetOne ¶
func SetOne(x *Elt)
SetOne assigns x=1.
func Sqr ¶
func Sqr(z, x *Elt)
Sqr calculates z = x^2 mod p.
func Sub ¶
func Sub(z, x, y *Elt)
Sub calculates z = x-y mod p.
func ToBytes ¶
ToBytes stores in b the little-endian byte representation of x.
Types ¶
type Elt ¶
type Elt [Size]byte
Elt is a prime field element.
func One ¶
func One() (x Elt)
One returns the 1 element.
func P ¶
func P() Elt
P returns the prime modulus 2^448-2^224-1.
func (Elt) String ¶
Source Files ¶
fp.go fp_amd64.go fp_generic.go
- Version
- v1.6.1 (latest)
- Published
- Apr 9, 2025
- Platform
- linux/amd64
- Imports
- 5 packages
- Last checked
- 3 days ago –
Tools for package owners.