wp/wp-includes/sodium_compat/lib/ristretto255.php
changeset 21 48c4eec2b7e6
parent 18 be944660c56a
child 22 8c2e4d02f4ef
equal deleted inserted replaced
20:7b1b88e27a20 21:48c4eec2b7e6
    54 }
    54 }
    55 if (!is_callable('sodium_crypto_core_ristretto255_from_hash')) {
    55 if (!is_callable('sodium_crypto_core_ristretto255_from_hash')) {
    56     /**
    56     /**
    57      * @see ParagonIE_Sodium_Compat::ristretto255_from_hash()
    57      * @see ParagonIE_Sodium_Compat::ristretto255_from_hash()
    58      *
    58      *
    59      * @param string $r
    59      * @param string $s
    60      * @return string
    60      * @return string
    61      * @throws SodiumException
    61      * @throws SodiumException
    62      */
    62      */
    63     function sodium_crypto_core_ristretto255_from_hash($r)
    63     function sodium_crypto_core_ristretto255_from_hash($s)
    64     {
    64     {
    65         return ParagonIE_Sodium_Compat::ristretto255_from_hash($r, true);
    65         return ParagonIE_Sodium_Compat::ristretto255_from_hash($s, true);
    66     }
    66     }
    67 }
    67 }
    68 if (!is_callable('sodium_crypto_core_ristretto255_is_valid_point')) {
    68 if (!is_callable('sodium_crypto_core_ristretto255_is_valid_point')) {
    69     /**
    69     /**
    70      * @see ParagonIE_Sodium_Compat::ristretto255_is_valid_point()
    70      * @see ParagonIE_Sodium_Compat::ristretto255_is_valid_point()
    71      *
    71      *
    72      * @param string $p
    72      * @param string $s
    73      * @return bool
    73      * @return bool
    74      * @throws SodiumException
    74      * @throws SodiumException
    75      */
    75      */
    76     function sodium_crypto_core_ristretto255_is_valid_point($p)
    76     function sodium_crypto_core_ristretto255_is_valid_point($s)
    77     {
    77     {
    78         return ParagonIE_Sodium_Compat::ristretto255_is_valid_point($p, true);
    78         return ParagonIE_Sodium_Compat::ristretto255_is_valid_point($s, true);
    79     }
    79     }
    80 }
    80 }
    81 if (!is_callable('sodium_crypto_core_ristretto255_random')) {
    81 if (!is_callable('sodium_crypto_core_ristretto255_random')) {
    82     /**
    82     /**
    83      * @see ParagonIE_Sodium_Compat::ristretto255_random()
    83      * @see ParagonIE_Sodium_Compat::ristretto255_random()
    92 }
    92 }
    93 if (!is_callable('sodium_crypto_core_ristretto255_scalar_add')) {
    93 if (!is_callable('sodium_crypto_core_ristretto255_scalar_add')) {
    94     /**
    94     /**
    95      * @see ParagonIE_Sodium_Compat::ristretto255_scalar_add()
    95      * @see ParagonIE_Sodium_Compat::ristretto255_scalar_add()
    96      *
    96      *
    97      * @param string $p
    97      * @param string $x
    98      * @param string $q
    98      * @param string $y
    99      * @return string
    99      * @return string
   100      * @throws SodiumException
   100      * @throws SodiumException
   101      */
   101      */
   102     function sodium_crypto_core_ristretto255_scalar_add($p, $q)
   102     function sodium_crypto_core_ristretto255_scalar_add($x, $y)
   103     {
   103     {
   104         return ParagonIE_Sodium_Compat::ristretto255_scalar_add($p, $q, true);
   104         return ParagonIE_Sodium_Compat::ristretto255_scalar_add($x, $y, true);
   105     }
   105     }
   106 }
   106 }
   107 if (!is_callable('sodium_crypto_core_ristretto255_scalar_complement')) {
   107 if (!is_callable('sodium_crypto_core_ristretto255_scalar_complement')) {
   108     /**
   108     /**
   109      * @see ParagonIE_Sodium_Compat::ristretto255_scalar_complement()
   109      * @see ParagonIE_Sodium_Compat::ristretto255_scalar_complement()
   110      *
   110      *
   111      * @param string $p
   111      * @param string $s
   112      * @return string
   112      * @return string
   113      * @throws SodiumException
   113      * @throws SodiumException
   114      */
   114      */
   115     function sodium_crypto_core_ristretto255_scalar_complement($p)
   115     function sodium_crypto_core_ristretto255_scalar_complement($s)
   116     {
   116     {
   117         return ParagonIE_Sodium_Compat::ristretto255_scalar_complement($p, true);
   117         return ParagonIE_Sodium_Compat::ristretto255_scalar_complement($s, true);
   118     }
   118     }
   119 }
   119 }
   120 if (!is_callable('sodium_crypto_core_ristretto255_scalar_invert')) {
   120 if (!is_callable('sodium_crypto_core_ristretto255_scalar_invert')) {
   121     /**
   121     /**
   122      * @see ParagonIE_Sodium_Compat::ristretto255_scalar_invert()
   122      * @see ParagonIE_Sodium_Compat::ristretto255_scalar_invert()
   132 }
   132 }
   133 if (!is_callable('sodium_crypto_core_ristretto255_scalar_mul')) {
   133 if (!is_callable('sodium_crypto_core_ristretto255_scalar_mul')) {
   134     /**
   134     /**
   135      * @see ParagonIE_Sodium_Compat::ristretto255_scalar_mul()
   135      * @see ParagonIE_Sodium_Compat::ristretto255_scalar_mul()
   136      *
   136      *
   137      * @param string $p
   137      * @param string $x
   138      * @param string $q
   138      * @param string $y
   139      * @return string
   139      * @return string
   140      * @throws SodiumException
   140      * @throws SodiumException
   141      */
   141      */
   142     function sodium_crypto_core_ristretto255_scalar_mul($p, $q)
   142     function sodium_crypto_core_ristretto255_scalar_mul($x, $y)
   143     {
   143     {
   144         return ParagonIE_Sodium_Compat::ristretto255_scalar_mul($p, $q, true);
   144         return ParagonIE_Sodium_Compat::ristretto255_scalar_mul($x, $y, true);
   145     }
   145     }
   146 }
   146 }
   147 if (!is_callable('sodium_crypto_core_ristretto255_scalar_negate')) {
   147 if (!is_callable('sodium_crypto_core_ristretto255_scalar_negate')) {
   148     /**
   148     /**
   149      * @see ParagonIE_Sodium_Compat::ristretto255_scalar_negate()
   149      * @see ParagonIE_Sodium_Compat::ristretto255_scalar_negate()
   150      *
   150      *
   151      * @param string $p
   151      * @param string $s
   152      * @return string
   152      * @return string
   153      * @throws SodiumException
   153      * @throws SodiumException
   154      */
   154      */
   155     function sodium_crypto_core_ristretto255_scalar_negate($p)
   155     function sodium_crypto_core_ristretto255_scalar_negate($s)
   156     {
   156     {
   157         return ParagonIE_Sodium_Compat::ristretto255_scalar_negate($p, true);
   157         return ParagonIE_Sodium_Compat::ristretto255_scalar_negate($s, true);
   158     }
   158     }
   159 }
   159 }
   160 if (!is_callable('sodium_crypto_core_ristretto255_scalar_random')) {
   160 if (!is_callable('sodium_crypto_core_ristretto255_scalar_random')) {
   161     /**
   161     /**
   162      * @see ParagonIE_Sodium_Compat::ristretto255_scalar_random()
   162      * @see ParagonIE_Sodium_Compat::ristretto255_scalar_random()
   171 }
   171 }
   172 if (!is_callable('sodium_crypto_core_ristretto255_scalar_reduce')) {
   172 if (!is_callable('sodium_crypto_core_ristretto255_scalar_reduce')) {
   173     /**
   173     /**
   174      * @see ParagonIE_Sodium_Compat::ristretto255_scalar_reduce()
   174      * @see ParagonIE_Sodium_Compat::ristretto255_scalar_reduce()
   175      *
   175      *
   176      * @param string $p
   176      * @param string $s
   177      * @return string
   177      * @return string
   178      * @throws SodiumException
   178      * @throws SodiumException
   179      */
   179      */
   180     function sodium_crypto_core_ristretto255_scalar_reduce($p)
   180     function sodium_crypto_core_ristretto255_scalar_reduce($s)
   181     {
   181     {
   182         return ParagonIE_Sodium_Compat::ristretto255_scalar_reduce($p, true);
   182         return ParagonIE_Sodium_Compat::ristretto255_scalar_reduce($s, true);
   183     }
   183     }
   184 }
   184 }
   185 if (!is_callable('sodium_crypto_core_ristretto255_scalar_sub')) {
   185 if (!is_callable('sodium_crypto_core_ristretto255_scalar_sub')) {
   186     /**
   186     /**
   187      * @see ParagonIE_Sodium_Compat::ristretto255_scalar_sub()
   187      * @see ParagonIE_Sodium_Compat::ristretto255_scalar_sub()
   188      *
   188      *
   189      * @param string $p
   189      * @param string $x
   190      * @param string $q
   190      * @param string $y
   191      * @return string
   191      * @return string
   192      * @throws SodiumException
   192      * @throws SodiumException
   193      */
   193      */
   194     function sodium_crypto_core_ristretto255_scalar_sub($p, $q)
   194     function sodium_crypto_core_ristretto255_scalar_sub($x, $y)
   195     {
   195     {
   196         return ParagonIE_Sodium_Compat::ristretto255_scalar_sub($p, $q, true);
   196         return ParagonIE_Sodium_Compat::ristretto255_scalar_sub($x, $y, true);
   197     }
   197     }
   198 }
   198 }
   199 if (!is_callable('sodium_crypto_core_ristretto255_sub')) {
   199 if (!is_callable('sodium_crypto_core_ristretto255_sub')) {
   200     /**
   200     /**
   201      * @see ParagonIE_Sodium_Compat::ristretto255_sub()
   201      * @see ParagonIE_Sodium_Compat::ristretto255_sub()