fiat
packagestandard libraryThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
Links
Documentation¶
Index¶
- type P224Element
- func (e *P224Element) Add(t1, t2 *P224Element) *P224Element
- func (e *P224Element) Bytes() []byte
- func (e *P224Element) Equal(t *P224Element) int
- func (e *P224Element) Invert(x *P224Element) *P224Element
- func (e *P224Element) IsZero() int
- func (e *P224Element) Mul(t1, t2 *P224Element) *P224Element
- func (e *P224Element) One() *P224Element
- func (v *P224Element) Select(a, b *P224Element, cond int) *P224Element
- func (e *P224Element) Set(t *P224Element) *P224Element
- func (e *P224Element) SetBytes(v []byte) (*P224Element, error)
- func (e *P224Element) Square(t *P224Element) *P224Element
- func (e *P224Element) Sub(t1, t2 *P224Element) *P224Element
- type P256Element
- func (e *P256Element) Add(t1, t2 *P256Element) *P256Element
- func (e *P256Element) Bytes() []byte
- func (e *P256Element) Equal(t *P256Element) int
- func (e *P256Element) Invert(x *P256Element) *P256Element
- func (e *P256Element) IsZero() int
- func (e *P256Element) Mul(t1, t2 *P256Element) *P256Element
- func (e *P256Element) One() *P256Element
- func (v *P256Element) Select(a, b *P256Element, cond int) *P256Element
- func (e *P256Element) Set(t *P256Element) *P256Element
- func (e *P256Element) SetBytes(v []byte) (*P256Element, error)
- func (e *P256Element) Square(t *P256Element) *P256Element
- func (e *P256Element) Sub(t1, t2 *P256Element) *P256Element
- type P384Element
- func (e *P384Element) Add(t1, t2 *P384Element) *P384Element
- func (e *P384Element) Bytes() []byte
- func (e *P384Element) Equal(t *P384Element) int
- func (e *P384Element) Invert(x *P384Element) *P384Element
- func (e *P384Element) IsZero() int
- func (e *P384Element) Mul(t1, t2 *P384Element) *P384Element
- func (e *P384Element) One() *P384Element
- func (v *P384Element) Select(a, b *P384Element, cond int) *P384Element
- func (e *P384Element) Set(t *P384Element) *P384Element
- func (e *P384Element) SetBytes(v []byte) (*P384Element, error)
- func (e *P384Element) Square(t *P384Element) *P384Element
- func (e *P384Element) Sub(t1, t2 *P384Element) *P384Element
- type P521Element
- func (e *P521Element) Add(t1, t2 *P521Element) *P521Element
- func (e *P521Element) Bytes() []byte
- func (e *P521Element) Equal(t *P521Element) int
- func (e *P521Element) Invert(x *P521Element) *P521Element
- func (e *P521Element) IsZero() int
- func (e *P521Element) Mul(t1, t2 *P521Element) *P521Element
- func (e *P521Element) One() *P521Element
- func (v *P521Element) Select(a, b *P521Element, cond int) *P521Element
- func (e *P521Element) Set(t *P521Element) *P521Element
- func (e *P521Element) SetBytes(v []byte) (*P521Element, error)
- func (e *P521Element) Square(t *P521Element) *P521Element
- func (e *P521Element) Sub(t1, t2 *P521Element) *P521Element
Constants¶
This section is empty.
Variables¶
This section is empty.
Functions¶
This section is empty.
Types¶
typeP224Element¶
type P224Element struct {// contains filtered or unexported fields}P224Element is an integer modulo 2^224 - 2^96 + 1.
The zero value is a valid zero element.
func (*P224Element)Add¶
func (e *P224Element) Add(t1, t2 *P224Element) *P224Element
Add sets e = t1 + t2, and returns e.
func (*P224Element)Bytes¶
func (e *P224Element) Bytes() []byte
Bytes returns the 28-byte big-endian encoding of e.
func (*P224Element)Equal¶
func (e *P224Element) Equal(t *P224Element)int
Equal returns 1 if e == t, and zero otherwise.
func (*P224Element)Invert¶
func (e *P224Element) Invert(x *P224Element) *P224Element
Invert sets e = 1/x, and returns e.
If x == 0, Invert returns e = 0.
func (*P224Element)IsZero¶
func (e *P224Element) IsZero()int
IsZero returns 1 if e == 0, and zero otherwise.
func (*P224Element)Mul¶
func (e *P224Element) Mul(t1, t2 *P224Element) *P224Element
Mul sets e = t1 * t2, and returns e.
func (*P224Element)Select¶
func (v *P224Element) Select(a, b *P224Element, condint) *P224Element
Select sets v to a if cond == 1, and to b if cond == 0.
func (*P224Element)Set¶
func (e *P224Element) Set(t *P224Element) *P224Element
Set sets e = t, and returns e.
func (*P224Element)SetBytes¶
func (e *P224Element) SetBytes(v []byte) (*P224Element,error)
SetBytes sets e = v, where v is a big-endian 28-byte encoding, and returns e.If v is not 28 bytes or it encodes a value higher than 2^224 - 2^96 + 1,SetBytes returns nil and an error, and e is unchanged.
func (*P224Element)Square¶
func (e *P224Element) Square(t *P224Element) *P224Element
Square sets e = t * t, and returns e.
func (*P224Element)Sub¶
func (e *P224Element) Sub(t1, t2 *P224Element) *P224Element
Sub sets e = t1 - t2, and returns e.
typeP256Element¶
type P256Element struct {// contains filtered or unexported fields}P256Element is an integer modulo 2^256 - 2^224 + 2^192 + 2^96 - 1.
The zero value is a valid zero element.
func (*P256Element)Add¶
func (e *P256Element) Add(t1, t2 *P256Element) *P256Element
Add sets e = t1 + t2, and returns e.
func (*P256Element)Bytes¶
func (e *P256Element) Bytes() []byte
Bytes returns the 32-byte big-endian encoding of e.
func (*P256Element)Equal¶
func (e *P256Element) Equal(t *P256Element)int
Equal returns 1 if e == t, and zero otherwise.
func (*P256Element)Invert¶
func (e *P256Element) Invert(x *P256Element) *P256Element
Invert sets e = 1/x, and returns e.
If x == 0, Invert returns e = 0.
func (*P256Element)IsZero¶
func (e *P256Element) IsZero()int
IsZero returns 1 if e == 0, and zero otherwise.
func (*P256Element)Mul¶
func (e *P256Element) Mul(t1, t2 *P256Element) *P256Element
Mul sets e = t1 * t2, and returns e.
func (*P256Element)Select¶
func (v *P256Element) Select(a, b *P256Element, condint) *P256Element
Select sets v to a if cond == 1, and to b if cond == 0.
func (*P256Element)Set¶
func (e *P256Element) Set(t *P256Element) *P256Element
Set sets e = t, and returns e.
func (*P256Element)SetBytes¶
func (e *P256Element) SetBytes(v []byte) (*P256Element,error)
SetBytes sets e = v, where v is a big-endian 32-byte encoding, and returns e.If v is not 32 bytes or it encodes a value higher than 2^256 - 2^224 + 2^192 + 2^96 - 1,SetBytes returns nil and an error, and e is unchanged.
func (*P256Element)Square¶
func (e *P256Element) Square(t *P256Element) *P256Element
Square sets e = t * t, and returns e.
func (*P256Element)Sub¶
func (e *P256Element) Sub(t1, t2 *P256Element) *P256Element
Sub sets e = t1 - t2, and returns e.
typeP384Element¶
type P384Element struct {// contains filtered or unexported fields}P384Element is an integer modulo 2^384 - 2^128 - 2^96 + 2^32 - 1.
The zero value is a valid zero element.
func (*P384Element)Add¶
func (e *P384Element) Add(t1, t2 *P384Element) *P384Element
Add sets e = t1 + t2, and returns e.
func (*P384Element)Bytes¶
func (e *P384Element) Bytes() []byte
Bytes returns the 48-byte big-endian encoding of e.
func (*P384Element)Equal¶
func (e *P384Element) Equal(t *P384Element)int
Equal returns 1 if e == t, and zero otherwise.
func (*P384Element)Invert¶
func (e *P384Element) Invert(x *P384Element) *P384Element
Invert sets e = 1/x, and returns e.
If x == 0, Invert returns e = 0.
func (*P384Element)IsZero¶
func (e *P384Element) IsZero()int
IsZero returns 1 if e == 0, and zero otherwise.
func (*P384Element)Mul¶
func (e *P384Element) Mul(t1, t2 *P384Element) *P384Element
Mul sets e = t1 * t2, and returns e.
func (*P384Element)Select¶
func (v *P384Element) Select(a, b *P384Element, condint) *P384Element
Select sets v to a if cond == 1, and to b if cond == 0.
func (*P384Element)Set¶
func (e *P384Element) Set(t *P384Element) *P384Element
Set sets e = t, and returns e.
func (*P384Element)SetBytes¶
func (e *P384Element) SetBytes(v []byte) (*P384Element,error)
SetBytes sets e = v, where v is a big-endian 48-byte encoding, and returns e.If v is not 48 bytes or it encodes a value higher than 2^384 - 2^128 - 2^96 + 2^32 - 1,SetBytes returns nil and an error, and e is unchanged.
func (*P384Element)Square¶
func (e *P384Element) Square(t *P384Element) *P384Element
Square sets e = t * t, and returns e.
func (*P384Element)Sub¶
func (e *P384Element) Sub(t1, t2 *P384Element) *P384Element
Sub sets e = t1 - t2, and returns e.
typeP521Element¶
type P521Element struct {// contains filtered or unexported fields}P521Element is an integer modulo 2^521 - 1.
The zero value is a valid zero element.
func (*P521Element)Add¶
func (e *P521Element) Add(t1, t2 *P521Element) *P521Element
Add sets e = t1 + t2, and returns e.
func (*P521Element)Bytes¶
func (e *P521Element) Bytes() []byte
Bytes returns the 66-byte big-endian encoding of e.
func (*P521Element)Equal¶
func (e *P521Element) Equal(t *P521Element)int
Equal returns 1 if e == t, and zero otherwise.
func (*P521Element)Invert¶
func (e *P521Element) Invert(x *P521Element) *P521Element
Invert sets e = 1/x, and returns e.
If x == 0, Invert returns e = 0.
func (*P521Element)IsZero¶
func (e *P521Element) IsZero()int
IsZero returns 1 if e == 0, and zero otherwise.
func (*P521Element)Mul¶
func (e *P521Element) Mul(t1, t2 *P521Element) *P521Element
Mul sets e = t1 * t2, and returns e.
func (*P521Element)Select¶
func (v *P521Element) Select(a, b *P521Element, condint) *P521Element
Select sets v to a if cond == 1, and to b if cond == 0.
func (*P521Element)Set¶
func (e *P521Element) Set(t *P521Element) *P521Element
Set sets e = t, and returns e.
func (*P521Element)SetBytes¶
func (e *P521Element) SetBytes(v []byte) (*P521Element,error)
SetBytes sets e = v, where v is a big-endian 66-byte encoding, and returns e.If v is not 66 bytes or it encodes a value higher than 2^521 - 1,SetBytes returns nil and an error, and e is unchanged.
func (*P521Element)Square¶
func (e *P521Element) Square(t *P521Element) *P521Element
Square sets e = t * t, and returns e.
func (*P521Element)Sub¶
func (e *P521Element) Sub(t1, t2 *P521Element) *P521Element
Sub sets e = t1 - t2, and returns e.