| 129 | } |
| 130 | |
| 131 | size_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 | |
| 143 | const byte * SimpleKeyingInterface::GetIVAndThrowIfInvalid(const NameValuePairs ¶ms, size_t &size) |
| 144 | { |
no test coverage detected