MCPcopy Create free account
hub / github.com/c3d/tao3D / AdvancedProcessBlocks

Method AdvancedProcessBlocks

libcryptopp/cryptopp/cryptlib.cpp:141–177  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

139}
140
141size_t BlockTransformation::AdvancedProcessBlocks(const byte *inBlocks, const byte *xorBlocks, byte *outBlocks, size_t length, word32 flags) const
142{
143 size_t blockSize = BlockSize();
144 size_t inIncrement = (flags & (BT_InBlockIsCounter|BT_DontIncrementInOutPointers)) ? 0 : blockSize;
145 size_t xorIncrement = xorBlocks ? blockSize : 0;
146 size_t outIncrement = (flags & BT_DontIncrementInOutPointers) ? 0 : blockSize;
147
148 if (flags & BT_ReverseDirection)
149 {
150 assert(length % blockSize == 0);
151 inBlocks += length - blockSize;
152 xorBlocks += length - blockSize;
153 outBlocks += length - blockSize;
154 inIncrement = 0-inIncrement;
155 xorIncrement = 0-xorIncrement;
156 outIncrement = 0-outIncrement;
157 }
158
159 while (length >= blockSize)
160 {
161 if (flags & BT_XorInput)
162 {
163 xorbuf(outBlocks, xorBlocks, inBlocks, blockSize);
164 ProcessBlock(outBlocks);
165 }
166 else
167 ProcessAndXorBlock(inBlocks, xorBlocks, outBlocks);
168 if (flags & BT_InBlockIsCounter)
169 const_cast<byte *>(inBlocks)[blockSize-1]++;
170 inBlocks += inIncrement;
171 outBlocks += outIncrement;
172 xorBlocks += xorIncrement;
173 length -= blockSize;
174 }
175
176 return length;
177}
178
179unsigned int BlockTransformation::OptimalDataAlignment() const
180{

Callers 9

IterateMethod · 0.80
WriteKeystreamMethod · 0.80
OperateKeystreamMethod · 0.80
ProcessDataMethod · 0.80
AuthenticateBlocksMethod · 0.80
UpdateMethod · 0.80
TruncatedFinalMethod · 0.80
UpdateMethod · 0.80
UncheckedSetKeyMethod · 0.80

Calls 3

xorbufFunction · 0.85
ProcessBlockFunction · 0.85
BlockSizeFunction · 0.70

Tested by

no test coverage detected