Joomla CMS  4.2.2
Documentation des API du CMS Joomla en version 4.2.2
Référence de la classe Montgomery
+ Graphe d'héritage de Montgomery:

Fonctions membres protégées statiques

static prepareReduce (array $x, array $n, $class)
 
static reduce (array $x, array $n, $class)
 
static modInverse67108864 (array $x, $class)
 
- Fonctions membres protégées statiques hérités de Montgomery
static slidingWindow (Engine $x, Engine $e, Engine $n, $class)
 
- Fonctions membres protégées statiques hérités de Base
static powModHelper (PHP $x, PHP $e, PHP $n, $class)
 
static prepareReduce (array $x, array $n, $class)
 
static multiplyReduce (array $x, array $y, array $n, $class)
 
static squareReduce (array $x, array $n, $class)
 
- Fonctions membres protégées statiques hérités de PHP
static addHelper (array $x_value, $x_negative, array $y_value, $y_negative)
 
static multiplyHelper (array $x_value, $x_negative, array $y_value, $y_negative)
 
static regularMultiply (array $x_value, array $y_value)
 
static compareHelper (array $x_value, $x_negative, array $y_value, $y_negative)
 
static trim (array $value)
 
static array_repeat ($input, $multiplier)
 
static square (array $x)
 
static baseSquare (array $value)
 
static karatsubaSquare (array $value)
 
- Fonctions membres protégées statiques hérités de Engine
static setBitmask ($bits)
 
static base256_lshift (&$x, $shift)
 
static slidingWindow (Engine $x, Engine $e, Engine $n, $class)
 
static randomRangePrimeOuter (Engine $min, Engine $max)
 
static randomRangeHelper (Engine $min, Engine $max)
 
static randomRangePrimeInner (Engine $x, Engine $min, Engine $max)
 
static minHelper (array $nums)
 
static maxHelper (array $nums)
 

Membres hérités additionnels

- Fonctions membres publiques hérités de PHP
 __construct ($x=0, $base=10)
 
 toString ()
 
 toBytes ($twos_compliment=false)
 
 abs ()
 
 bitwise_rightShift ($shift)
 
 bitwise_leftShift ($shift)
 
 isOdd ()
 
 testBit ($x)
 
 isNegative ()
 
 negate ()
 
 bitwise_split ($split)
 
- Fonctions membres publiques hérités de Engine
 __construct ($x=0, $base=10)
 
 toHex ($twos_compliment=false)
 
 toBits ($twos_compliment=false)
 
 __sleep ()
 
 __wakeup ()
 
 jsonSerialize ()
 
 __toString ()
 
 __debugInfo ()
 
 setPrecision ($bits)
 
 getPrecision ()
 
 bitwise_not ()
 
 bitwise_leftRotate ($shift)
 
 bitwise_rightRotate ($shift)
 
 getLength ()
 
 getLengthInBytes ()
 
 isPrime ($t=false)
 
 root ($n=2)
 
 createRecurringModuloFunction ()
 
 bitwise_split ($split)
 
- Fonctions membres publiques statiques hérités de Montgomery
static isValidEngine ()
 
- Fonctions membres publiques statiques hérités de Base
static isValidEngine ()
 
- Fonctions membres publiques statiques hérités de PHP
static subtractHelper (array $x_value, $x_negative, array $y_value, $y_negative)
 
static scan1divide (PHP $r)
 
- Fonctions membres publiques statiques hérités de Engine
static setModExpEngine ($engine)
 
static minMaxBits ($bits)
 
- Champs de données hérités de Base
const VARIABLE = 0
 
const DATA = 1
 
- Champs de données hérités de PHP
const VALUE = 0
 
const SIGN = 1
 
const KARATSUBA_CUTOFF = 25
 
const FAST_BITWISE = true
 
const ENGINE_DIR = 'PHP'
 
- Champs de données hérités de Engine
const PRIMES
 
- Fonctions membres protégées hérités de PHP
 initialize ($base)
 
 pad ($str)
 
 divideHelper (PHP $y)
 
 convertToObj (array $arr)
 
 normalize (PHP $result)
 
 lshift ($shift)
 
 rshift ($shift)
 
 powModInner (PHP $e, PHP $n)
 
 make_odd ()
 
 testSmallPrimes ()
 
 powHelper (PHP $n)
 
- Fonctions membres protégées hérités de Engine
 toBytesHelper ()
 
 powModOuter (Engine $e, Engine $n)
 
 setupIsPrime ()
 
 testPrimality ($t)
 
 rootHelper ($n)
 
 rootInner ($n)
 
 extendedGCDHelper (Engine $n)
 
 bitwiseAndHelper (Engine $x)
 
 bitwiseOrHelper (Engine $x)
 
 bitwiseXorHelper (Engine $x)
 
- Attributs protégés hérités de Engine
 $value
 
 $is_negative
 
 $precision = -1
 
 $bitmask = false
 
 $reduce
 
 $hex
 
- Attributs protégés statiques hérités de Engine
static $zero = []
 
static $one = []
 
static $two = []
 
static $modexpEngine
 
static $isValidEngine
 

Documentation des fonctions membres

◆ modInverse67108864()

static modInverse67108864 ( array  $x,
  $class 
)
staticprotected

Modular Inverse of a number mod 2**26 (eg. 67108864)

Based off of the bnpInvDigit function implemented and justified in the following URL:

http://www-cs-students.stanford.edu/~tjw/jsbn/jsbn.js

The following URL provides more info:

http://groups.google.com/group/sci.crypt/msg/7a137205c1be7d85

As for why we do all the bitmasking... strange things can happen when converting from floats to ints. For instance, on some computers, var_dump((int) -4294967297) yields int(-1) and on others, it yields int(-2147483648). To avoid problems stemming from this, we use bitmasks to guarantee that ints aren't auto-converted to floats. The outermost bitmask is present because without it, there's no guarantee that the "residue" returned would be the so-called "common residue". We use fmod, in the last step, because the maximum possible $x is 26 bits and the maximum $result is 16 bits. Thus, we have to be able to handle up to 40 bits, which only 64-bit floating points will support.

Thanks to Pedro Gimeno Fortea for input!

Paramètres
array$x
string$class
Renvoie
int

Références $result.

◆ prepareReduce()

static prepareReduce ( array  $x,
array  $n,
  $class 
)
staticprotected

Prepare a number for use in Montgomery Modular Reductions

Paramètres
array$x
array$n
string$class
Renvoie
array

Références $class, $n, et $temp.

◆ reduce()

static reduce ( array  $x,
array  $n,
  $class 
)
staticprotected

Montgomery Multiply

Interleaves the montgomery reduction and long multiplication algorithms together as described in HAC 14.36

Paramètres
array$x
array$n
string$class
Renvoie
array

Références $class, $i, $key, $n, $result, et $temp.


La documentation de cette classe a été générée à partir du fichier suivant :