Documentation ¶
Overview ¶
Copyright 2021 The Go Authors. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. Code generated by addchain. DO NOT EDIT.
Index ¶
- type SM2P256Element
- func (e *SM2P256Element) Add(t1, t2 *SM2P256Element) *SM2P256Element
- func (e *SM2P256Element) Bytes() []byte
- func (e *SM2P256Element) Equal(t *SM2P256Element) int
- func (e *SM2P256Element) Invert(x *SM2P256Element) *SM2P256Element
- func (e *SM2P256Element) IsZero() int
- func (e *SM2P256Element) Mul(t1, t2 *SM2P256Element) *SM2P256Element
- func (e *SM2P256Element) One() *SM2P256Element
- func (v *SM2P256Element) Select(a, b *SM2P256Element, cond int) *SM2P256Element
- func (e *SM2P256Element) Set(t *SM2P256Element) *SM2P256Element
- func (e *SM2P256Element) SetBytes(v []byte) (*SM2P256Element, error)
- func (e *SM2P256Element) Square(t *SM2P256Element) *SM2P256Element
- func (e *SM2P256Element) Sub(t1, t2 *SM2P256Element) *SM2P256Element
- type SM2P256OrderElement
- func (e *SM2P256OrderElement) Add(t1, t2 *SM2P256OrderElement) *SM2P256OrderElement
- func (e *SM2P256OrderElement) Bytes() []byte
- func (e *SM2P256OrderElement) Mul(t1, t2 *SM2P256OrderElement) *SM2P256OrderElement
- func (e *SM2P256OrderElement) One() *SM2P256OrderElement
- func (v *SM2P256OrderElement) Select(a, b *SM2P256OrderElement, cond int) *SM2P256OrderElement
- func (e *SM2P256OrderElement) SetBytes(v []byte) (*SM2P256OrderElement, error)
- func (e *SM2P256OrderElement) Square(t *SM2P256OrderElement) *SM2P256OrderElement
- func (e *SM2P256OrderElement) Sub(t1, t2 *SM2P256OrderElement) *SM2P256OrderElement
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SM2P256Element ¶
type SM2P256Element struct {
// contains filtered or unexported fields
}
SM2P256Element is an integer modulo 2^256 - 2^224 - 2^96 + 2^64 - 1.
The zero value is a valid zero element.
func (*SM2P256Element) Add ¶
func (e *SM2P256Element) Add(t1, t2 *SM2P256Element) *SM2P256Element
Add sets e = t1 + t2, and returns e.
func (*SM2P256Element) Bytes ¶
func (e *SM2P256Element) Bytes() []byte
Bytes returns the 32-byte big-endian encoding of e.
func (*SM2P256Element) Equal ¶
func (e *SM2P256Element) Equal(t *SM2P256Element) int
Equal returns 1 if e == t, and zero otherwise.
func (*SM2P256Element) Invert ¶
func (e *SM2P256Element) Invert(x *SM2P256Element) *SM2P256Element
Invert sets e = 1/x, and returns e.
If x == 0, Invert returns e = 0.
func (*SM2P256Element) IsZero ¶
func (e *SM2P256Element) IsZero() int
IsZero returns 1 if e == 0, and zero otherwise.
func (*SM2P256Element) Mul ¶
func (e *SM2P256Element) Mul(t1, t2 *SM2P256Element) *SM2P256Element
Mul sets e = t1 * t2, and returns e.
func (*SM2P256Element) One ¶
func (e *SM2P256Element) One() *SM2P256Element
One sets e = 1, and returns e.
func (*SM2P256Element) Select ¶
func (v *SM2P256Element) Select(a, b *SM2P256Element, cond int) *SM2P256Element
Select sets v to a if cond == 1, and to b if cond == 0.
func (*SM2P256Element) Set ¶
func (e *SM2P256Element) Set(t *SM2P256Element) *SM2P256Element
Set sets e = t, and returns e.
func (*SM2P256Element) SetBytes ¶
func (e *SM2P256Element) SetBytes(v []byte) (*SM2P256Element, 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 (*SM2P256Element) Square ¶
func (e *SM2P256Element) Square(t *SM2P256Element) *SM2P256Element
Square sets e = t * t, and returns e.
func (*SM2P256Element) Sub ¶
func (e *SM2P256Element) Sub(t1, t2 *SM2P256Element) *SM2P256Element
Sub sets e = t1 - t2, and returns e.
type SM2P256OrderElement ¶
type SM2P256OrderElement struct {
// contains filtered or unexported fields
}
SM2P256OrderElement is an integer modulo 0xFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFF7203DF6B21C6052B53BBF40939D54123.
The zero value is a valid zero element.
func (*SM2P256OrderElement) Add ¶
func (e *SM2P256OrderElement) Add(t1, t2 *SM2P256OrderElement) *SM2P256OrderElement
Add sets e = t1 + t2, and returns e.
func (*SM2P256OrderElement) Bytes ¶
func (e *SM2P256OrderElement) Bytes() []byte
Bytes returns the 32-byte big-endian encoding of e.
func (*SM2P256OrderElement) Mul ¶
func (e *SM2P256OrderElement) Mul(t1, t2 *SM2P256OrderElement) *SM2P256OrderElement
Mul sets e = t1 * t2, and returns e.
func (*SM2P256OrderElement) One ¶
func (e *SM2P256OrderElement) One() *SM2P256OrderElement
One sets e = 1, and returns e.
func (*SM2P256OrderElement) Select ¶
func (v *SM2P256OrderElement) Select(a, b *SM2P256OrderElement, cond int) *SM2P256OrderElement
Select sets v to a if cond == 1, and to b if cond == 0.
func (*SM2P256OrderElement) SetBytes ¶
func (e *SM2P256OrderElement) SetBytes(v []byte) (*SM2P256OrderElement, 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 (*SM2P256OrderElement) Square ¶
func (e *SM2P256OrderElement) Square(t *SM2P256OrderElement) *SM2P256OrderElement
Square sets e = t * t, and returns e.
func (*SM2P256OrderElement) Sub ¶
func (e *SM2P256OrderElement) Sub(t1, t2 *SM2P256OrderElement) *SM2P256OrderElement
Sub sets e = t1 - t2, and returns e.