Constructs a new bignum from another bignum, a number or a hex string.
mostly constant-time, very expensive full reduction.
Approximate reduction mod p. May leave a number which is negative or slightly larger than p.
Creates a new subclass of bn, based on reduction modulo a pseudo-Mersenne prime, i.e. a prime of the form 2^e + sum(a * 2^b),where the sum is negative and sparse.
this + that. Does not normalize.
this += that. Does not normalize.
Return the length in bits, rounded up to the nearest byte.
Constant-time normalize. Does not allocate additional space.
this *= 2. Requires normalized; ends up normalized.
Returns true if "this" and "that" are equal. Calls fullReduce(). Equality test is in constant time.
Reduce and normalize.
Get the i'th limb of this, zero if i is too large.
Constant time comparison function. Returns 1 if this >= that, or zero otherwise.
this /= 2, rounded down. Requires normalized; ends up normalized.
Initializes this with it, either as a bn, a number, or a hex string.
return inverse mod prime p. p must be odd. Binary extended Euclidean algorithm mod p.
this ^ x mod N with Montomery reduction
this * that. Normalizes and reduces.
this * that mod N
this ^ n. Uses square-and-multiply. Normalizes and reduces.
this ^ x mod N
Reduce mod a modulus. Stubbed for subclassing.
this ^ 2. Normalizes and reduces.
this - that. Does not normalize.
this -= that. Does not normalize.
Serialize to a bit array
Convert to a hex string.