NumberTheory
in package
Rewritten to take a MathAdaptor to handle different environments. Has some desireable functions for public key compression/recovery.
Table of Contents
Properties
Methods
- __construct() : mixed
- polynomialMultiplyMod() : array<string|int, GMP>
- polynomialPowMod() : array<string|int, GMP>
- polynomialReduceMod() : array<string|int, GMP>
- squareRootModP() : GMP
Properties
$adapter
private
GmpMathInterface
$adapter
Methods
__construct()
public
__construct(GmpMathInterface $adapter) : mixed
Parameters
- $adapter : GmpMathInterface
polynomialMultiplyMod()
public
polynomialMultiplyMod(array<string|int, GMP> $m1, array<string|int, GMP> $m2, array<string|int, GMP> $polymod, GMP $p) : array<string|int, GMP>
Parameters
- $m1 : array<string|int, GMP>
- $m2 : array<string|int, GMP>
- $polymod : array<string|int, GMP>
- $p : GMP
Return values
array<string|int, GMP>polynomialPowMod()
public
polynomialPowMod(array<string|int, GMP> $base, GMP $exponent, array<string|int, GMP> $polymod, GMP $p) : array<string|int, GMP>
Parameters
- $base : array<string|int, GMP>
- $exponent : GMP
- $polymod : array<string|int, GMP>
- $p : GMP
Return values
array<string|int, GMP>polynomialReduceMod()
public
polynomialReduceMod(array<string|int, GMP> $poly, array<string|int, GMP> $polymod, GMP $p) : array<string|int, GMP>
Parameters
- $poly : array<string|int, GMP>
- $polymod : array<string|int, GMP>
- $p : GMP
Return values
array<string|int, GMP>squareRootModP()
public
squareRootModP(GMP $a, GMP $p) : GMP
Parameters
- $a : GMP
- $p : GMP