WordPress at Your Fingertips
function is not described

ParagonIE_Sodium_Core_Curve25519::ge_tobytes() public WP 1.0

Convert a group element to a byte string.

{} It's a method of the class: ParagonIE_Sodium_Core_Curve25519{}

No Hooks.

Return

String.

Usage

$result = ParagonIE_Sodium_Core_Curve25519::ge_tobytes( $h );
$h(ParagonIE_Sodium_Core_Curve25519_Ge_P2) (required)
-

Code of ParagonIE_Sodium_Core_Curve25519::ge_tobytes() WP 5.8.2

public static function ge_tobytes(ParagonIE_Sodium_Core_Curve25519_Ge_P2 $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;
}