From 1ba024df94e920bd8f1bd9b945a6fdfdedce8cd4 Mon Sep 17 00:00:00 2001 From: terrafrost Date: Thu, 17 Feb 2022 22:50:56 -0600 Subject: [PATCH] Crypt/Base: use sodium_increment in _increment_str --- phpseclib/Crypt/Base.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/phpseclib/Crypt/Base.php b/phpseclib/Crypt/Base.php index 287b9fc9..aca2554d 100644 --- a/phpseclib/Crypt/Base.php +++ b/phpseclib/Crypt/Base.php @@ -2007,6 +2007,11 @@ class Crypt_Base */ function _increment_str(&$var) { + if (function_exists('sodium_increment')) { + sodium_increment($var); + return; + } + for ($i = 4; $i <= strlen($var); $i+= 4) { $temp = substr($var, -$i, 4); switch ($temp) {