return self::
sk_to_pk($sk);
} /**
* @param string $pk
* @return string
* @throws SodiumException
* @throws TypeError
*/
public static function pk_to_curve25519($pk) { if (self::
small_order($pk)) { throw new SodiumException('Public key is on a small order'
);
} $A = self::
ge_frombytes_negate_vartime($pk);
$p1 = self::
ge_mul_l($A);
if (!self::
fe_isnonzero($p1->X
)) { throw new SodiumException('Unexpected zero result'
);
} # fe_1(one_minus_y);
# fe_sub(one_minus_y, one_minus_y, A.Y);
# fe_invert(one_minus_y, one_minus_y);