aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/phpseclib/phpseclib/phpseclib/Crypt/Twofish.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/phpseclib/phpseclib/phpseclib/Crypt/Twofish.php')
-rw-r--r--vendor/phpseclib/phpseclib/phpseclib/Crypt/Twofish.php36
1 files changed, 36 insertions, 0 deletions
diff --git a/vendor/phpseclib/phpseclib/phpseclib/Crypt/Twofish.php b/vendor/phpseclib/phpseclib/phpseclib/Crypt/Twofish.php
index 70980a2ff..1c020481a 100644
--- a/vendor/phpseclib/phpseclib/phpseclib/Crypt/Twofish.php
+++ b/vendor/phpseclib/phpseclib/phpseclib/Crypt/Twofish.php
@@ -369,6 +369,42 @@ class Twofish extends Base
var $key_length = 16;
/**
+ * Default Constructor.
+ *
+ * Determines whether or not the mcrypt extension should be used.
+ *
+ * $mode could be:
+ *
+ * - CRYPT_MODE_ECB
+ *
+ * - CRYPT_MODE_CBC
+ *
+ * - CRYPT_MODE_CTR
+ *
+ * - CRYPT_MODE_CFB
+ *
+ * - CRYPT_MODE_OFB
+ *
+ * (or the alias constants of the chosen cipher, for example for AES: CRYPT_AES_MODE_ECB or CRYPT_AES_MODE_CBC ...)
+ *
+ * If not explicitly set, CRYPT_MODE_CBC will be used.
+ *
+ * @param int $mode
+ * @access public
+ */
+ function __construct($mode = self::MODE_CBC)
+ {
+ parent::__construct($mode);
+
+ $this->m0 = array_map('intval', $this->m0);
+ $this->m1 = array_map('intval', $this->m1);
+ $this->m2 = array_map('intval', $this->m2);
+ $this->m3 = array_map('intval', $this->m3);
+ $this->q0 = array_map('intval', $this->q0);
+ $this->q1 = array_map('intval', $this->q1);
+ }
+
+ /**
* Sets the key length.
*
* Valid key lengths are 128, 192 or 256 bits