Lines Matching refs:block_size

231     protected $block_size = 16;  variable in phpseclib3\\Crypt\\Common\\SymmetricKey
688 if ($this->block_size != 16) {
729 if (strlen($iv) != $this->block_size) {
730 …initialization vector of size ' . strlen($iv) . ', but size ' . $this->block_size . ' is required'…
862 return $this->block_size << 3;
873 return $this->block_size;
1023 … $this->setIV(self::pkcs12helper($this->block_size, $hashObj, $i, $d2, $count));
1189 $this->encryptIV = substr($result, -$this->block_size);
1209 $max = $this->block_size - $pos;
1225 $overflow = $len % $this->block_size;
1228 …sl_encrypt(substr($plaintext, 0, -$overflow) . str_repeat("\0", $this->block_size), $this->cipher_…
1229 $iv = Strings::pop($ciphertext, $this->block_size);
1238 $iv = substr($ciphertext, -$this->block_size);
1245 if (($len = strlen($ciphertext)) >= $this->block_size) {
1246 $this->encryptIV = substr($ciphertext, -$this->block_size);
1248 …$this->encryptIV = substr($this->encryptIV, $len - $this->block_size) . substr($ciphertext, -$len);
1284 $block_size = $this->block_size;
1292 $max = $block_size - $pos;
1306 if ($len >= $block_size) {
1312 … $ciphertext .= mcrypt_generic($this->enmcrypt, substr($plaintext, $i, $len - $len % $block_size));
1313 $iv = substr($ciphertext, -$block_size);
1314 $len %= $block_size;
1316 while ($len >= $block_size) {
1317 … $iv = mcrypt_generic($this->ecb, $iv) ^ substr($plaintext, $i, $block_size);
1319 $len -= $block_size;
1320 $i += $block_size;
1355 $block_size = $this->block_size;
1359 for ($i = 0; $i < strlen($plaintext); $i += $block_size) {
1360 $ciphertext .= $this->encryptBlock(substr($plaintext, $i, $block_size));
1365 for ($i = 0; $i < strlen($plaintext); $i += $block_size) {
1366 $block = substr($plaintext, $i, $block_size);
1378 for ($i = 0; $i < strlen($plaintext); $i += $block_size) {
1379 $block = substr($plaintext, $i, $block_size);
1384 $key = Strings::shift($buffer['ciphertext'], $block_size);
1388 for ($i = 0; $i < strlen($plaintext); $i += $block_size) {
1389 $block = substr($plaintext, $i, $block_size);
1397 if ($start = strlen($plaintext) % $block_size) {
1416 $max = $block_size - $pos;
1430 while ($len >= $block_size) {
1431 $iv = $this->encryptBlock($iv) ^ substr($plaintext, $i, $block_size);
1433 $len -= $block_size;
1434 $i += $block_size;
1455 if ($len >= $block_size) {
1456 $this->encryptIV = substr($ciphertext, -$block_size);
1458 … $this->encryptIV = substr($this->encryptIV, $len - $block_size) . substr($ciphertext, -$len);
1480 for ($i = 0; $i < strlen($plaintext); $i += $block_size) {
1481 $block = substr($plaintext, $i, $block_size);
1486 $key = Strings::shift($buffer['xor'], $block_size);
1490 for ($i = 0; $i < strlen($plaintext); $i += $block_size) {
1492 $ciphertext .= substr($plaintext, $i, $block_size) ^ $xor;
1498 if ($start = strlen($plaintext) % $block_size) {
1527 if ($this->paddable && strlen($ciphertext) % $this->block_size) {
1528 … . strlen($ciphertext) . ') needs to be a multiple of the block size (' . $this->block_size . ')');
1577 $offset = $this->block_size;
1580 $this->decryptIV = substr($ciphertext, -$offset, $this->block_size);
1601 $max = $this->block_size - $pos;
1616 $overflow = $len % $this->block_size;
1620 $iv = substr($ciphertext, -$overflow - $this->block_size, -$overflow);
1622 …$iv = openssl_encrypt(str_repeat("\0", $this->block_size), $this->cipher_name_openssl, $this->key,…
1628 $iv = substr($ciphertext, -$this->block_size);
1634 if (($len = strlen($ciphertext)) >= $this->block_size) {
1635 $this->decryptIV = substr($ciphertext, -$this->block_size);
1637 …$this->decryptIV = substr($this->decryptIV, $len - $this->block_size) . substr($ciphertext, -$len);
1666 $block_size = $this->block_size;
1680 $max = $block_size - $pos;
1694 if ($len >= $block_size) {
1695 $cb = substr($ciphertext, $i, $len - $len % $block_size);
1697 $iv = substr($cb, -$block_size);
1698 $len %= $block_size;
1728 $block_size = $this->block_size;
1734 for ($i = 0; $i < strlen($ciphertext); $i += $block_size) {
1735 $plaintext .= $this->decryptBlock(substr($ciphertext, $i, $block_size));
1740 for ($i = 0; $i < strlen($ciphertext); $i += $block_size) {
1741 $block = substr($ciphertext, $i, $block_size);
1752 for ($i = 0; $i < strlen($ciphertext); $i += $block_size) {
1753 $block = substr($ciphertext, $i, $block_size);
1758 $key = Strings::shift($buffer['ciphertext'], $block_size);
1762 for ($i = 0; $i < strlen($ciphertext); $i += $block_size) {
1763 $block = substr($ciphertext, $i, $block_size);
1771 if ($start = strlen($ciphertext) % $block_size) {
1788 $max = $block_size - $pos;
1802 while ($len >= $block_size) {
1804 $cb = substr($ciphertext, $i, $block_size);
1807 $len -= $block_size;
1808 $i += $block_size;
1828 if ($len >= $block_size) {
1829 $this->decryptIV = substr($ciphertext, -$block_size);
1831 … $this->decryptIV = substr($this->decryptIV, $len - $block_size) . substr($ciphertext, -$len);
1853 for ($i = 0; $i < strlen($ciphertext); $i += $block_size) {
1854 $block = substr($ciphertext, $i, $block_size);
1859 $key = Strings::shift($buffer['xor'], $block_size);
1863 for ($i = 0; $i < strlen($ciphertext); $i += $block_size) {
1865 $plaintext .= substr($ciphertext, $i, $block_size) ^ $xor;
1871 if ($start = strlen($ciphertext) % $block_size) {
1960 return $this->mode == self::MODE_ECB ? str_repeat("\0", $this->block_size) : $iv;
1983 $block_size = $this->block_size;
1989 for ($i = 0; $i < strlen($plaintext); $i += $block_size) {
1990 $block = substr($plaintext, $i, $block_size);
1995 $otp = Strings::shift($buffer['ciphertext'], $block_size);
1999 for ($i = 0; $i < strlen($plaintext); $i += $block_size) {
2000 $block = substr($plaintext, $i, $block_size);
2008 if ($start = strlen($plaintext) % $block_size) {
2025 $overflow = strlen($plaintext) % $block_size;
2028 …$encrypted = openssl_encrypt($plaintext . str_repeat("\0", $block_size), $this->cipher_name_openss…
2029 $temp = Strings::pop($encrypted, $block_size);
2036 …$ciphertext .= openssl_encrypt($plaintext . str_repeat("\0", $block_size), $this->cipher_name_open…
2037 $temp = Strings::pop($ciphertext, $block_size);
2077 $block_size = $this->block_size;
2081 $overflow = $len % $block_size;
2085 … openssl_encrypt(substr($plaintext, 0, -$overflow) . str_repeat("\0", $block_size), $this->cipher_…
2086 $xor = Strings::pop($ciphertext, $block_size);
2097 … $encryptIV = substr($ciphertext, -$block_size) ^ substr($plaintext, -$block_size);
2542 … mcrypt_generic_init($this->ecb, $this->key, str_repeat("\0", $this->block_size));
2582 if ($length % $this->block_size == 0) {
2585 …intext's length ($length) is not a multiple of the block size ({$this->block_size}). Try enabling …
2589 $pad = $this->block_size - ($length % $this->block_size);
2614 if (!$length || $length > $this->block_size) {
2615 …hertext has an invalid padding length ($length) compared to the block size ({$this->block_size})");
2794 $block_size = $this->block_size;
2813 for ($_i = 0; $_i < $_plaintext_len; $_i+= ' . $block_size . ') {
2814 $in = substr($_text, $_i, ' . $block_size . ');
2824 … str_pad($_text, strlen($_text) + (' . $block_size . ' - strlen($_text) % ' . $block_size . ') % '…
2827 for ($_i = 0; $_i < $_ciphertext_len; $_i+= ' . $block_size . ') {
2828 $in = substr($_text, $_i, ' . $block_size . ');
2843 for ($_i = 0; $_i < $_plaintext_len; $_i+= ' . $block_size . ') {
2844 $_block = substr($_text, $_i, ' . $block_size . ');
2851 … $_key = \phpseclib3\Common\Functions\Strings::shift($_buffer["ciphertext"], ' . $block_size . ');
2855 for ($_i = 0; $_i < $_plaintext_len; $_i+= ' . $block_size . ') {
2856 $_block = substr($_text, $_i, ' . $block_size . ');
2866 if ($_start = $_plaintext_len % ' . $block_size . ') {
2881 for ($_i = 0; $_i < $_ciphertext_len; $_i+= ' . $block_size . ') {
2882 $_block = substr($_text, $_i, ' . $block_size . ');
2889 … $_key = \phpseclib3\Common\Functions\Strings::shift($_buffer["ciphertext"], ' . $block_size . ');
2893 for ($_i = 0; $_i < $_ciphertext_len; $_i+= ' . $block_size . ') {
2894 $_block = substr($_text, $_i, ' . $block_size . ');
2904 if ($_start = $_ciphertext_len % ' . $block_size . ') {
2928 $_max = ' . $block_size . ' - $_pos;
2941 while ($_len >= ' . $block_size . ') {
2944 $_iv = $in ^ substr($_text, $_i, ' . $block_size . ');
2946 $_len-= ' . $block_size . ';
2947 $_i+= ' . $block_size . ';
2976 $_max = ' . $block_size . ' - $_pos;
2989 while ($_len >= ' . $block_size . ') {
2993 $cb = substr($_text, $_i, ' . $block_size . ');
2996 $_len-= ' . $block_size . ';
2997 $_i+= ' . $block_size . ';
3025 if ($_len >= ' . $block_size . ') {
3026 $this->encryptIV = substr($_ciphertext, -' . $block_size . ');
3028 …$this->encryptIV = substr($this->encryptIV, $_len - ' . $block_size . ') . substr($_ciphertext, -$…
3047 if ($_len >= ' . $block_size . ') {
3048 $this->decryptIV = substr($_text, -' . $block_size . ');
3050 … $this->decryptIV = substr($this->decryptIV, $_len - ' . $block_size . ') . substr($_text, -$_len);
3103 for ($_i = 0; $_i < $_plaintext_len; $_i+= ' . $block_size . ') {
3104 $_block = substr($_text, $_i, ' . $block_size . ');
3111 … $_key = \phpseclib3\Common\Functions\Strings::shift($_buffer["xor"], ' . $block_size . ');
3115 for ($_i = 0; $_i < $_plaintext_len; $_i+= ' . $block_size . ') {
3119 $_ciphertext.= substr($_text, $_i, ' . $block_size . ') ^ $_xor;
3125 if ($_start = $_plaintext_len % ' . $block_size . ') {
3139 for ($_i = 0; $_i < $_ciphertext_len; $_i+= ' . $block_size . ') {
3140 $_block = substr($_text, $_i, ' . $block_size . ');
3147 … $_key = \phpseclib3\Common\Functions\Strings::shift($_buffer["xor"], ' . $block_size . ');
3151 for ($_i = 0; $_i < $_ciphertext_len; $_i+= ' . $block_size . ') {
3155 $_plaintext.= substr($_text, $_i, ' . $block_size . ') ^ $_xor;
3161 if ($_start = $_ciphertext_len % ' . $block_size . ') {
3188 for ($_i = 0; $_i < $_plaintext_len; $_i+= ' . $block_size . ') {
3189 $in = substr($_text, $_i, ' . $block_size . ') ^ $in;
3203 … str_pad($_text, strlen($_text) + (' . $block_size . ' - strlen($_text) % ' . $block_size . ') % '…
3208 for ($_i = 0; $_i < $_ciphertext_len; $_i+= ' . $block_size . ') {
3209 $in = $_block = substr($_text, $_i, ' . $block_size . ');