Remove building with NOCRYPTO option
[minix.git] / crypto / external / bsd / heimdal / dist / lib / hcrypto / libtommath / bn_error.c
blob2301286aec33d5be8169d08e1b4434f183bdd9d3
1 /* $NetBSD: bn_error.c,v 1.1.1.2 2014/04/24 12:45:30 pettai Exp $ */
3 #include <tommath.h>
4 #ifdef BN_ERROR_C
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
15 * guarantee it works.
17 * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
20 static const struct {
21 int code;
22 char *msg;
23 } msgs[] = {
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)
32 int x;
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) {
37 return msgs[x].msg;
41 /* generic reply for invalid code */
42 return "Invalid error code";
45 #endif
47 /* Source: /cvs/libtom/libtommath/bn_error.c,v */
48 /* Revision: 1.4 */
49 /* Date: 2006/12/28 01:25:13 */