1 /* $NetBSD: bn_error.c,v 1.1.1.2 2014/04/24 12:45:30 pettai Exp $ */
5 /* LibTomMath, multiple-precision integer library -- Tom St Denis
7 * LibTomMath is a library that provides multiple-precision
8 * integer arithmetic as well as number theoretic functionality.
10 * The library was designed directly after the MPI library by
11 * Michael Fromberger but has been written from scratch with
12 * additional optimizations in place.
14 * The library is free for all purposes without any express
17 * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
24 { MP_OKAY
, "Successful" },
25 { MP_MEM
, "Out of heap" },
26 { MP_VAL
, "Value out of range" }
29 /* return a char * string for a given code */
30 char *mp_error_to_string(int code
)
34 /* scan the lookup table for the given message */
35 for (x
= 0; x
< (int)(sizeof(msgs
) / sizeof(msgs
[0])); x
++) {
36 if (msgs
[x
].code
== code
) {
41 /* generic reply for invalid code */
42 return "Invalid error code";
47 /* Source: /cvs/libtom/libtommath/bn_error.c,v */
49 /* Date: 2006/12/28 01:25:13 */