18
|
1 |
<?php |
|
2 |
|
|
3 |
if (!defined('SODIUM_CRYPTO_CORE_RISTRETTO255_BYTES')) { |
|
4 |
define( |
|
5 |
'SODIUM_CRYPTO_CORE_RISTRETTO255_BYTES', |
|
6 |
ParagonIE_Sodium_Compat::CRYPTO_CORE_RISTRETTO255_BYTES |
|
7 |
); |
|
8 |
define('SODIUM_COMPAT_POLYFILLED_RISTRETTO255', true); |
|
9 |
} |
|
10 |
if (!defined('SODIUM_CRYPTO_CORE_RISTRETTO255_HASHBYTES')) { |
|
11 |
define( |
|
12 |
'SODIUM_CRYPTO_CORE_RISTRETTO255_HASHBYTES', |
|
13 |
ParagonIE_Sodium_Compat::CRYPTO_CORE_RISTRETTO255_HASHBYTES |
|
14 |
); |
|
15 |
} |
|
16 |
if (!defined('SODIUM_CRYPTO_CORE_RISTRETTO255_SCALARBYTES')) { |
|
17 |
define( |
|
18 |
'SODIUM_CRYPTO_CORE_RISTRETTO255_SCALARBYTES', |
|
19 |
ParagonIE_Sodium_Compat::CRYPTO_CORE_RISTRETTO255_SCALARBYTES |
|
20 |
); |
|
21 |
} |
|
22 |
if (!defined('SODIUM_CRYPTO_CORE_RISTRETTO255_NONREDUCEDSCALARBYTES')) { |
|
23 |
define( |
|
24 |
'SODIUM_CRYPTO_CORE_RISTRETTO255_NONREDUCEDSCALARBYTES', |
|
25 |
ParagonIE_Sodium_Compat::CRYPTO_CORE_RISTRETTO255_NONREDUCEDSCALARBYTES |
|
26 |
); |
|
27 |
} |
|
28 |
if (!defined('SODIUM_CRYPTO_SCALARMULT_RISTRETTO255_SCALARBYTES')) { |
|
29 |
define( |
|
30 |
'SODIUM_CRYPTO_SCALARMULT_RISTRETTO255_SCALARBYTES', |
|
31 |
ParagonIE_Sodium_Compat::CRYPTO_SCALARMULT_RISTRETTO255_SCALARBYTES |
|
32 |
); |
|
33 |
} |
|
34 |
if (!defined('SODIUM_CRYPTO_SCALARMULT_RISTRETTO255_BYTES')) { |
|
35 |
define( |
|
36 |
'SODIUM_CRYPTO_SCALARMULT_RISTRETTO255_BYTES', |
|
37 |
ParagonIE_Sodium_Compat::CRYPTO_SCALARMULT_RISTRETTO255_BYTES |
|
38 |
); |
|
39 |
} |
|
40 |
|
|
41 |
if (!is_callable('sodium_crypto_core_ristretto255_add')) { |
|
42 |
/** |
|
43 |
* @see ParagonIE_Sodium_Compat::ristretto255_add() |
|
44 |
* |
|
45 |
* @param string $p |
|
46 |
* @param string $q |
|
47 |
* @return string |
|
48 |
* @throws SodiumException |
|
49 |
*/ |
|
50 |
function sodium_crypto_core_ristretto255_add($p, $q) |
|
51 |
{ |
|
52 |
return ParagonIE_Sodium_Compat::ristretto255_add($p, $q, true); |
|
53 |
} |
|
54 |
} |
|
55 |
if (!is_callable('sodium_crypto_core_ristretto255_from_hash')) { |
|
56 |
/** |
|
57 |
* @see ParagonIE_Sodium_Compat::ristretto255_from_hash() |
|
58 |
* |
|
59 |
* @param string $r |
|
60 |
* @return string |
|
61 |
* @throws SodiumException |
|
62 |
*/ |
|
63 |
function sodium_crypto_core_ristretto255_from_hash($r) |
|
64 |
{ |
|
65 |
return ParagonIE_Sodium_Compat::ristretto255_from_hash($r, true); |
|
66 |
} |
|
67 |
} |
|
68 |
if (!is_callable('sodium_crypto_core_ristretto255_is_valid_point')) { |
|
69 |
/** |
|
70 |
* @see ParagonIE_Sodium_Compat::ristretto255_is_valid_point() |
|
71 |
* |
|
72 |
* @param string $p |
|
73 |
* @return bool |
|
74 |
* @throws SodiumException |
|
75 |
*/ |
|
76 |
function sodium_crypto_core_ristretto255_is_valid_point($p) |
|
77 |
{ |
|
78 |
return ParagonIE_Sodium_Compat::ristretto255_is_valid_point($p, true); |
|
79 |
} |
|
80 |
} |
|
81 |
if (!is_callable('sodium_crypto_core_ristretto255_random')) { |
|
82 |
/** |
|
83 |
* @see ParagonIE_Sodium_Compat::ristretto255_random() |
|
84 |
* |
|
85 |
* @return string |
|
86 |
* @throws SodiumException |
|
87 |
*/ |
|
88 |
function sodium_crypto_core_ristretto255_random() |
|
89 |
{ |
|
90 |
return ParagonIE_Sodium_Compat::ristretto255_random(true); |
|
91 |
} |
|
92 |
} |
|
93 |
if (!is_callable('sodium_crypto_core_ristretto255_scalar_add')) { |
|
94 |
/** |
|
95 |
* @see ParagonIE_Sodium_Compat::ristretto255_scalar_add() |
|
96 |
* |
|
97 |
* @param string $p |
|
98 |
* @param string $q |
|
99 |
* @return string |
|
100 |
* @throws SodiumException |
|
101 |
*/ |
|
102 |
function sodium_crypto_core_ristretto255_scalar_add($p, $q) |
|
103 |
{ |
|
104 |
return ParagonIE_Sodium_Compat::ristretto255_scalar_add($p, $q, true); |
|
105 |
} |
|
106 |
} |
|
107 |
if (!is_callable('sodium_crypto_core_ristretto255_scalar_complement')) { |
|
108 |
/** |
|
109 |
* @see ParagonIE_Sodium_Compat::ristretto255_scalar_complement() |
|
110 |
* |
|
111 |
* @param string $p |
|
112 |
* @return string |
|
113 |
* @throws SodiumException |
|
114 |
*/ |
|
115 |
function sodium_crypto_core_ristretto255_scalar_complement($p) |
|
116 |
{ |
|
117 |
return ParagonIE_Sodium_Compat::ristretto255_scalar_complement($p, true); |
|
118 |
} |
|
119 |
} |
|
120 |
if (!is_callable('sodium_crypto_core_ristretto255_scalar_invert')) { |
|
121 |
/** |
|
122 |
* @see ParagonIE_Sodium_Compat::ristretto255_scalar_invert() |
|
123 |
* |
|
124 |
* @param string $p |
|
125 |
* @return string |
|
126 |
* @throws SodiumException |
|
127 |
*/ |
|
128 |
function sodium_crypto_core_ristretto255_scalar_invert($p) |
|
129 |
{ |
|
130 |
return ParagonIE_Sodium_Compat::ristretto255_scalar_invert($p, true); |
|
131 |
} |
|
132 |
} |
|
133 |
if (!is_callable('sodium_crypto_core_ristretto255_scalar_mul')) { |
|
134 |
/** |
|
135 |
* @see ParagonIE_Sodium_Compat::ristretto255_scalar_mul() |
|
136 |
* |
|
137 |
* @param string $p |
|
138 |
* @param string $q |
|
139 |
* @return string |
|
140 |
* @throws SodiumException |
|
141 |
*/ |
|
142 |
function sodium_crypto_core_ristretto255_scalar_mul($p, $q) |
|
143 |
{ |
|
144 |
return ParagonIE_Sodium_Compat::ristretto255_scalar_mul($p, $q, true); |
|
145 |
} |
|
146 |
} |
|
147 |
if (!is_callable('sodium_crypto_core_ristretto255_scalar_negate')) { |
|
148 |
/** |
|
149 |
* @see ParagonIE_Sodium_Compat::ristretto255_scalar_negate() |
|
150 |
* |
|
151 |
* @param string $p |
|
152 |
* @return string |
|
153 |
* @throws SodiumException |
|
154 |
*/ |
|
155 |
function sodium_crypto_core_ristretto255_scalar_negate($p) |
|
156 |
{ |
|
157 |
return ParagonIE_Sodium_Compat::ristretto255_scalar_negate($p, true); |
|
158 |
} |
|
159 |
} |
|
160 |
if (!is_callable('sodium_crypto_core_ristretto255_scalar_random')) { |
|
161 |
/** |
|
162 |
* @see ParagonIE_Sodium_Compat::ristretto255_scalar_random() |
|
163 |
* |
|
164 |
* @return string |
|
165 |
* @throws SodiumException |
|
166 |
*/ |
|
167 |
function sodium_crypto_core_ristretto255_scalar_random() |
|
168 |
{ |
|
169 |
return ParagonIE_Sodium_Compat::ristretto255_scalar_random(true); |
|
170 |
} |
|
171 |
} |
|
172 |
if (!is_callable('sodium_crypto_core_ristretto255_scalar_reduce')) { |
|
173 |
/** |
|
174 |
* @see ParagonIE_Sodium_Compat::ristretto255_scalar_reduce() |
|
175 |
* |
|
176 |
* @param string $p |
|
177 |
* @return string |
|
178 |
* @throws SodiumException |
|
179 |
*/ |
|
180 |
function sodium_crypto_core_ristretto255_scalar_reduce($p) |
|
181 |
{ |
|
182 |
return ParagonIE_Sodium_Compat::ristretto255_scalar_reduce($p, true); |
|
183 |
} |
|
184 |
} |
|
185 |
if (!is_callable('sodium_crypto_core_ristretto255_scalar_sub')) { |
|
186 |
/** |
|
187 |
* @see ParagonIE_Sodium_Compat::ristretto255_scalar_sub() |
|
188 |
* |
|
189 |
* @param string $p |
|
190 |
* @param string $q |
|
191 |
* @return string |
|
192 |
* @throws SodiumException |
|
193 |
*/ |
|
194 |
function sodium_crypto_core_ristretto255_scalar_sub($p, $q) |
|
195 |
{ |
|
196 |
return ParagonIE_Sodium_Compat::ristretto255_scalar_sub($p, $q, true); |
|
197 |
} |
|
198 |
} |
|
199 |
if (!is_callable('sodium_crypto_core_ristretto255_sub')) { |
|
200 |
/** |
|
201 |
* @see ParagonIE_Sodium_Compat::ristretto255_sub() |
|
202 |
* |
|
203 |
* @param string $p |
|
204 |
* @param string $q |
|
205 |
* @return string |
|
206 |
* @throws SodiumException |
|
207 |
*/ |
|
208 |
function sodium_crypto_core_ristretto255_sub($p, $q) |
|
209 |
{ |
|
210 |
return ParagonIE_Sodium_Compat::ristretto255_sub($p, $q, true); |
|
211 |
} |
|
212 |
} |
|
213 |
if (!is_callable('sodium_crypto_scalarmult_ristretto255')) { |
|
214 |
/** |
|
215 |
* @see ParagonIE_Sodium_Compat::crypto_scalarmult_ristretto255() |
|
216 |
* @param string $n |
|
217 |
* @param string $p |
|
218 |
* @return string |
|
219 |
* @throws SodiumException |
|
220 |
* @throws TypeError |
|
221 |
*/ |
|
222 |
function sodium_crypto_scalarmult_ristretto255($n, $p) |
|
223 |
{ |
|
224 |
return ParagonIE_Sodium_Compat::scalarmult_ristretto255($n, $p, true); |
|
225 |
} |
|
226 |
} |
|
227 |
if (!is_callable('sodium_crypto_scalarmult_ristretto255_base')) { |
|
228 |
/** |
|
229 |
* @see ParagonIE_Sodium_Compat::crypto_scalarmult_ristretto255_base() |
|
230 |
* @param string $n |
|
231 |
* @return string |
|
232 |
* @throws SodiumException |
|
233 |
* @throws TypeError |
|
234 |
*/ |
|
235 |
function sodium_crypto_scalarmult_ristretto255_base($n) |
|
236 |
{ |
|
237 |
return ParagonIE_Sodium_Compat::scalarmult_ristretto255_base($n, true); |
|
238 |
} |
|
239 |
} |