Psalm coverage for phpseclib3\Math\

This commit is contained in:
Jack Worman 2022-02-21 18:56:19 -06:00 committed by terrafrost
parent b6f93a4a21
commit 6bad45c016
8 changed files with 32 additions and 31 deletions

View File

@ -793,7 +793,7 @@ class BigInteger
/**
* Is Odd?
*
* @return boolean
* @return bool
*/
public function isOdd()
{
@ -804,7 +804,7 @@ class BigInteger
* Tests if a bit is set
*
* @param int $x
* @return boolean
* @return bool
*/
public function testBit($x)
{
@ -814,7 +814,7 @@ class BigInteger
/**
* Is Negative?
*
* @return boolean
* @return bool
*/
public function isNegative()
{
@ -869,7 +869,7 @@ class BigInteger
* Splits BigInteger's into chunks of $split bits
*
* @param int $split
* @return \phpseclib3\Math\BigInteger[]
* @return BigInteger[]
*/
public function bitwise_split($split)
{

View File

@ -237,7 +237,7 @@ class BCMath extends Engine
*
* Say you have (30 mod 17 * x mod 17) mod 17 == 1. x can be found using modular inverses.
*
* @param \phpseclib3\Math\BigInteger\Engines\BCMath $n
* @param BCMath $n
* @return false|BCMath
*/
public function modInverse(BCMath $n)
@ -311,7 +311,7 @@ class BCMath extends Engine
/**
* Absolute value.
*
* @return \phpseclib3\Math\BigInteger\Engines\BCMath
* @return BCMath
*/
public function abs()
{
@ -362,7 +362,7 @@ class BCMath extends Engine
* Shifts BigInteger's by $shift bits, effectively dividing by 2**$shift.
*
* @param int $shift
* @return \phpseclib3\Math\BigInteger\Engines\BCMath
* @return BCMath
*/
public function bitwise_rightShift($shift)
{
@ -378,7 +378,7 @@ class BCMath extends Engine
* Shifts BigInteger's by $shift bits, effectively multiplying by 2**$shift.
*
* @param int $shift
* @return \phpseclib3\Math\BigInteger\Engines\BCMath
* @return BCMath
*/
public function bitwise_leftShift($shift)
{
@ -672,7 +672,7 @@ class BCMath extends Engine
/**
* Is Negative?
*
* @return boolean
* @return bool
*/
public function isNegative()
{

View File

@ -54,11 +54,11 @@ abstract class Base extends BCMath
/**
* Performs modular exponentiation.
*
* @param \phpseclib3\Math\BigInteger\Engines\BCMath $x
* @param \phpseclib3\Math\BigInteger\Engines\BCMath $e
* @param \phpseclib3\Math\BigInteger\Engines\BCMath $n
* @param BCMath $x
* @param BCMath $e
* @param BCMath $n
* @param string $class
* @return \phpseclib3\Math\BigInteger\Engines\BCMath
* @return BCMath
*/
protected static function powModHelper(BCMath $x, BCMath $e, BCMath $n, $class)
{

View File

@ -61,7 +61,7 @@ abstract class Barrett extends Base
*
* @param string $n
* @param string $m
* @return array|string
* @return string
*/
protected static function reduce($n, $m)
{

View File

@ -298,8 +298,8 @@ class GMP extends Engine
* combination is returned is dependent upon which mode is in use. See
* {@link http://en.wikipedia.org/wiki/B%C3%A9zout%27s_identity Bezout's identity - Wikipedia} for more information.
*
* @param \phpseclib3\Math\BigInteger\Engines\GMP $n
* @return \phpseclib3\Math\BigInteger\Engines\GMP[]
* @param GMP $n
* @return GMP[]
*/
public function extendedGCD(GMP $n)
{
@ -329,7 +329,7 @@ class GMP extends Engine
/**
* Absolute value.
*
* @return \phpseclib3\Math\BigInteger\Engines\GMP
* @return GMP
* @access public
*/
public function abs()
@ -388,7 +388,7 @@ class GMP extends Engine
* Shifts BigInteger's by $shift bits, effectively dividing by 2**$shift.
*
* @param int $shift
* @return \phpseclib3\Math\BigInteger\Engines\GMP
* @return GMP
*/
public function bitwise_rightShift($shift)
{
@ -407,7 +407,7 @@ class GMP extends Engine
* Shifts BigInteger's by $shift bits, effectively multiplying by 2**$shift.
*
* @param int $shift
* @return \phpseclib3\Math\BigInteger\Engines\GMP
* @return GMP
*/
public function bitwise_leftShift($shift)
{
@ -658,7 +658,7 @@ class GMP extends Engine
/**
* Is Odd?
*
* @return boolean
* @return bool
*/
public function isOdd()
{
@ -668,7 +668,7 @@ class GMP extends Engine
/**
* Tests if a bit is set
*
* @return boolean
* @return bool
*/
public function testBit($x)
{
@ -678,7 +678,7 @@ class GMP extends Engine
/**
* Is Negative?
*
* @return boolean
* @return bool
*/
public function isNegative()
{

View File

@ -76,7 +76,7 @@ abstract class PHP extends Engine
*
* @param mixed $x integer Base-10 number or base-$base number if $base set.
* @param int $base
* @return \phpseclib3\Math\BigInteger\Engines\PHP
* @return PHP
* @see parent::__construct()
*/
public function __construct($x = 0, $base = 10)
@ -814,7 +814,7 @@ abstract class PHP extends Engine
/**
* Absolute value.
*
* @return \phpseclib3\Math\BigInteger\Engines\PHP
* @return PHP
*/
public function abs()
{
@ -850,7 +850,7 @@ abstract class PHP extends Engine
* Shifts BigInteger's by $shift bits, effectively dividing by 2**$shift.
*
* @param int $shift
* @return \phpseclib3\Math\BigInteger\Engines\PHP
* @return PHP
*/
public function bitwise_rightShift($shift)
{
@ -870,7 +870,7 @@ abstract class PHP extends Engine
* Shifts BigInteger's by $shift bits, effectively multiplying by 2**$shift.
*
* @param int $shift
* @return \phpseclib3\Math\BigInteger\Engines\PHP
* @return PHP
*/
public function bitwise_leftShift($shift)
{

View File

@ -74,11 +74,11 @@ abstract class Base extends PHP
* the other, a power of two - and recombine them, later. This is the method that this modPow function uses.
* {@link http://islab.oregonstate.edu/papers/j34monex.pdf Montgomery Reduction with Even Modulus} elaborates.
*
* @param \phpseclib3\Math\BigInteger\Engines\PHP $x
* @param \phpseclib3\Math\BigInteger\Engines\PHP $e
* @param \phpseclib3\Math\BigInteger\Engines\PHP $n
* @param PHP $x
* @param PHP $e
* @param PHP $n
* @param string $class
* @return \phpseclib3\Math\BigInteger\Engines\PHP
* @return PHP
*/
protected static function powModHelper(PHP $x, PHP $e, PHP $n, $class)
{

View File

@ -15,6 +15,7 @@
namespace phpseclib3\Math\BigInteger\Engines\PHP\Reductions;
use phpseclib3\Math\BigInteger\Engines\PHP;
use phpseclib3\Math\BigInteger\Engines\PHP\Base;
/**
@ -46,7 +47,7 @@ abstract class Barrett extends Base
*
* @param array $n
* @param array $m
* @param string $class
* @param class-string<PHP> $class
* @return array
*/
protected static function reduce(array $n, array $m, $class)