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 generate.go. DO NOT EDIT.
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
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.