示例#1
0
 public function testGFSBox256()
 {
     $aes = new AES();
     $aes->setKey(pack('H*', '00000000000000000000000000000000' . '00000000000000000000000000000000'));
     $aes->setIV(pack('H*', '00000000000000000000000000000000'));
     $aes->disablePadding();
     $aes->setPreferredEngine($this->engine);
     $this->_checkEngine($aes);
     $result = bin2hex($aes->encrypt(pack('H*', '014730f80ac625fe84f026c60bfd547d')));
     $this->assertSame($result, '5c9d844ed46f9885085e5d6a4f94c7d7');
     $result = bin2hex($aes->encrypt(pack('H*', '0b24af36193ce4665f2825d7b4749c98')));
     $this->assertSame($result, 'a9ff75bd7cf6613d3731c77c3b6d0c04');
     $result = bin2hex($aes->encrypt(pack('H*', '761c1fe41a18acf20d241650611d90f1')));
     $this->assertSame($result, '623a52fcea5d443e48d9181ab32c7421');
     $result = bin2hex($aes->encrypt(pack('H*', '8a560769d605868ad80d819bdba03771')));
     $this->assertSame($result, '38f2c7ae10612415d27ca190d27da8b4');
     $result = bin2hex($aes->encrypt(pack('H*', '91fbef2d15a97816060bee1feaa49afe')));
     $this->assertSame($result, '1bc704f1bce135ceb810341b216d7abe');
 }