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

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/clone/wp-inclu.../sodium_c.../src
File: Crypto.php
# if (sodium_memcmp(mac, stored_mac, sizeof mac) != 0) {
[1500] Fix | Delete
# sodium_memzero(mac, sizeof mac);
[1501] Fix | Delete
# return -1;
[1502] Fix | Delete
# }
[1503] Fix | Delete
[1504] Fix | Delete
$stored = ParagonIE_Sodium_Core_Util::substr($cipher, $msglen + 1, 16);
[1505] Fix | Delete
if (!ParagonIE_Sodium_Core_Util::hashEquals($mac, $stored)) {
[1506] Fix | Delete
return false;
[1507] Fix | Delete
}
[1508] Fix | Delete
[1509] Fix | Delete
# crypto_stream_chacha20_ietf_xor_ic(m, c, mlen, state->nonce, 2U, state->k);
[1510] Fix | Delete
$out = ParagonIE_Sodium_Core_ChaCha20::ietfStreamXorIc(
[1511] Fix | Delete
ParagonIE_Sodium_Core_Util::substr($cipher, 1, $msglen),
[1512] Fix | Delete
$st->getCombinedNonce(),
[1513] Fix | Delete
$st->getKey(),
[1514] Fix | Delete
ParagonIE_Sodium_Core_Util::store64_le(2)
[1515] Fix | Delete
);
[1516] Fix | Delete
[1517] Fix | Delete
# XOR_BUF(STATE_INONCE(state), mac,
[1518] Fix | Delete
# crypto_secretstream_xchacha20poly1305_INONCEBYTES);
[1519] Fix | Delete
$st->xorNonce($mac);
[1520] Fix | Delete
[1521] Fix | Delete
# sodium_increment(STATE_COUNTER(state),
[1522] Fix | Delete
# crypto_secretstream_xchacha20poly1305_COUNTERBYTES);
[1523] Fix | Delete
$st->incrementCounter();
[1524] Fix | Delete
[1525] Fix | Delete
# if ((tag & crypto_secretstream_xchacha20poly1305_TAG_REKEY) != 0 ||
[1526] Fix | Delete
# sodium_is_zero(STATE_COUNTER(state),
[1527] Fix | Delete
# crypto_secretstream_xchacha20poly1305_COUNTERBYTES)) {
[1528] Fix | Delete
# crypto_secretstream_xchacha20poly1305_rekey(state);
[1529] Fix | Delete
# }
[1530] Fix | Delete
[1531] Fix | Delete
// Overwrite by reference:
[1532] Fix | Delete
$state = $st->toString();
[1533] Fix | Delete
[1534] Fix | Delete
/** @var bool $rekey */
[1535] Fix | Delete
$rekey = ($tag & ParagonIE_Sodium_Compat::CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_REKEY) !== 0;
[1536] Fix | Delete
if ($rekey || $st->needsRekey()) {
[1537] Fix | Delete
// DO REKEY
[1538] Fix | Delete
self::secretstream_xchacha20poly1305_rekey($state);
[1539] Fix | Delete
}
[1540] Fix | Delete
return array($out, $tag);
[1541] Fix | Delete
}
[1542] Fix | Delete
[1543] Fix | Delete
/**
[1544] Fix | Delete
* @param string $state
[1545] Fix | Delete
* @return void
[1546] Fix | Delete
* @throws SodiumException
[1547] Fix | Delete
*/
[1548] Fix | Delete
public static function secretstream_xchacha20poly1305_rekey(&$state)
[1549] Fix | Delete
{
[1550] Fix | Delete
$st = ParagonIE_Sodium_Core_SecretStream_State::fromString($state);
[1551] Fix | Delete
# unsigned char new_key_and_inonce[crypto_stream_chacha20_ietf_KEYBYTES +
[1552] Fix | Delete
# crypto_secretstream_xchacha20poly1305_INONCEBYTES];
[1553] Fix | Delete
# size_t i;
[1554] Fix | Delete
# for (i = 0U; i < crypto_stream_chacha20_ietf_KEYBYTES; i++) {
[1555] Fix | Delete
# new_key_and_inonce[i] = state->k[i];
[1556] Fix | Delete
# }
[1557] Fix | Delete
$new_key_and_inonce = $st->getKey();
[1558] Fix | Delete
[1559] Fix | Delete
# for (i = 0U; i < crypto_secretstream_xchacha20poly1305_INONCEBYTES; i++) {
[1560] Fix | Delete
# new_key_and_inonce[crypto_stream_chacha20_ietf_KEYBYTES + i] =
[1561] Fix | Delete
# STATE_INONCE(state)[i];
[1562] Fix | Delete
# }
[1563] Fix | Delete
$new_key_and_inonce .= ParagonIE_Sodium_Core_Util::substR($st->getNonce(), 0, 8);
[1564] Fix | Delete
[1565] Fix | Delete
# crypto_stream_chacha20_ietf_xor(new_key_and_inonce, new_key_and_inonce,
[1566] Fix | Delete
# sizeof new_key_and_inonce,
[1567] Fix | Delete
# state->nonce, state->k);
[1568] Fix | Delete
[1569] Fix | Delete
$st->rekey(ParagonIE_Sodium_Core_ChaCha20::ietfStreamXorIc(
[1570] Fix | Delete
$new_key_and_inonce,
[1571] Fix | Delete
$st->getCombinedNonce(),
[1572] Fix | Delete
$st->getKey(),
[1573] Fix | Delete
ParagonIE_Sodium_Core_Util::store64_le(0)
[1574] Fix | Delete
));
[1575] Fix | Delete
[1576] Fix | Delete
# for (i = 0U; i < crypto_stream_chacha20_ietf_KEYBYTES; i++) {
[1577] Fix | Delete
# state->k[i] = new_key_and_inonce[i];
[1578] Fix | Delete
# }
[1579] Fix | Delete
# for (i = 0U; i < crypto_secretstream_xchacha20poly1305_INONCEBYTES; i++) {
[1580] Fix | Delete
# STATE_INONCE(state)[i] =
[1581] Fix | Delete
# new_key_and_inonce[crypto_stream_chacha20_ietf_KEYBYTES + i];
[1582] Fix | Delete
# }
[1583] Fix | Delete
# _crypto_secretstream_xchacha20poly1305_counter_reset(state);
[1584] Fix | Delete
$st->counterReset();
[1585] Fix | Delete
[1586] Fix | Delete
$state = $st->toString();
[1587] Fix | Delete
}
[1588] Fix | Delete
[1589] Fix | Delete
/**
[1590] Fix | Delete
* Detached Ed25519 signature.
[1591] Fix | Delete
*
[1592] Fix | Delete
* @internal Do not use this directly. Use ParagonIE_Sodium_Compat.
[1593] Fix | Delete
*
[1594] Fix | Delete
* @param string $message
[1595] Fix | Delete
* @param string $sk
[1596] Fix | Delete
* @return string
[1597] Fix | Delete
* @throws SodiumException
[1598] Fix | Delete
* @throws TypeError
[1599] Fix | Delete
*/
[1600] Fix | Delete
public static function sign_detached($message, $sk)
[1601] Fix | Delete
{
[1602] Fix | Delete
return ParagonIE_Sodium_Core_Ed25519::sign_detached($message, $sk);
[1603] Fix | Delete
}
[1604] Fix | Delete
[1605] Fix | Delete
/**
[1606] Fix | Delete
* Attached Ed25519 signature. (Returns a signed message.)
[1607] Fix | Delete
*
[1608] Fix | Delete
* @internal Do not use this directly. Use ParagonIE_Sodium_Compat.
[1609] Fix | Delete
*
[1610] Fix | Delete
* @param string $message
[1611] Fix | Delete
* @param string $sk
[1612] Fix | Delete
* @return string
[1613] Fix | Delete
* @throws SodiumException
[1614] Fix | Delete
* @throws TypeError
[1615] Fix | Delete
*/
[1616] Fix | Delete
public static function sign($message, $sk)
[1617] Fix | Delete
{
[1618] Fix | Delete
return ParagonIE_Sodium_Core_Ed25519::sign($message, $sk);
[1619] Fix | Delete
}
[1620] Fix | Delete
[1621] Fix | Delete
/**
[1622] Fix | Delete
* Opens a signed message. If valid, returns the message.
[1623] Fix | Delete
*
[1624] Fix | Delete
* @internal Do not use this directly. Use ParagonIE_Sodium_Compat.
[1625] Fix | Delete
*
[1626] Fix | Delete
* @param string $signedMessage
[1627] Fix | Delete
* @param string $pk
[1628] Fix | Delete
* @return string
[1629] Fix | Delete
* @throws SodiumException
[1630] Fix | Delete
* @throws TypeError
[1631] Fix | Delete
*/
[1632] Fix | Delete
public static function sign_open($signedMessage, $pk)
[1633] Fix | Delete
{
[1634] Fix | Delete
return ParagonIE_Sodium_Core_Ed25519::sign_open($signedMessage, $pk);
[1635] Fix | Delete
}
[1636] Fix | Delete
[1637] Fix | Delete
/**
[1638] Fix | Delete
* Verify a detached signature of a given message and public key.
[1639] Fix | Delete
*
[1640] Fix | Delete
* @internal Do not use this directly. Use ParagonIE_Sodium_Compat.
[1641] Fix | Delete
*
[1642] Fix | Delete
* @param string $signature
[1643] Fix | Delete
* @param string $message
[1644] Fix | Delete
* @param string $pk
[1645] Fix | Delete
* @return bool
[1646] Fix | Delete
* @throws SodiumException
[1647] Fix | Delete
* @throws TypeError
[1648] Fix | Delete
*/
[1649] Fix | Delete
public static function sign_verify_detached($signature, $message, $pk)
[1650] Fix | Delete
{
[1651] Fix | Delete
return ParagonIE_Sodium_Core_Ed25519::verify_detached($signature, $message, $pk);
[1652] Fix | Delete
}
[1653] Fix | Delete
}
[1654] Fix | Delete
[1655] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function