-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
93f84d9
commit efcecfb
Showing
3 changed files
with
48 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?php | ||
|
||
if (!is_callable('sodium_crypto_stream_xchacha20')) { | ||
/** | ||
* @see ParagonIE_Sodium_Compat::crypto_stream_xchacha20() | ||
* @param int $len | ||
* @param string $nonce | ||
* @param string $key | ||
* @return string | ||
* @throws SodiumException | ||
* @throws TypeError | ||
*/ | ||
function sodium_crypto_stream_xchacha20($len, $nonce, $key) | ||
{ | ||
return ParagonIE_Sodium_Compat::crypto_stream_xchacha20($len, $nonce, $key, true); | ||
} | ||
} | ||
if (!is_callable('sodium_crypto_stream_xchacha20_keygen')) { | ||
/** | ||
* @see ParagonIE_Sodium_Compat::crypto_stream_xchacha20_keygen() | ||
* @return string | ||
* @throws Exception | ||
*/ | ||
function sodium_crypto_stream_xchacha20_keygen() | ||
{ | ||
return ParagonIE_Sodium_Compat::crypto_stream_xchacha20_keygen(); | ||
} | ||
} | ||
if (!is_callable('sodium_crypto_stream_xchacha20_xor')) { | ||
/** | ||
* @see ParagonIE_Sodium_Compat::crypto_stream_xchacha20_xor() | ||
* @param string $message | ||
* @param string $nonce | ||
* @param string $key | ||
* @return string | ||
* @throws SodiumException | ||
* @throws TypeError | ||
*/ | ||
function sodium_crypto_stream_xchacha20_xor($message, $nonce, $key) | ||
{ | ||
return ParagonIE_Sodium_Compat::crypto_stream_xchacha20_xor($message, $nonce, $key, true); | ||
} | ||
} |