41 static const std::string
GetErrorReason(
const enum CryptoPP::Exception::ErrorType error_type) {
42 using ErrorType = CryptoPP::Exception::ErrorType;
43#define CASE_RETURN(c, ret) \
48 CASE_RETURN(ErrorType::INVALID_ARGUMENT,
"An invalid argument was detected");
49 CASE_RETURN(ErrorType::CANNOT_FLUSH,
"BufferedTransformation received a Flush(true) signal but can't flush buffers");
50 CASE_RETURN(ErrorType::DATA_INTEGRITY_CHECK_FAILED,
"Data integerity check, such as CRC or MAC, failed");
51 CASE_RETURN(ErrorType::INVALID_DATA_FORMAT,
"Input data was received that did not conform to expected format");
52 CASE_RETURN(ErrorType::IO_ERROR,
"Error reading from input device or writing to output device");
54 return "<unknown crypto++ error>";