BigIntHelper

Undocumented in source.

Members

Aliases

powmod
alias powmod = std.bigint.powmod
Undocumented in source.

Static functions

fromBytes
BigInt fromBytes(ubyte[] buffer)

Because std.bigint's member data is a private property, and there is no API setDigit that opens the opposite of getDigit, it can only be shifted by digits one by one. !! Here is a performance bottleneck.

isProbablePrime
bool isProbablePrime(BigInt n, size_t confidence)

Test whether BigInt n is prime. Step 1: millerRabinPrimeTest Step 2: lucasLehmerTest

powmod
BigInt powmod(BigInt base, BigInt exponent, BigInt modulus)
randomGenerate
BigInt randomGenerate(uint bitLength, int highBit, int lowBit)

Random generate a BigInt by bitLength.

randomGenerate
BigInt randomGenerate(BigInt min, BigInt max)

Random generate a BigInt between min and max.

toUBytes
ubyte[] toUBytes(BigInt value)

Meta