public function ParagonIE_Sodium_Core32_Int32::subInt32 in Automatic Updates 7
Same name and namespace in other branches
- 8 vendor/paragonie/sodium_compat/src/Core32/Int32.php \ParagonIE_Sodium_Core32_Int32::subInt32()
Subtract two int32 objects from each other
Parameters
ParagonIE_Sodium_Core32_Int32 $b:
Return value
File
- vendor/
paragonie/ sodium_compat/ src/ Core32/ Int32.php, line 679
Class
- ParagonIE_Sodium_Core32_Int32
- Class ParagonIE_Sodium_Core32_Int32
Code
public function subInt32(ParagonIE_Sodium_Core32_Int32 $b) {
$return = new ParagonIE_Sodium_Core32_Int32();
$return->unsignedInt = $this->unsignedInt;
/** @var int $tmp */
$tmp = $this->limbs[1] - ($b->limbs[1] & 0xffff);
/** @var int $carry */
$carry = $tmp >> 16;
$return->limbs[1] = (int) ($tmp & 0xffff);
/** @var int $tmp */
$tmp = $this->limbs[0] - ($b->limbs[0] & 0xffff) + $carry;
$return->limbs[0] = (int) ($tmp & 0xffff);
return $return;
}