You are here

public static function ParagonIE_Sodium_Core_Curve25519::fe_isnegative in Automatic Updates 7

Same name and namespace in other branches
  1. 8 vendor/paragonie/sodium_compat/src/Core/Curve25519.php \ParagonIE_Sodium_Core_Curve25519::fe_isnegative()

Is a field element negative? (1 = yes, 0 = no. Used in calculations.)

@internal You should not use this directly from another application

Parameters

ParagonIE_Sodium_Core_Curve25519_Fe $f:

Return value

int

Throws

SodiumException

TypeError

3 calls to ParagonIE_Sodium_Core_Curve25519::fe_isnegative()
ParagonIE_Sodium_Core_Curve25519::ge_frombytes_negate_vartime in vendor/paragonie/sodium_compat/src/Core/Curve25519.php
@internal You should not use this directly from another application
ParagonIE_Sodium_Core_Curve25519::ge_p3_tobytes in vendor/paragonie/sodium_compat/src/Core/Curve25519.php
@internal You should not use this directly from another application
ParagonIE_Sodium_Core_Curve25519::ge_tobytes in vendor/paragonie/sodium_compat/src/Core/Curve25519.php
Convert a group element to a byte string.

File

vendor/paragonie/sodium_compat/src/Core/Curve25519.php, line 351

Class

ParagonIE_Sodium_Core_Curve25519
Class ParagonIE_Sodium_Core_Curve25519

Code

public static function fe_isnegative(ParagonIE_Sodium_Core_Curve25519_Fe $f) {
  $str = self::fe_tobytes($f);
  return (int) (self::chrToInt($str[0]) & 1);
}