comparison libtommath/bn_mp_error_to_string.c @ 1692:1051e4eea25a

Update LibTomMath to 1.2.0 (#84) * update C files * update other files * update headers * update makefiles * remove mp_set/get_double() * use ltm 1.2.0 API * update ltm_desc * use bundled tommath if system-tommath is too old * XMALLOC etc. were changed to MP_MALLOC etc.
author Steffen Jaeckel <s@jaeckel.eu>
date Tue, 26 May 2020 17:36:47 +0200
parents
children
comparison
equal deleted inserted replaced
1691:2d3745d58843 1692:1051e4eea25a
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