ParagonIE_Sodium_Core32_Curve25519::ge_p3_tobytes

Advertisement

Syntax Syntax

ParagonIE_Sodium_Core32_Curve25519::ge_p3_tobytes( ParagonIE_Sodium_Core32_Curve25519_Ge_P3 $h )

Parameters Parameters

$h

(ParagonIE_Sodium_Core32_Curve25519_Ge_P3) (Required)

Return Return

(string)

Source Source

File: wp-includes/sodium_compat/src/Core32/Curve25519.php

    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;
    }

Advertisement

Advertisement

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.