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

Champs de données

const VARIABLE = 0
 
const DATA = 1
 
- Champs de données hérités de Base
const VARIABLE = 0
 
const DATA = 1
 
- Champs de données hérités de BCMath
const FAST_BITWISE = false
 
const ENGINE_DIR = 'BCMath'
 
- Champs de données hérités de Engine
const PRIMES
 

Fonctions membres protégées statiques

static reduce ($n, $m)
 
- Fonctions membres protégées statiques hérités de Base
static powModHelper (BCMath $x, BCMath $e, BCMath $n, $class)
 
static prepareReduce ($x, $n, $class)
 
static multiplyReduce ($x, $y, $n, $class)
 
static squareReduce ($x, $n, $class)
 
- Fonctions membres protégées statiques hérités de BCMath
static setBitmask ($bits)
 
- 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)
 

Fonctions membres privées statiques

static regularBarrett ($x, $n)
 

Membres hérités additionnels

- Fonctions membres publiques hérités de BCMath
 __construct ($x=0, $base=10)
 
 toString ()
 
 toBytes ($twos_compliment=false)
 
 add (BCMath $y)
 
 subtract (BCMath $y)
 
 multiply (BCMath $x)
 
 divide (BCMath $y)
 
 modInverse (BCMath $n)
 
 extendedGCD (BCMath $n)
 
 abs ()
 
 bitwise_and (BCMath $x)
 
 bitwise_or (BCMath $x)
 
 bitwise_xor (BCMath $x)
 
 bitwise_rightShift ($shift)
 
 bitwise_leftShift ($shift)
 
 compare (BCMath $y)
 
 equals (BCMath $x)
 
 modPow (BCMath $e, BCMath $n)
 
 powMod (BCMath $e, BCMath $n)
 
 pow (BCMath $n)
 
 between (BCMath $min, BCMath $max)
 
 isOdd ()
 
 testBit ($x)
 
 isNegative ()
 
 negate ()
 
- 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 Base
static isValidEngine ()
 
- Fonctions membres publiques statiques hérités de BCMath
static isValidEngine ()
 
static randomRangePrime (BCMath $min, BCMath $max)
 
static randomRange (BCMath $min, BCMath $max)
 
static scan1divide (BCMath $r)
 
static min (BCMath ... $nums)
 
static max (BCMath ... $nums)
 
- Fonctions membres publiques statiques hérités de Engine
static setModExpEngine ($engine)
 
static minMaxBits ($bits)
 
- Fonctions membres protégées hérités de BCMath
 initialize ($base)
 
 powModInner (BCMath $e, BCMath $n)
 
 normalize (BCMath $result)
 
 make_odd ()
 
 testSmallPrimes ()
 
- 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

◆ reduce()

static reduce (   $n,
  $m 
)
staticprotected

Barrett Modular Reduction

See HAC 14.3.3 / MPM 6.2.5 for more information. Modified slightly, so as not to require negative numbers (initially, this script didn't support negative numbers).

Employs "folding", as described at thesis-149.pdf#page=66. To quote from it, "the idea [behind folding] is to find a value x' such that x (mod m) = x' (mod m), with x' being smaller than x."

Unfortunately, the "Barrett Reduction with Folding" algorithm described in thesis-149.pdf is not, as written, all that usable on account of (1) its not using reasonable radix points as discussed in MPM 6.2.2 and (2) the fact that, even with reasonable radix points, it only works when there are an even number of digits in the denominator. The reason for (2) is that (x >> 1) + (x >> 1) != x / 2 + x / 2. If x is even, they're the same, but if x is odd, they're not. See the in-line comments for details.

Paramètres
string$n
string$m
Renvoie
string

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

◆ regularBarrett()

static regularBarrett (   $x,
  $n 
)
staticprivate

(Regular) Barrett Modular Reduction

For numbers with more than four digits BigInteger::_barrett() is faster. The difference between that and this is that this function does not fold the denominator into a smaller form.

Paramètres
string$x
string$n
Renvoie
string

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

Documentation des champs

◆ DATA

const DATA = 1

$cache[self::DATA] contains the cached data.

private

◆ VARIABLE

const VARIABLE = 0

Cache constants

$cache[self::VARIABLE] tells us whether or not the cached data is still valid.

private


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