mirror of
https://github.com/danog/tgseclib.git
synced 2024-11-27 12:44:38 +01:00
Twofish: make CS more consistent
This commit is contained in:
parent
d396b0c503
commit
c89db52e39
@ -17,13 +17,13 @@
|
|||||||
* <?php
|
* <?php
|
||||||
* include('Crypt/Blowfish.php');
|
* include('Crypt/Blowfish.php');
|
||||||
*
|
*
|
||||||
* $Blowfish = new Crypt_Blowfish();
|
* $blowfish = new Crypt_Blowfish();
|
||||||
*
|
*
|
||||||
* $Blowfish->setKey('12345678901234567890123456789012');
|
* $blowfish->setKey('12345678901234567890123456789012');
|
||||||
*
|
*
|
||||||
* $plaintext = str_repeat('a', 1024);
|
* $plaintext = str_repeat('a', 1024);
|
||||||
*
|
*
|
||||||
* echo $Blowfish->decrypt($Blowfish->encrypt($plaintext));
|
* echo $blowfish->decrypt($blowfish->encrypt($plaintext));
|
||||||
* ?>
|
* ?>
|
||||||
* </code>
|
* </code>
|
||||||
*
|
*
|
||||||
@ -436,7 +436,8 @@ class Crypt_Blowfish {
|
|||||||
0x90d4f869, 0xa65cdea0, 0x3f09252d, 0xc208e69f, 0xb74e6132, 0xce77e25b, 0x578fdfe3, 0x3ac372e6
|
0x90d4f869, 0xa65cdea0, 0x3f09252d, 0xc208e69f, 0xb74e6132, 0xce77e25b, 0x578fdfe3, 0x3ac372e6
|
||||||
);
|
);
|
||||||
|
|
||||||
/** P-Array consists of 18 32-bit subkeys
|
/**
|
||||||
|
* P-Array consists of 18 32-bit subkeys
|
||||||
*
|
*
|
||||||
* @var array $parray
|
* @var array $parray
|
||||||
* @access private
|
* @access private
|
||||||
@ -447,7 +448,10 @@ class Crypt_Blowfish {
|
|||||||
0xc0ac29b7, 0xc97c50dd, 0x3f84d5b5, 0xb5470917, 0x9216d5d9, 0x8979fb1b
|
0xc0ac29b7, 0xc97c50dd, 0x3f84d5b5, 0xb5470917, 0x9216d5d9, 0x8979fb1b
|
||||||
);
|
);
|
||||||
|
|
||||||
/** The BCTX-working Array, holds the expanded key [p] and the key-depended s-boxes [sb]
|
/**
|
||||||
|
* The BCTX-working Array
|
||||||
|
*
|
||||||
|
* Holds the expanded key [p] and the key-depended s-boxes [sb]
|
||||||
*
|
*
|
||||||
* @var array $bctx
|
* @var array $bctx
|
||||||
* @access private
|
* @access private
|
||||||
@ -598,7 +602,8 @@ class Crypt_Blowfish {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** This functions encrypt the block.
|
/**
|
||||||
|
* Encrypt the block.
|
||||||
*
|
*
|
||||||
* @access private
|
* @access private
|
||||||
* @param int $Xl left uInt32 part of the block
|
* @param int $Xl left uInt32 part of the block
|
||||||
|
Loading…
Reference in New Issue
Block a user