You are here

public static function ParagonIE_Sodium_Core_Curve25519::fe_isnonzero in Automatic Updates 8

Same name and namespace in other branches
  1. 7 vendor/paragonie/sodium_compat/src/Core/Curve25519.php \ParagonIE_Sodium_Core_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_Core_Curve25519_Fe $f:

Return value

bool

Throws

SodiumException

TypeError

2 calls to ParagonIE_Sodium_Core_Curve25519::fe_isnonzero()
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_Ed25519::pk_to_curve25519 in vendor/paragonie/sodium_compat/src/Core/Ed25519.php

File

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

Class

ParagonIE_Sodium_Core_Curve25519
Class ParagonIE_Sodium_Core_Curve25519

Code

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

  /** @var string $zero */

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