Documentation ¶
Index ¶
- type Int
- func (z *Int) Add(x, y *Int) *Int
- func (z *Int) And(x, y *Int) *Int
- func (z *Int) Cmp(x *Int) (r int)
- func (z *Int) Div(x, y *Int) *Int
- func (z *Int) Exp(x, y, m *Int) *Int
- func (z *Int) Int64() int64
- func (z *Int) Lsh(x *Int, n uint) *Int
- func (z *Int) Mul(x, y *Int) *Int
- func (z *Int) Or(x, y *Int) *Int
- func (z *Int) Quo(x, y *Int) *Int
- func (z *Int) Rem(x, y *Int) *Int
- func (z *Int) Rsh(x *Int, n uint) *Int
- func (z *Int) SetInt64(x int64) *Int
- func (z *Int) SetString(s string) (*Int, error)
- func (z *Int) SetUint64(x uint64) *Int
- func (z *Int) Sign() int
- func (z *Int) Sqrt(x *Int) *Int
- func (z *Int) String() string
- func (z *Int) Sub(x, y *Int) *Int
- func (z *Int) ToBig() *big.Int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Int ¶
type Int struct {
// contains filtered or unexported fields
}
func MustFromBig ¶
func (*Int) Exp ¶
Exp sets z = x**y mod |m| (i.e. the sign of m is ignored), and returns z. If m == nil or m == 0, z = x**y unless y <= 0 then z = 1. If m != 0, y < 0, and x and m are not relatively prime, z is unchanged and nil is returned.
Modular exponentiation of inputs of a particular size is not a cryptographically constant-time operation.
func (*Int) Quo ¶
Quo sets z to the quotient x/y for y != 0 and returns z. If y == 0, a division-by-zero run-time panic occurs. Quo implements truncated division (like Go); see QuoRem for more details.
func (*Int) Rem ¶
Rem sets z to the remainder x%y for y != 0 and returns z. If y == 0, a division-by-zero run-time panic occurs. Rem implements truncated modulus (like Go); see QuoRem for more details.