Package-Level Type Names (total 18, in which 3 are exported)
/* sort exporteds by: | */
P224Element is an integer modulo 2^224 - 2^96 + 1.
The zero value is a valid zero element.
Values are represented internally always in the Montgomery domain, and
converted in Bytes and SetBytes.
Add sets e = t1 + t2, and returns e.
Bytes returns the 28-byte big-endian encoding of e.
Equal returns 1 if e == t, and zero otherwise.
Invert sets e = 1/x, and returns e.
If x == 0, Invert returns e = 0.
IsZero returns 1 if e == 0, and zero otherwise.
Mul sets e = t1 * t2, and returns e.
One sets e = 1, and returns e.
Select sets v to a if cond == 1, and to b if cond == 0.
Set sets e = t, and returns e.
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.
Square sets e = t * t, and returns e.
Sub sets e = t1 - t2, and returns e.
(*P224Element) bytes(out *[28]byte) []byte
func (*P224Element).Add(t1, t2 *P224Element) *P224Element
func (*P224Element).Invert(x *P224Element) *P224Element
func (*P224Element).Mul(t1, t2 *P224Element) *P224Element
func (*P224Element).One() *P224Element
func (*P224Element).Select(a, b *P224Element, cond int) *P224Element
func (*P224Element).Set(t *P224Element) *P224Element
func (*P224Element).SetBytes(v []byte) (*P224Element, error)
func (*P224Element).Square(t *P224Element) *P224Element
func (*P224Element).Sub(t1, t2 *P224Element) *P224Element
func (*P224Element).Add(t1, t2 *P224Element) *P224Element
func (*P224Element).Equal(t *P224Element) int
func (*P224Element).Invert(x *P224Element) *P224Element
func (*P224Element).Mul(t1, t2 *P224Element) *P224Element
func (*P224Element).Select(a, b *P224Element, cond int) *P224Element
func (*P224Element).Set(t *P224Element) *P224Element
func (*P224Element).Square(t *P224Element) *P224Element
func (*P224Element).Sub(t1, t2 *P224Element) *P224Element
func crypto/elliptic/internal/nistec.p224CheckOnCurve(x, y *P224Element) error
var crypto/elliptic/internal/nistec.p224B *P224Element
P384Element is an integer modulo 2^384 - 2^128 - 2^96 + 2^32 - 1.
The zero value is a valid zero element.
Values are represented internally always in the Montgomery domain, and
converted in Bytes and SetBytes.
Add sets e = t1 + t2, and returns e.
Bytes returns the 48-byte big-endian encoding of e.
Equal returns 1 if e == t, and zero otherwise.
Invert sets e = 1/x, and returns e.
If x == 0, Invert returns e = 0.
IsZero returns 1 if e == 0, and zero otherwise.
Mul sets e = t1 * t2, and returns e.
One sets e = 1, and returns e.
Select sets v to a if cond == 1, and to b if cond == 0.
Set sets e = t, and returns e.
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.
Square sets e = t * t, and returns e.
Sub sets e = t1 - t2, and returns e.
(*P384Element) bytes(out *[48]byte) []byte
func (*P384Element).Add(t1, t2 *P384Element) *P384Element
func (*P384Element).Invert(x *P384Element) *P384Element
func (*P384Element).Mul(t1, t2 *P384Element) *P384Element
func (*P384Element).One() *P384Element
func (*P384Element).Select(a, b *P384Element, cond int) *P384Element
func (*P384Element).Set(t *P384Element) *P384Element
func (*P384Element).SetBytes(v []byte) (*P384Element, error)
func (*P384Element).Square(t *P384Element) *P384Element
func (*P384Element).Sub(t1, t2 *P384Element) *P384Element
func (*P384Element).Add(t1, t2 *P384Element) *P384Element
func (*P384Element).Equal(t *P384Element) int
func (*P384Element).Invert(x *P384Element) *P384Element
func (*P384Element).Mul(t1, t2 *P384Element) *P384Element
func (*P384Element).Select(a, b *P384Element, cond int) *P384Element
func (*P384Element).Set(t *P384Element) *P384Element
func (*P384Element).Square(t *P384Element) *P384Element
func (*P384Element).Sub(t1, t2 *P384Element) *P384Element
func crypto/elliptic/internal/nistec.p384CheckOnCurve(x, y *P384Element) error
var crypto/elliptic/internal/nistec.p384B *P384Element
P521Element is an integer modulo 2^521 - 1.
The zero value is a valid zero element.
Values are represented internally always in the Montgomery domain, and
converted in Bytes and SetBytes.
Add sets e = t1 + t2, and returns e.
Bytes returns the 66-byte big-endian encoding of e.
Equal returns 1 if e == t, and zero otherwise.
Invert sets e = 1/x, and returns e.
If x == 0, Invert returns e = 0.
IsZero returns 1 if e == 0, and zero otherwise.
Mul sets e = t1 * t2, and returns e.
One sets e = 1, and returns e.
Select sets v to a if cond == 1, and to b if cond == 0.
Set sets e = t, and returns e.
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.
Square sets e = t * t, and returns e.
Sub sets e = t1 - t2, and returns e.
(*P521Element) bytes(out *[66]byte) []byte
func (*P521Element).Add(t1, t2 *P521Element) *P521Element
func (*P521Element).Invert(x *P521Element) *P521Element
func (*P521Element).Mul(t1, t2 *P521Element) *P521Element
func (*P521Element).One() *P521Element
func (*P521Element).Select(a, b *P521Element, cond int) *P521Element
func (*P521Element).Set(t *P521Element) *P521Element
func (*P521Element).SetBytes(v []byte) (*P521Element, error)
func (*P521Element).Square(t *P521Element) *P521Element
func (*P521Element).Sub(t1, t2 *P521Element) *P521Element
func (*P521Element).Add(t1, t2 *P521Element) *P521Element
func (*P521Element).Equal(t *P521Element) int
func (*P521Element).Invert(x *P521Element) *P521Element
func (*P521Element).Mul(t1, t2 *P521Element) *P521Element
func (*P521Element).Select(a, b *P521Element, cond int) *P521Element
func (*P521Element).Set(t *P521Element) *P521Element
func (*P521Element).Square(t *P521Element) *P521Element
func (*P521Element).Sub(t1, t2 *P521Element) *P521Element
func crypto/elliptic/internal/nistec.p521CheckOnCurve(x, y *P521Element) error
var crypto/elliptic/internal/nistec.p521B *P521Element
The type p224NonMontgomeryDomainFieldElement is a field element NOT in the Montgomery domain.
Bounds: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]]
func p224FromMontgomery(out1 *p224NonMontgomeryDomainFieldElement, arg1 *p224MontgomeryDomainFieldElement)
func p224ToMontgomery(out1 *p224MontgomeryDomainFieldElement, arg1 *p224NonMontgomeryDomainFieldElement)
The type p384NonMontgomeryDomainFieldElement is a field element NOT in the Montgomery domain.
Bounds: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]]
func p384FromMontgomery(out1 *p384NonMontgomeryDomainFieldElement, arg1 *p384MontgomeryDomainFieldElement)
func p384ToMontgomery(out1 *p384MontgomeryDomainFieldElement, arg1 *p384NonMontgomeryDomainFieldElement)
Package-Level Functions (total 36, none are exported)
p224Add adds two field elements in the Montgomery domain.
Preconditions:
0 ≤ eval arg1 < m
0 ≤ eval arg2 < m
Postconditions:
eval (from_montgomery out1) mod m = (eval (from_montgomery arg1) + eval (from_montgomery arg2)) mod m
0 ≤ eval out1 < m
p224FromBytes deserializes a field element NOT in the Montgomery domain from bytes in little-endian order.
Preconditions:
0 ≤ bytes_eval arg1 < m
Postconditions:
eval out1 mod m = bytes_eval arg1 mod m
0 ≤ eval out1 < m
Input Bounds:
arg1: [[0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff]]
Output Bounds:
out1: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffff]]
p224FromMontgomery translates a field element out of the Montgomery domain.
Preconditions:
0 ≤ eval arg1 < m
Postconditions:
eval out1 mod m = (eval arg1 * ((2^64)⁻¹ mod m)^4) mod m
0 ≤ eval out1 < m
p224Mul multiplies two field elements in the Montgomery domain.
Preconditions:
0 ≤ eval arg1 < m
0 ≤ eval arg2 < m
Postconditions:
eval (from_montgomery out1) mod m = (eval (from_montgomery arg1) * eval (from_montgomery arg2)) mod m
0 ≤ eval out1 < m
p224SetOne returns the field element one in the Montgomery domain.
Postconditions:
eval (from_montgomery out1) mod m = 1 mod m
0 ≤ eval out1 < m
p224Square squares a field element in the Montgomery domain.
Preconditions:
0 ≤ eval arg1 < m
Postconditions:
eval (from_montgomery out1) mod m = (eval (from_montgomery arg1) * eval (from_montgomery arg1)) mod m
0 ≤ eval out1 < m
p224Sub subtracts two field elements in the Montgomery domain.
Preconditions:
0 ≤ eval arg1 < m
0 ≤ eval arg2 < m
Postconditions:
eval (from_montgomery out1) mod m = (eval (from_montgomery arg1) - eval (from_montgomery arg2)) mod m
0 ≤ eval out1 < m
p224ToMontgomery translates a field element into the Montgomery domain.
Preconditions:
0 ≤ eval arg1 < m
Postconditions:
eval (from_montgomery out1) mod m = eval arg1 mod m
0 ≤ eval out1 < m
p384Add adds two field elements in the Montgomery domain.
Preconditions:
0 ≤ eval arg1 < m
0 ≤ eval arg2 < m
Postconditions:
eval (from_montgomery out1) mod m = (eval (from_montgomery arg1) + eval (from_montgomery arg2)) mod m
0 ≤ eval out1 < m
p384FromMontgomery translates a field element out of the Montgomery domain.
Preconditions:
0 ≤ eval arg1 < m
Postconditions:
eval out1 mod m = (eval arg1 * ((2^64)⁻¹ mod m)^6) mod m
0 ≤ eval out1 < m
p384Mul multiplies two field elements in the Montgomery domain.
Preconditions:
0 ≤ eval arg1 < m
0 ≤ eval arg2 < m
Postconditions:
eval (from_montgomery out1) mod m = (eval (from_montgomery arg1) * eval (from_montgomery arg2)) mod m
0 ≤ eval out1 < m
p384SetOne returns the field element one in the Montgomery domain.
Postconditions:
eval (from_montgomery out1) mod m = 1 mod m
0 ≤ eval out1 < m
p384Square squares a field element in the Montgomery domain.
Preconditions:
0 ≤ eval arg1 < m
Postconditions:
eval (from_montgomery out1) mod m = (eval (from_montgomery arg1) * eval (from_montgomery arg1)) mod m
0 ≤ eval out1 < m
p384Sub subtracts two field elements in the Montgomery domain.
Preconditions:
0 ≤ eval arg1 < m
0 ≤ eval arg2 < m
Postconditions:
eval (from_montgomery out1) mod m = (eval (from_montgomery arg1) - eval (from_montgomery arg2)) mod m
0 ≤ eval out1 < m
p384ToMontgomery translates a field element into the Montgomery domain.
Preconditions:
0 ≤ eval arg1 < m
Postconditions:
eval (from_montgomery out1) mod m = eval arg1 mod m
0 ≤ eval out1 < m
p521Add adds two field elements in the Montgomery domain.
Preconditions:
0 ≤ eval arg1 < m
0 ≤ eval arg2 < m
Postconditions:
eval (from_montgomery out1) mod m = (eval (from_montgomery arg1) + eval (from_montgomery arg2)) mod m
0 ≤ eval out1 < m
p521FromMontgomery translates a field element out of the Montgomery domain.
Preconditions:
0 ≤ eval arg1 < m
Postconditions:
eval out1 mod m = (eval arg1 * ((2^64)⁻¹ mod m)^9) mod m
0 ≤ eval out1 < m
p521Mul multiplies two field elements in the Montgomery domain.
Preconditions:
0 ≤ eval arg1 < m
0 ≤ eval arg2 < m
Postconditions:
eval (from_montgomery out1) mod m = (eval (from_montgomery arg1) * eval (from_montgomery arg2)) mod m
0 ≤ eval out1 < m
p521SetOne returns the field element one in the Montgomery domain.
Postconditions:
eval (from_montgomery out1) mod m = 1 mod m
0 ≤ eval out1 < m
p521Square squares a field element in the Montgomery domain.
Preconditions:
0 ≤ eval arg1 < m
Postconditions:
eval (from_montgomery out1) mod m = (eval (from_montgomery arg1) * eval (from_montgomery arg1)) mod m
0 ≤ eval out1 < m
p521Sub subtracts two field elements in the Montgomery domain.
Preconditions:
0 ≤ eval arg1 < m
0 ≤ eval arg2 < m
Postconditions:
eval (from_montgomery out1) mod m = (eval (from_montgomery arg1) - eval (from_montgomery arg2)) mod m
0 ≤ eval out1 < m
p521ToMontgomery translates a field element into the Montgomery domain.
Preconditions:
0 ≤ eval arg1 < m
Postconditions:
eval (from_montgomery out1) mod m = eval arg1 mod m
0 ≤ eval out1 < m
Package-Level Variables (total 6, none are exported)
p224MinusOneEncoding is the encoding of -1 mod p, so p - 1, the
highest canonical encoding. It is used by SetBytes to check for non-canonical
encodings such as p + k, 2p + k, etc.
p384MinusOneEncoding is the encoding of -1 mod p, so p - 1, the
highest canonical encoding. It is used by SetBytes to check for non-canonical
encodings such as p + k, 2p + k, etc.
p521MinusOneEncoding is the encoding of -1 mod p, so p - 1, the
highest canonical encoding. It is used by SetBytes to check for non-canonical
encodings such as p + k, 2p + k, etc.