WordPress at Your Fingertips
function is not described

ParagonIE_Sodium_Core32_Int64::rotateLeft() public WP 1.0

{} It's a method of the class: ParagonIE_Sodium_Core32_Int64{}

No Hooks.

Return

ParagonIE_Sodium_Core32_Int64.

Usage

$ParagonIE_Sodium_Core32_Int64 = new ParagonIE_Sodium_Core32_Int64();
$ParagonIE_Sodium_Core32_Int64->rotateLeft( $c );
$c(int)
-

Code of ParagonIE_Sodium_Core32_Int64::rotateLeft() WP 5.8.2

public function rotateLeft($c = 0)
{
    ParagonIE_Sodium_Core32_Util::declareScalarType($c, 'int', 1);
    /** @var int $c */
    $c = (int) $c;

    $return = new ParagonIE_Sodium_Core32_Int64();
    $return->unsignedInt = $this->unsignedInt;
    $c &= 63;
    if ($c === 0) {
        // NOP, but we want a copy.
        $return->limbs = $this->limbs;
    } else {
        /** @var array<int, int> $limbs */
        $limbs =& $return->limbs;

        /** @var array<int, int> $myLimbs */
        $myLimbs =& $this->limbs;

        /** @var int $idx_shift */
        $idx_shift = ($c >> 4) & 3;
        /** @var int $sub_shift */
        $sub_shift = $c & 15;

        for ($i = 3; $i >= 0; --$i) {
            /** @var int $j */
            $j = ($i + $idx_shift) & 3;
            /** @var int $k */
            $k = ($i + $idx_shift + 1) & 3;
            $limbs[$i] = (int) (
                (
                    ((int) ($myLimbs[$j]) << $sub_shift)
                        |
                    ((int) ($myLimbs[$k]) >> (16 - $sub_shift))
                ) & 0xffff
            );
        }
    }
    return $return;
}