/** * @dataProvider continuousBufferBatteryCombos */ public function testContinuousBufferBattery($op, $mode, $test) { $iv = str_repeat('x', 16); $key = str_repeat('a', 16); $aes = new AES($mode); $aes->setPreferredEngine($this->engine); $aes->setKey($key); $aes->setIV($iv); $this->_checkEngine($aes); $str = ''; $result = ''; foreach ($test as $len) { $temp = str_repeat('d', $len); $str .= $temp; } $c1 = $aes->{$op}($str); $aes = new AES($mode); $aes->setPreferredEngine($this->engine); $aes->enableContinuousBuffer(); $aes->setKey($key); $aes->setIV($iv); if (!$this->_checkEngine($aes)) { return; } foreach ($test as $len) { $temp = str_repeat('d', $len); $output = $aes->{$op}($temp); $result .= $output; } $c2 = $result; $this->assertSame(bin2hex($c1), bin2hex($c2)); }