ParagonIE_Sodium_Core32_Int64::addInt64() public WP 1.0
Adds two int64 objects
{} It's a method of the class: ParagonIE_Sodium_Core32_Int64{}
No Hooks.
Return
ParagonIE_Sodium_Core32_Int64
. Null. Nothing.
Usage
$ParagonIE_Sodium_Core32_Int64 = new ParagonIE_Sodium_Core32_Int64(); $ParagonIE_Sodium_Core32_Int64->addInt64( $addend );
- $addend(ParagonIE_Sodium_Core32_int64) (required)
- -
Code of ParagonIE_Sodium_Core32_Int64::addInt64() ParagonIE Sodium Core32 Int64::addInt64 WP 5.7.1
public function addInt64(ParagonIE_Sodium_Core32_Int64 $addend)
{
$i0 = $this->limbs[0];
$i1 = $this->limbs[1];
$i2 = $this->limbs[2];
$i3 = $this->limbs[3];
$j0 = $addend->limbs[0];
$j1 = $addend->limbs[1];
$j2 = $addend->limbs[2];
$j3 = $addend->limbs[3];
$r3 = $i3 + ($j3 & 0xffff);
$carry = $r3 >> 16;
$r2 = $i2 + ($j2 & 0xffff) + $carry;
$carry = $r2 >> 16;
$r1 = $i1 + ($j1 & 0xffff) + $carry;
$carry = $r1 >> 16;
$r0 = $i0 + ($j0 & 0xffff) + $carry;
$carry = $r0 >> 16;
$r0 &= 0xffff;
$r1 &= 0xffff;
$r2 &= 0xffff;
$r3 &= 0xffff;
$return = new ParagonIE_Sodium_Core32_Int64(
array($r0, $r1, $r2, $r3)
);
$return->overflow = $carry;
$return->unsignedInt = $this->unsignedInt;
return $return;
}