Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/wp-inclu.../sodium_c.../src/Core32
File: XChaCha20.php
<?php
[0] Fix | Delete
[1] Fix | Delete
if (class_exists('ParagonIE_Sodium_Core32_XChaCha20', false)) {
[2] Fix | Delete
return;
[3] Fix | Delete
}
[4] Fix | Delete
[5] Fix | Delete
/**
[6] Fix | Delete
* Class ParagonIE_Sodium_Core32_XChaCha20
[7] Fix | Delete
*/
[8] Fix | Delete
class ParagonIE_Sodium_Core32_XChaCha20 extends ParagonIE_Sodium_Core32_HChaCha20
[9] Fix | Delete
{
[10] Fix | Delete
/**
[11] Fix | Delete
* @internal You should not use this directly from another application
[12] Fix | Delete
*
[13] Fix | Delete
* @param int $len
[14] Fix | Delete
* @param string $nonce
[15] Fix | Delete
* @param string $key
[16] Fix | Delete
* @return string
[17] Fix | Delete
* @throws SodiumException
[18] Fix | Delete
* @throws TypeError
[19] Fix | Delete
*/
[20] Fix | Delete
public static function stream($len = 64, $nonce = '', $key = '')
[21] Fix | Delete
{
[22] Fix | Delete
if (self::strlen($nonce) !== 24) {
[23] Fix | Delete
throw new SodiumException('Nonce must be 24 bytes long');
[24] Fix | Delete
}
[25] Fix | Delete
return self::encryptBytes(
[26] Fix | Delete
new ParagonIE_Sodium_Core32_ChaCha20_Ctx(
[27] Fix | Delete
self::hChaCha20(
[28] Fix | Delete
self::substr($nonce, 0, 16),
[29] Fix | Delete
$key
[30] Fix | Delete
),
[31] Fix | Delete
self::substr($nonce, 16, 8)
[32] Fix | Delete
),
[33] Fix | Delete
str_repeat("\x00", $len)
[34] Fix | Delete
);
[35] Fix | Delete
}
[36] Fix | Delete
[37] Fix | Delete
/**
[38] Fix | Delete
* @internal You should not use this directly from another application
[39] Fix | Delete
*
[40] Fix | Delete
* @param string $message
[41] Fix | Delete
* @param string $nonce
[42] Fix | Delete
* @param string $key
[43] Fix | Delete
* @param string $ic
[44] Fix | Delete
* @return string
[45] Fix | Delete
* @throws SodiumException
[46] Fix | Delete
* @throws TypeError
[47] Fix | Delete
*/
[48] Fix | Delete
public static function streamXorIc($message, $nonce = '', $key = '', $ic = '')
[49] Fix | Delete
{
[50] Fix | Delete
if (self::strlen($nonce) !== 24) {
[51] Fix | Delete
throw new SodiumException('Nonce must be 24 bytes long');
[52] Fix | Delete
}
[53] Fix | Delete
return self::encryptBytes(
[54] Fix | Delete
new ParagonIE_Sodium_Core32_ChaCha20_Ctx(
[55] Fix | Delete
self::hChaCha20(self::substr($nonce, 0, 16), $key),
[56] Fix | Delete
self::substr($nonce, 16, 8),
[57] Fix | Delete
$ic
[58] Fix | Delete
),
[59] Fix | Delete
$message
[60] Fix | Delete
);
[61] Fix | Delete
}
[62] Fix | Delete
[63] Fix | Delete
/**
[64] Fix | Delete
* @internal You should not use this directly from another application
[65] Fix | Delete
*
[66] Fix | Delete
* @param string $message
[67] Fix | Delete
* @param string $nonce
[68] Fix | Delete
* @param string $key
[69] Fix | Delete
* @param string $ic
[70] Fix | Delete
* @return string
[71] Fix | Delete
* @throws SodiumException
[72] Fix | Delete
* @throws TypeError
[73] Fix | Delete
*/
[74] Fix | Delete
public static function ietfStreamXorIc($message, $nonce = '', $key = '', $ic = '')
[75] Fix | Delete
{
[76] Fix | Delete
return self::encryptBytes(
[77] Fix | Delete
new ParagonIE_Sodium_Core32_ChaCha20_IetfCtx(
[78] Fix | Delete
self::hChaCha20(self::substr($nonce, 0, 16), $key),
[79] Fix | Delete
"\x00\x00\x00\x00" . self::substr($nonce, 16, 8),
[80] Fix | Delete
$ic
[81] Fix | Delete
),
[82] Fix | Delete
$message
[83] Fix | Delete
);
[84] Fix | Delete
}
[85] Fix | Delete
}
[86] Fix | Delete
[87] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function