You are here

public static function ParagonIE_Sodium_Core32_Curve25519::fe_isnonzero in Automatic Updates 7

Same name and namespace in other branches
  1. 8 vendor/paragonie/sodium_compat/src/Core32/Curve25519.php \ParagonIE_Sodium_Core32_Curve25519::fe_isnonzero()

Returns 0 if this field element results in all NUL bytes.

@internal You should not use this directly from another application

Parameters

ParagonIE_Sodium_Core32_Curve25519_Fe $f:

Return value

bool

Throws

SodiumException

TypeError

2 calls to ParagonIE_Sodium_Core32_Curve25519::fe_isnonzero()
ParagonIE_Sodium_Core32_Curve25519::ge_frombytes_negate_vartime in vendor/paragonie/sodium_compat/src/Core32/Curve25519.php
@internal You should not use this directly from another application
ParagonIE_Sodium_Core32_Ed25519::pk_to_curve25519 in vendor/paragonie/sodium_compat/src/Core32/Ed25519.php

File

vendor/paragonie/sodium_compat/src/Core32/Curve25519.php, line 415

Class

ParagonIE_Sodium_Core32_Curve25519
Class ParagonIE_Sodium_Core32_Curve25519

Code

public static function fe_isnonzero(ParagonIE_Sodium_Core32_Curve25519_Fe $f) {
  static $zero;
  if ($zero === null) {
    $zero = str_repeat("\0", 32);
  }

  /** @var string $str */
  $str = self::fe_tobytes($f);

  /** @var string $zero */
  return !self::verify_32($str, $zero);
}