new FixModPow(basis, modulus, size, width)
Fixed-basis exponentiation based on simultantaneous
exponentiation with exponent slicing.
Parameters:
Name | Type | Description |
---|---|---|
basis |
Basis. | |
modulus |
Modulus. | |
size |
Expected number of exponentiations to compute. | |
width |
If given this determines the width of the pre-computed table, and otherwise it is chosen theoretically optimally. |
- Source:
Methods
(static) optimalWidth(bitLength, size)
Takes the bit length of the exponents and the number
of exponentiations that we expect to compute and returns the
theoretically optimal width.
Parameters:
Name | Type | Description |
---|---|---|
bitLength |
Expected bit length of exponents. | |
size |
Expected number of exponentiations to compute. |
- Source:
Returns:
Theoretically optimal choice of width for the expected bit
length and number of exponentiations.
modPow(exponent)
Raises the fixed basis to the given exponent given the
fixed modulus.
Parameters:
Name | Type | Description |
---|---|---|
exponent |
Exponent. |
- Source:
Returns:
Power of fixed basis to the given exponent.
slice(exponent)
Cuts an input integer into the appropriate number of
slices and outputs a list of integers such that the ith bit belongs
to the ith slice.
Parameters:
Name | Type | Description |
---|---|---|
exponent |
Exponent. |
- Source:
Returns:
Array of exponents.