MCPcopy Create free account
hub / github.com/LUX-Core/lux / WriteKeystream

Method WriteKeystream

src/cryptopp/modes.cpp:87–95  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

85}
86
87void 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
97void OFB_ModePolicy::CipherResynchronize(byte *keystreamBuffer, const byte *iv, size_t length)
98{

Callers 3

GenerateBlockMethod · 0.80
ProcessDataMethod · 0.80
SeekMethod · 0.80

Calls 5

memcpyFunction · 0.85
ProcessBlockMethod · 0.80
AdvancedProcessBlocksMethod · 0.80
BlockSizeFunction · 0.70

Tested by

no test coverage detected