You are here

public static function ParagonIE_Sodium_Core32_Curve25519::ge_p3_tobytes in Automatic Updates 8

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

@internal You should not use this directly from another application

Parameters

ParagonIE_Sodium_Core32_Curve25519_Ge_P3 $h:

Return value

string

Throws

SodiumException

TypeError

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

File

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

Class

ParagonIE_Sodium_Core32_Curve25519
Class ParagonIE_Sodium_Core32_Curve25519

Code

public static function ge_p3_tobytes(ParagonIE_Sodium_Core32_Curve25519_Ge_P3 $h) {
  $recip = self::fe_invert($h->Z);
  $x = self::fe_mul($h->X, $recip);
  $y = self::fe_mul($h->Y, $recip);
  $s = self::fe_tobytes($y);
  $s[31] = self::intToChr(self::chrToInt($s[31]) ^ self::fe_isnegative($x) << 7);
  return $s;
}