comparison libtommath/bn_mp_error_to_string.c @ 1739:13d834efc376 fuzz

merge from main
author Matt Johnston <matt@ucc.asn.au>
date Thu, 15 Oct 2020 19:55:15 +0800
parents 1051e4eea25a
children
comparison
equal deleted inserted replaced
1562:768ebf737aa0 1739:13d834efc376
1 #include "tommath_private.h"
2 #ifdef BN_MP_ERROR_TO_STRING_C
3 /* LibTomMath, multiple-precision integer library -- Tom St Denis */
4 /* SPDX-License-Identifier: Unlicense */
5
6 /* return a char * string for a given code */
7 const char *mp_error_to_string(mp_err code)
8 {
9 switch (code) {
10 case MP_OKAY:
11 return "Successful";
12 case MP_ERR:
13 return "Unknown error";
14 case MP_MEM:
15 return "Out of heap";
16 case MP_VAL:
17 return "Value out of range";
18 case MP_ITER:
19 return "Max. iterations reached";
20 case MP_BUF:
21 return "Buffer overflow";
22 default:
23 return "Invalid error code";
24 }
25 }
26
27 #endif