Discover Packages
github.com/karalef/circl
math
fp25519
package
Version:
v0.0.0-...-4223e8c
Opens a new window with list of versions in this module.
Published: Jun 21, 2023
License: BSD-3-Clause
Opens a new window with license information.
Imports: 5
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Jump to ...
Documentation
Overview
Index
Constants
Variables
Functions
Add(z, x, y)
AddSub(x, y)
Cmov(x, y, n)
Cswap(x, y, n)
Inv(z, x)
InvSqrt(z, x, y)
IsZero(x)
Modp(z)
Mul(z, x, y)
Neg(z, x)
SetOne(x)
Sqr(z, x)
Sub(z, x, y)
ToBytes(b, x)
Types
Source Files
Documentation
Documentation
¶
Rendered for
linux/amd64
windows/amd64
darwin/amd64
js/wasm
Package fp25519 provides prime field arithmetic over GF(2^255-19).
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 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
Size in bytes of an element.
Add calculates z = x+y mod p.
AddSub calculates (x,y) = (x+y mod p, x-y mod p).
Cmov assigns y to x if n is 1.
Cswap interchanges x and y if n is 1.
Inv calculates z = 1/x mod p.
func InvSqrt(z, x, y *Elt ) (isQR bool )
InvSqrt calculates z = sqrt(x/y) iff x/y is a quadratic-residue, which is
indicated by returning isQR = true. Otherwise, when x/y is a quadratic
non-residue, z will have an undetermined value and isQR = false.
IsZero returns true if x is equal to 0.
Modp ensures that z is between [0,p-1].
Mul calculates z = x*y mod p.
Sqr calculates z = x^2 mod p.
Sub calculates z = x-y mod p.
ToBytes stores in b the little-endian byte representation of x.
Elt is a prime field element.
P returns the prime modulus 2^255-19.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.