author | ymh <ymh.work@gmail.com> |
Fri, 05 Sep 2025 18:40:08 +0200 | |
changeset 21 | 48c4eec2b7e6 |
parent 18 | be944660c56a |
child 22 | 8c2e4d02f4ef |
permissions | -rw-r--r-- |
18 | 1 |
<?php |
2 |
||
3 |
if (!is_callable('sodium_crypto_stream_xchacha20')) { |
|
4 |
/** |
|
5 |
* @see ParagonIE_Sodium_Compat::crypto_stream_xchacha20() |
|
6 |
* @param int $len |
|
7 |
* @param string $nonce |
|
8 |
* @param string $key |
|
9 |
* @return string |
|
10 |
* @throws SodiumException |
|
11 |
* @throws TypeError |
|
12 |
*/ |
|
13 |
function sodium_crypto_stream_xchacha20($len, $nonce, $key) |
|
14 |
{ |
|
15 |
return ParagonIE_Sodium_Compat::crypto_stream_xchacha20($len, $nonce, $key, true); |
|
16 |
} |
|
17 |
} |
|
18 |
if (!is_callable('sodium_crypto_stream_xchacha20_keygen')) { |
|
19 |
/** |
|
20 |
* @see ParagonIE_Sodium_Compat::crypto_stream_xchacha20_keygen() |
|
21 |
* @return string |
|
22 |
* @throws Exception |
|
23 |
*/ |
|
24 |
function sodium_crypto_stream_xchacha20_keygen() |
|
25 |
{ |
|
26 |
return ParagonIE_Sodium_Compat::crypto_stream_xchacha20_keygen(); |
|
27 |
} |
|
28 |
} |
|
29 |
if (!is_callable('sodium_crypto_stream_xchacha20_xor')) { |
|
30 |
/** |
|
31 |
* @see ParagonIE_Sodium_Compat::crypto_stream_xchacha20_xor() |
|
32 |
* @param string $message |
|
33 |
* @param string $nonce |
|
34 |
* @param string $key |
|
35 |
* @return string |
|
36 |
* @throws SodiumException |
|
37 |
* @throws TypeError |
|
38 |
*/ |
|
39 |
function sodium_crypto_stream_xchacha20_xor($message, $nonce, $key) |
|
40 |
{ |
|
41 |
return ParagonIE_Sodium_Compat::crypto_stream_xchacha20_xor($message, $nonce, $key, true); |
|
42 |
} |
|
43 |
} |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
44 |
if (!is_callable('sodium_crypto_stream_xchacha20_xor_ic')) { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
45 |
/** |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
46 |
* @see ParagonIE_Sodium_Compat::crypto_stream_xchacha20_xor_ic() |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
47 |
* @param string $message |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
48 |
* @param string $nonce |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
49 |
* @param int $counter |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
50 |
* @param string $key |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
51 |
* @return string |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
52 |
* @throws SodiumException |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
53 |
* @throws TypeError |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
54 |
*/ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
55 |
function sodium_crypto_stream_xchacha20_xor_ic($message, $nonce, $counter, $key) |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
56 |
{ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
57 |
return ParagonIE_Sodium_Compat::crypto_stream_xchacha20_xor_ic($message, $nonce, $counter, $key, true); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
58 |
} |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
59 |
} |