sarkfultion
⌂
›
wp-includes
›
sodium_compat
›
src
›
Core
sarkfultion
25 dreads
↑ redisq
📁
AEGIS/
dreads
sarkfultion
dreads
📁
AES/
dreads
sarkfultion
dreads
📁
Base64/
dreads
sarkfultion
dreads
📁
ChaCha20/
dreads
sarkfultion
dreads
📁
Curve25519/
dreads
sarkfultion
dreads
📁
Poly1305/
dreads
sarkfultion
dreads
📁
SecretStream/
dreads
sarkfultion
dreads
📄
AEGIS128L.php
3,668 B
sarkfultion
dreads
📄
AEGIS256.php
3,598 B
sarkfultion
dreads
📄
AES.php
15,885 B
sarkfultion
dreads
📄
BLAKE2b.php
24,192 B
sarkfultion
dreads
📄
ChaCha20.php
12,889 B
sarkfultion
dreads
📄
Curve25519.php
143,641 B
sarkfultion
dreads
📄
Ed25519.php
18,482 B
sarkfultion
dreads
📄
error_log
10,786 B
sarkfultion
dreads
📄
HChaCha20.php
4,140 B
sarkfultion
dreads
📄
HSalsa20.php
3,673 B
sarkfultion
dreads
📄
Poly1305.php
1,576 B
sarkfultion
dreads
📄
Ristretto255.php
21,884 B
sarkfultion
dreads
📄
Salsa20.php
8,233 B
sarkfultion
dreads
📄
SipHash.php
8,233 B
sarkfultion
dreads
📄
Util.php
28,904 B
sarkfultion
dreads
📄
X25519.php
8,413 B
sarkfultion
dreads
📄
XChaCha20.php
3,320 B
sarkfultion
dreads
📄
XSalsa20.php
1,371 B
sarkfultion
dreads
redisq: XChaCha20.php
<?php if (class_exists('ParagonIE_Sodium_Core_XChaCha20', false)) { return; } /** * Class ParagonIE_Sodium_Core_XChaCha20 */ class ParagonIE_Sodium_Core_XChaCha20 extends ParagonIE_Sodium_Core_HChaCha20 { /** * @internal You should not use this directly from another application * * @param int $len * @param string $nonce * @param string $key * @return string * @throws SodiumException * @throws TypeError */ public static function stream($len, $nonce, $key) { if (self::strlen($nonce) !== 24) { throw new SodiumException('Nonce must be 24 bytes long'); } return self::encryptBytes( new ParagonIE_Sodium_Core_ChaCha20_Ctx( self::hChaCha20( self::substr($nonce, 0, 16), $key ), self::substr($nonce, 16, 8) ), str_repeat("\x00", $len) ); } /** * @internal You should not use this directly from another application * * @param int $len * @param string $nonce * @param string $key * @return string * @throws SodiumException * @throws TypeError */ public static function ietfStream($len, $nonce, $key) { if (self::strlen($nonce) !== 24) { throw new SodiumException('Nonce must be 24 bytes long'); } return self::encryptBytes( new ParagonIE_Sodium_Core_ChaCha20_IetfCtx( self::hChaCha20( self::substr($nonce, 0, 16), $key ), "\x00\x00\x00\x00" . self::substr($nonce, 16, 8) ), str_repeat("\x00", $len) ); } /** * @internal You should not use this directly from another application * * @param string $message * @param string $nonce * @param string $key * @param string $ic * @return string * @throws SodiumException * @throws TypeError */ public static function streamXorIc($message, $nonce, $key, $ic = '') { if (self::strlen($nonce) !== 24) { throw new SodiumException('Nonce must be 24 bytes long'); } return self::encryptBytes( new ParagonIE_Sodium_Core_ChaCha20_Ctx( self::hChaCha20(self::substr($nonce, 0, 16), $key), self::substr($nonce, 16, 8), $ic ), $message ); } /** * @internal You should not use this directly from another application * * @param string $message * @param string $nonce * @param string $key * @param string $ic * @return string * @throws SodiumException * @throws TypeError */ public static function ietfStreamXorIc($message, $nonce, $key, $ic = '') { if (self::strlen($nonce) !== 24) { throw new SodiumException('Nonce must be 24 bytes long'); } return self::encryptBytes( new ParagonIE_Sodium_Core_ChaCha20_IetfCtx( self::hChaCha20(self::substr($nonce, 0, 16), $key), "\x00\x00\x00\x00" . self::substr($nonce, 16, 8), $ic ), $message ); } }
sarkfultion