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

Method ThrowIfInvalidIVLength

src/cryptopp/cryptlib.cpp:131–141  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

129}
130
131size_t SimpleKeyingInterface::ThrowIfInvalidIVLength(int size)
132{
133 if (size < 0)
134 return (size_t)IVSize();
135 else if ((size_t)size < MinIVLength())
136 throw InvalidArgument(GetAlgorithm().AlgorithmName() + ": IV length " + IntToString(size) + " is less than the minimum of " + IntToString(MinIVLength()));
137 else if ((size_t)size > MaxIVLength())
138 throw InvalidArgument(GetAlgorithm().AlgorithmName() + ": IV length " + IntToString(size) + " exceeds the maximum of " + IntToString(MaxIVLength()));
139 else
140 return (size_t)size;
141}
142
143const byte * SimpleKeyingInterface::GetIVAndThrowIfInvalid(const NameValuePairs &params, size_t &size)
144{

Callers 2

ResynchronizeMethod · 0.80
ResynchronizeMethod · 0.80

Calls 5

IntToStringFunction · 0.85
IVSizeFunction · 0.70
MinIVLengthFunction · 0.70
MaxIVLengthFunction · 0.70
AlgorithmNameMethod · 0.45

Tested by

no test coverage detected