[ Index ]

PHP Cross Reference of DokuWiki

title

Body

[close]

/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger/Engines/BCMath/Reductions/ -> EvalBarrett.php (summary)

BCMath Dynamic Barrett Modular Exponentiation Engine PHP version 5 and 7

Author: Jim Wigginton
Copyright: 2017 Jim Wigginton
License: http://www.opensource.org/licenses/mit-license.html MIT License
Link: http://pear.php.net/package/Math_BigInteger
File Size: 108 lines (3 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 2 functions

  reduce()
  generateCustomReduction()

Functions
Functions that are not part of a class:

reduce($n, $m)   X-Ref
Barrett Modular Reduction

This calls a dynamically generated loop unrolled function that's specific to a given modulo.
Array lookups are avoided as are if statements testing for how many bits the host OS supports, etc.

return: string
param: string $n
param: string $m

generateCustomReduction(BCMath $m, $class)   X-Ref
Generate Custom Reduction

return: callable|void
param: BCMath $m
param: string $class