| 85 | } |
| 86 | |
| 87 | void OFB_ModePolicy::WriteKeystream(byte *keystreamBuffer, size_t iterationCount) |
| 88 | { |
| 89 | CRYPTOPP_ASSERT(m_cipher->IsForwardTransformation()); // OFB mode needs the "encrypt" direction of the underlying block cipher, even to decrypt |
| 90 | unsigned int s = BlockSize(); |
| 91 | m_cipher->ProcessBlock(m_register, keystreamBuffer); |
| 92 | if (iterationCount > 1) |
| 93 | m_cipher->AdvancedProcessBlocks(keystreamBuffer, NULL, keystreamBuffer+s, s*(iterationCount-1), 0); |
| 94 | memcpy(m_register, keystreamBuffer+s*(iterationCount-1), s); |
| 95 | } |
| 96 | |
| 97 | void OFB_ModePolicy::CipherResynchronize(byte *keystreamBuffer, const byte *iv, size_t length) |
| 98 | { |
no test coverage detected