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

Method SpecifyDataLengths

libcryptopp/cryptopp/cryptlib.cpp:204–216  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

202}
203
204void AuthenticatedSymmetricCipher::SpecifyDataLengths(lword headerLength, lword messageLength, lword footerLength)
205{
206 if (headerLength > MaxHeaderLength())
207 throw InvalidArgument(GetAlgorithm().AlgorithmName() + ": header length " + IntToString(headerLength) + " exceeds the maximum of " + IntToString(MaxHeaderLength()));
208
209 if (messageLength > MaxMessageLength())
210 throw InvalidArgument(GetAlgorithm().AlgorithmName() + ": message length " + IntToString(messageLength) + " exceeds the maximum of " + IntToString(MaxMessageLength()));
211
212 if (footerLength > MaxFooterLength())
213 throw InvalidArgument(GetAlgorithm().AlgorithmName() + ": footer length " + IntToString(footerLength) + " exceeds the maximum of " + IntToString(MaxFooterLength()));
214
215 UncheckedSpecifyDataLengths(headerLength, messageLength, footerLength);
216}
217
218void AuthenticatedSymmetricCipher::EncryptAndAuthenticate(byte *ciphertext, byte *mac, size_t macSize, const byte *iv, int ivLength, const byte *header, size_t headerLength, const byte *message, size_t messageLength)
219{

Callers 2

BenchMarkFunction · 0.80

Calls 6

IntToStringFunction · 0.85
MaxFooterLengthFunction · 0.85
MaxHeaderLengthFunction · 0.70
MaxMessageLengthFunction · 0.70
AlgorithmNameMethod · 0.45

Tested by 1