Mono.Math
Default length of a BigInteger in bytes
The Length of this BigInteger
The data for this BigInteger
Table of primes below 2000.
This table was generated using Mathematica 4.1 using the following function:
PrimeTable [x_] := Prime [Range [1, PrimePi [x]]]
PrimeTable [6000]
Generates a new, random BigInteger of the specified length.
The number of bits for the new number.
A random number generator to use to obtain the bits.
A random number of the specified length.
Generates a new, random BigInteger of the specified length using the default RNG crypto service provider.
The number of bits for the new number.
A random number of the specified length.
Randomizes the bits in "this" from the specified RNG.
A RNG.
Randomizes the bits in "this" from the default RNG.
Tests if the specified bit is 1.
The bit to test. The least significant bit is 0.
True if bitNum is set to 1, else false.
Normalizes this by setting the length to the actual number of
uints used in data and by setting the sign to Sign.Zero if the
value of this is 0.
Generates the smallest prime >= bi
A BigInteger
The smallest prime >= bi. More mathematically, if bi is prime: bi, else Prime [PrimePi [bi] + 1].
Increments this by two
Low level functions for the BigInteger
Adds two numbers with the same sign.
A BigInteger
A BigInteger
bi1 + bi2
Compares two BigInteger
A BigInteger
A BigInteger
The sign of bi1 - bi2
Performs n / d and n % d in one operation.
A BigInteger, upon exit this will hold n / d
The divisor
n % d
Multiplies the data in x [xOffset:xOffset+xLen] by
y [yOffset:yOffset+yLen] and puts it into
d [dOffset:dOffset+xLen+yLen].
Multiplies the data in x [xOffset:xOffset+xLen] by
y [yOffset:yOffset+yLen] and puts the low mod words into
d [dOffset:dOffset+mod].
A factor of confidence.
Only suitable for development use, probability of failure may be greater than 1/2^20.
Suitable only for transactions which do not require forward secrecy. Probability of failure about 1/2^40
Designed for production use. Probability of failure about 1/2^80.
Suitable for sensitive data. Probability of failure about 1/2^160.
Use only if you have lots of time! Probability of failure about 1/2^320.
Only use methods which generate provable primes. Not yet implemented.
Finds the next prime after a given number.
Performs primality tests on bi, assumes trial division has been done.
A BigInteger that has been subjected to and passed trial division
False if bi is composite, true if it may be prime.
The speed of this method is dependent on Confidence
Probabilistic prime test based on Rabin-Miller's test
The number to test.
The number of chosen bases. The test has at least a
1/4^confidence chance of falsely returning True.
True if "this" is a strong pseudoprime to randomly chosen bases.
False if "this" is definitely NOT prime.