public function testGetBlockCipherObject() { $factory = new Factory(); $des = new \CryptLib\Cipher\Block\Cipher\DES('des'); $actual = $factory->getBlockCipher($des); $this->assertEquals($des, $actual); }
/** * Build a new instance of the DES mixing function * * @param Factory $factory The optional encryption factory to use * * @return void */ public function __construct(\CryptLib\Cipher\Factory $factory = null) { if (is_null($factory)) { $factory = new CipherFactory(); } $this->cipher = $factory->getBlockCipher($this->cipher); }