/** * @dataProvider provideTestEncryptVectors * @group Vectors */ public function testDecrypt($cipher, $key, $expected, $data) { $cipher = new \CryptLib\Cipher\Block\Cipher\Rijndael($cipher); $cipher->setKey(pack('H*', $key)); $enc = $cipher->decryptBlock(pack('H*', $data)); $this->assertEquals($expected, strtoupper(bin2hex($enc))); }
/** * @expectedException InvalidArgumentException */ public function testSetKeyInvalidSize() { $cipher = new \CryptLib\Cipher\Block\Cipher\Rijndael('rijndael-128'); $cipher->setKey(str_repeat(chr(0), 66)); }