mirror of
https://github.com/danog/phpseclib.git
synced 2024-12-12 09:09:39 +01:00
Crypt/Base: use sodium_increment in _increment_str
This commit is contained in:
parent
45d2ddcbc4
commit
1ba024df94
@ -2007,6 +2007,11 @@ class Crypt_Base
|
|||||||
*/
|
*/
|
||||||
function _increment_str(&$var)
|
function _increment_str(&$var)
|
||||||
{
|
{
|
||||||
|
if (function_exists('sodium_increment')) {
|
||||||
|
sodium_increment($var);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
for ($i = 4; $i <= strlen($var); $i+= 4) {
|
for ($i = 4; $i <= strlen($var); $i+= 4) {
|
||||||
$temp = substr($var, -$i, 4);
|
$temp = substr($var, -$i, 4);
|
||||||
switch ($temp) {
|
switch ($temp) {
|
||||||
|
Loading…
Reference in New Issue
Block a user