Documentation ¶
Index ¶
- type Element
- func (e *Element) Add(t1, t2 *Element) *Element
- func (e *Element) Bytes() []byte
- func (e *Element) Equal(t *Element) int
- func (e *Element) Invert(x *Element) *Element
- func (e *Element) IsZero() int
- func (e *Element) Mul(t1, t2 *Element) *Element
- func (e *Element) One() *Element
- func (v *Element) Select(a, b *Element, cond int) *Element
- func (e *Element) Set(t *Element) *Element
- func (e *Element) SetBytes(v []byte) (*Element, error)
- func (e *Element) Square(t *Element) *Element
- func (e *Element) Sub(t1, t2 *Element) *Element
- type OrderElement
- func (e *OrderElement) Add(t1, t2 *OrderElement) *OrderElement
- func (e *OrderElement) Bytes() []byte
- func (e *OrderElement) Mul(t1, t2 *OrderElement) *OrderElement
- func (e *OrderElement) One() *OrderElement
- func (v *OrderElement) Select(a, b *OrderElement, cond int) *OrderElement
- func (e *OrderElement) SetBytes(v []byte) (*OrderElement, error)
- func (e *OrderElement) Square(t *OrderElement) *OrderElement
- func (e *OrderElement) Sub(t1, t2 *OrderElement) *OrderElement
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Element ¶
type Element struct {
// contains filtered or unexported fields
}
Element is an integer modulo 2^256 - 2^224 - 2^96 + 2^64 - 1.
The zero value is a valid zero element.
func (*Element) SetBytes ¶
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^96 + 2^64 - 1, SetBytes returns nil and an error, and e is unchanged.
type OrderElement ¶
type OrderElement struct {
// contains filtered or unexported fields
}
OrderElement is an integer modulo 0xFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFF7203DF6B21C6052B53BBF40939D54123.
The zero value is a valid zero element.
func (*OrderElement) Add ¶
func (e *OrderElement) Add(t1, t2 *OrderElement) *OrderElement
Add sets e = t1 + t2, and returns e.
func (*OrderElement) Bytes ¶
func (e *OrderElement) Bytes() []byte
Bytes returns the 32-byte big-endian encoding of e.
func (*OrderElement) Mul ¶
func (e *OrderElement) Mul(t1, t2 *OrderElement) *OrderElement
Mul sets e = t1 * t2, and returns e.
func (*OrderElement) One ¶
func (e *OrderElement) One() *OrderElement
One sets e = 1, and returns e.
func (*OrderElement) Select ¶
func (v *OrderElement) Select(a, b *OrderElement, cond int) *OrderElement
Select sets v to a if cond == 1, and to b if cond == 0.
func (*OrderElement) SetBytes ¶
func (e *OrderElement) SetBytes(v []byte) (*OrderElement, 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^96 + 2^64 - 1, SetBytes returns nil and an error, and e is unchanged.
func (*OrderElement) Square ¶
func (e *OrderElement) Square(t *OrderElement) *OrderElement
Square sets e = t * t, and returns e.
func (*OrderElement) Sub ¶
func (e *OrderElement) Sub(t1, t2 *OrderElement) *OrderElement
Sub sets e = t1 - t2, and returns e.