[ Index ]

PHP Cross Reference of DokuWiki




/vendor/phpseclib/phpseclib/phpseclib/Crypt/ -> Twofish.php (summary)

Pure-PHP implementation of Twofish. Uses mcrypt, if available, and an internal implementation, otherwise.

Author: Jim Wigginton
Author: Hans-Juergen Petrich
Copyright: 2007 Jim Wigginton
License: http://www.opensource.org/licenses/mit-license.html MIT License
Link: http://phpseclib.sourceforge.net
File Size: 852 lines (39 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

Twofish:: (7 methods):

Class: Twofish  - X-Ref

Pure-PHP implementation of Twofish.

__construct($mode = self::MODE_CBC)   X-Ref
Default Constructor.

Determines whether or not the mcrypt extension should be used.

$mode could be:






(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

setKeyLength($length)   X-Ref
Sets the key length.

Valid key lengths are 128, 192 or 256 bits

param: int $length

_setupKey()   X-Ref
Setup the key (expansion)

see: \phpseclib\Crypt\Base::_setupKey()

_mdsrem($A, $B)   X-Ref
_mdsrem function using by the twofish cipher algorithm

return: array
param: string $A
param: string $B

_encryptBlock($in)   X-Ref
Encrypts a block

return: string
param: string $in

_decryptBlock($in)   X-Ref
Decrypts a block

return: string
param: string $in

_setupInlineCrypt()   X-Ref
Setup the performance-optimized function for de/encrypt()

see: \phpseclib\Crypt\Base::_setupInlineCrypt()