Documentation ¶
Index ¶
- type Element
- func (v *Element) Abs(u *Element) *Element
- func (v *Element) Add(a, b *Element) *Element
- func (v *Element) Bytes() []byte
- func (v *Element) Equal(u *Element) int
- func (v *Element) Inv(z *Element) *Element
- func (v *Element) IsNegative() int
- func (v *Element) Mul(a, b *Element) *Element
- func (v *Element) Mul32(x *Element, y uint32) *Element
- func (v *Element) Negate(a *Element) *Element
- func (v *Element) One() *Element
- func (v *Element) Power446(z *Element) *Element
- func (v *Element) Select(a, b *Element, cond int) *Element
- func (v *Element) Set(a *Element) *Element
- func (v *Element) SetBytes(x []byte) *Element
- func (r *Element) SqrtRatio(u, v *Element) (rr *Element, wasSquare int)
- func (v *Element) Square(a *Element) *Element
- func (v *Element) Sub(a, b *Element) *Element
- func (v *Element) Swap(u *Element, cond int)
- func (v *Element) Zero() *Element
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 represents an element of the field GF(2^448-2^224-1). Note that this is not a cryptographically secure group
This type works similarly to math/big.Int, and all arguments and receivers are allowed to alias.
The zero value is a valid zero element.
func (*Element) IsNegative ¶
IsNegative returns 1 if v is negative, and 0 otherwise.
func (*Element) Power446 ¶
Power446 sets v = v ^ ((p-3)/4) mod p, and returns v. (p-3)/4 is 2^446 - 2^222 - 1.
func (*Element) SqrtRatio ¶
SqrtRatio sets r to the non-negative square root of the ratio of u and v.
If u/v is square, SqrtRatio returns r and 1. If u/v is not square, SqrtRatio sets r according to Section 5.2 of draft-irtf-cfrg-ristretto255-decaf448-04, and returns r and 0.