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

Method SpecifyDataLengths

src/cryptopp/cryptlib.cpp:254–266  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

252}
253
254void AuthenticatedSymmetricCipher::SpecifyDataLengths(lword headerLength, lword messageLength, lword footerLength)
255{
256 if (headerLength > MaxHeaderLength())
257 throw InvalidArgument(GetAlgorithm().AlgorithmName() + ": header length " + IntToString(headerLength) + " exceeds the maximum of " + IntToString(MaxHeaderLength()));
258
259 if (messageLength > MaxMessageLength())
260 throw InvalidArgument(GetAlgorithm().AlgorithmName() + ": message length " + IntToString(messageLength) + " exceeds the maximum of " + IntToString(MaxMessageLength()));
261
262 if (footerLength > MaxFooterLength())
263 throw InvalidArgument(GetAlgorithm().AlgorithmName() + ": footer length " + IntToString(footerLength) + " exceeds the maximum of " + IntToString(MaxFooterLength()));
264
265 UncheckedSpecifyDataLengths(headerLength, messageLength, footerLength);
266}
267
268void 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)
269{

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