Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Decode ¶
Decode will decode the given number from a big endian unsigned byte array. The given result should be an array with sufficient size for the number
Types ¶
type Base ¶
type Base uint32
Base represents the numerical type used for representing internal numbers
type Int ¶
type Int struct {
// contains filtered or unexported fields
}
Int represents an arbitrarily sized integer
func (*Int) Bytes ¶
Bytes returns the absolute value of x as a big-endian byte slice. This method is not constant time in the length of the value, but is constant time in terms of its value.
func (*Int) Exp ¶
Exp sets and returns the value x to the power of y, mod m. m has to be an odd number. x has to be smaller than m. This method is constant time in that it does not reveal the values, but it is not constant time in the conversion of the y-value. It is constant time in terms of value, but not in length. If this is not acceptable, the ExpB method is fully constant time.
func (*Int) ExpB ¶
ExpB sets and returns the value x to the power of y, mod m. m has to be an odd number. y is the representation of a number in big-endian byte order. x has to be smaller than m. This method is constant time.
func (*Int) GetBigInt ¶
GetBigInt returns a big.Int that represents the same value as this int This method is not constant time.
func (*Int) Set ¶
Set sets the value of the receiver to the argument This method is constant time in value, but not in length.
func (*Int) SetBigInt ¶
SetBigInt sets the value this int to the value in the big.Int The implementation of decoding bytes is constant time in constbn and does not leak the value or length of the value. However, this method uses the Bytes method on big.Int - which is not constant time.