123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239 |
- <?php
- if (!defined('SODIUM_CRYPTO_CORE_RISTRETTO255_BYTES')) {
- define(
- 'SODIUM_CRYPTO_CORE_RISTRETTO255_BYTES',
- ParagonIE_Sodium_Compat::CRYPTO_CORE_RISTRETTO255_BYTES
- );
- define('SODIUM_COMPAT_POLYFILLED_RISTRETTO255', true);
- }
- if (!defined('SODIUM_CRYPTO_CORE_RISTRETTO255_HASHBYTES')) {
- define(
- 'SODIUM_CRYPTO_CORE_RISTRETTO255_HASHBYTES',
- ParagonIE_Sodium_Compat::CRYPTO_CORE_RISTRETTO255_HASHBYTES
- );
- }
- if (!defined('SODIUM_CRYPTO_CORE_RISTRETTO255_SCALARBYTES')) {
- define(
- 'SODIUM_CRYPTO_CORE_RISTRETTO255_SCALARBYTES',
- ParagonIE_Sodium_Compat::CRYPTO_CORE_RISTRETTO255_SCALARBYTES
- );
- }
- if (!defined('SODIUM_CRYPTO_CORE_RISTRETTO255_NONREDUCEDSCALARBYTES')) {
- define(
- 'SODIUM_CRYPTO_CORE_RISTRETTO255_NONREDUCEDSCALARBYTES',
- ParagonIE_Sodium_Compat::CRYPTO_CORE_RISTRETTO255_NONREDUCEDSCALARBYTES
- );
- }
- if (!defined('SODIUM_CRYPTO_SCALARMULT_RISTRETTO255_SCALARBYTES')) {
- define(
- 'SODIUM_CRYPTO_SCALARMULT_RISTRETTO255_SCALARBYTES',
- ParagonIE_Sodium_Compat::CRYPTO_SCALARMULT_RISTRETTO255_SCALARBYTES
- );
- }
- if (!defined('SODIUM_CRYPTO_SCALARMULT_RISTRETTO255_BYTES')) {
- define(
- 'SODIUM_CRYPTO_SCALARMULT_RISTRETTO255_BYTES',
- ParagonIE_Sodium_Compat::CRYPTO_SCALARMULT_RISTRETTO255_BYTES
- );
- }
- if (!is_callable('sodium_crypto_core_ristretto255_add')) {
- /**
- * @see ParagonIE_Sodium_Compat::ristretto255_add()
- *
- * @param string $p
- * @param string $q
- * @return string
- * @throws SodiumException
- */
- function sodium_crypto_core_ristretto255_add($p, $q)
- {
- return ParagonIE_Sodium_Compat::ristretto255_add($p, $q, true);
- }
- }
- if (!is_callable('sodium_crypto_core_ristretto255_from_hash')) {
- /**
- * @see ParagonIE_Sodium_Compat::ristretto255_from_hash()
- *
- * @param string $s
- * @return string
- * @throws SodiumException
- */
- function sodium_crypto_core_ristretto255_from_hash($s)
- {
- return ParagonIE_Sodium_Compat::ristretto255_from_hash($s, true);
- }
- }
- if (!is_callable('sodium_crypto_core_ristretto255_is_valid_point')) {
- /**
- * @see ParagonIE_Sodium_Compat::ristretto255_is_valid_point()
- *
- * @param string $s
- * @return bool
- * @throws SodiumException
- */
- function sodium_crypto_core_ristretto255_is_valid_point($s)
- {
- return ParagonIE_Sodium_Compat::ristretto255_is_valid_point($s, true);
- }
- }
- if (!is_callable('sodium_crypto_core_ristretto255_random')) {
- /**
- * @see ParagonIE_Sodium_Compat::ristretto255_random()
- *
- * @return string
- * @throws SodiumException
- */
- function sodium_crypto_core_ristretto255_random()
- {
- return ParagonIE_Sodium_Compat::ristretto255_random(true);
- }
- }
- if (!is_callable('sodium_crypto_core_ristretto255_scalar_add')) {
- /**
- * @see ParagonIE_Sodium_Compat::ristretto255_scalar_add()
- *
- * @param string $x
- * @param string $y
- * @return string
- * @throws SodiumException
- */
- function sodium_crypto_core_ristretto255_scalar_add($x, $y)
- {
- return ParagonIE_Sodium_Compat::ristretto255_scalar_add($x, $y, true);
- }
- }
- if (!is_callable('sodium_crypto_core_ristretto255_scalar_complement')) {
- /**
- * @see ParagonIE_Sodium_Compat::ristretto255_scalar_complement()
- *
- * @param string $s
- * @return string
- * @throws SodiumException
- */
- function sodium_crypto_core_ristretto255_scalar_complement($s)
- {
- return ParagonIE_Sodium_Compat::ristretto255_scalar_complement($s, true);
- }
- }
- if (!is_callable('sodium_crypto_core_ristretto255_scalar_invert')) {
- /**
- * @see ParagonIE_Sodium_Compat::ristretto255_scalar_invert()
- *
- * @param string $p
- * @return string
- * @throws SodiumException
- */
- function sodium_crypto_core_ristretto255_scalar_invert($p)
- {
- return ParagonIE_Sodium_Compat::ristretto255_scalar_invert($p, true);
- }
- }
- if (!is_callable('sodium_crypto_core_ristretto255_scalar_mul')) {
- /**
- * @see ParagonIE_Sodium_Compat::ristretto255_scalar_mul()
- *
- * @param string $x
- * @param string $y
- * @return string
- * @throws SodiumException
- */
- function sodium_crypto_core_ristretto255_scalar_mul($x, $y)
- {
- return ParagonIE_Sodium_Compat::ristretto255_scalar_mul($x, $y, true);
- }
- }
- if (!is_callable('sodium_crypto_core_ristretto255_scalar_negate')) {
- /**
- * @see ParagonIE_Sodium_Compat::ristretto255_scalar_negate()
- *
- * @param string $s
- * @return string
- * @throws SodiumException
- */
- function sodium_crypto_core_ristretto255_scalar_negate($s)
- {
- return ParagonIE_Sodium_Compat::ristretto255_scalar_negate($s, true);
- }
- }
- if (!is_callable('sodium_crypto_core_ristretto255_scalar_random')) {
- /**
- * @see ParagonIE_Sodium_Compat::ristretto255_scalar_random()
- *
- * @return string
- * @throws SodiumException
- */
- function sodium_crypto_core_ristretto255_scalar_random()
- {
- return ParagonIE_Sodium_Compat::ristretto255_scalar_random(true);
- }
- }
- if (!is_callable('sodium_crypto_core_ristretto255_scalar_reduce')) {
- /**
- * @see ParagonIE_Sodium_Compat::ristretto255_scalar_reduce()
- *
- * @param string $s
- * @return string
- * @throws SodiumException
- */
- function sodium_crypto_core_ristretto255_scalar_reduce($s)
- {
- return ParagonIE_Sodium_Compat::ristretto255_scalar_reduce($s, true);
- }
- }
- if (!is_callable('sodium_crypto_core_ristretto255_scalar_sub')) {
- /**
- * @see ParagonIE_Sodium_Compat::ristretto255_scalar_sub()
- *
- * @param string $x
- * @param string $y
- * @return string
- * @throws SodiumException
- */
- function sodium_crypto_core_ristretto255_scalar_sub($x, $y)
- {
- return ParagonIE_Sodium_Compat::ristretto255_scalar_sub($x, $y, true);
- }
- }
- if (!is_callable('sodium_crypto_core_ristretto255_sub')) {
- /**
- * @see ParagonIE_Sodium_Compat::ristretto255_sub()
- *
- * @param string $p
- * @param string $q
- * @return string
- * @throws SodiumException
- */
- function sodium_crypto_core_ristretto255_sub($p, $q)
- {
- return ParagonIE_Sodium_Compat::ristretto255_sub($p, $q, true);
- }
- }
- if (!is_callable('sodium_crypto_scalarmult_ristretto255')) {
- /**
- * @see ParagonIE_Sodium_Compat::crypto_scalarmult_ristretto255()
- * @param string $n
- * @param string $p
- * @return string
- * @throws SodiumException
- * @throws TypeError
- */
- function sodium_crypto_scalarmult_ristretto255($n, $p)
- {
- return ParagonIE_Sodium_Compat::scalarmult_ristretto255($n, $p, true);
- }
- }
- if (!is_callable('sodium_crypto_scalarmult_ristretto255_base')) {
- /**
- * @see ParagonIE_Sodium_Compat::crypto_scalarmult_ristretto255_base()
- * @param string $n
- * @return string
- * @throws SodiumException
- * @throws TypeError
- */
- function sodium_crypto_scalarmult_ristretto255_base($n)
- {
- return ParagonIE_Sodium_Compat::scalarmult_ristretto255_base($n, true);
- }
- }
|