1 /* Future releases will make use of this */
4 static const char *err_2_str[] =
8 "Non-fatal 'no-operation' requested.",
10 "Invalid keysize for block cipher.",
11 "Invalid number of rounds for block cipher.",
12 "Algorithm failed test vectors.",
15 "Invalid input packet.",
17 "Invalid number of bits for a PRNG.",
18 "Error reading the PRNG.",
20 "Invalid cipher specified.",
21 "Invalid hash specified.",
22 "Invalid PRNG specified.",
26 "Invalid PK key or key type specified for function.",
27 "A private PK key is required.",
29 "Invalid argument provided.",
33 "Duplicate PK key found on keyring.",
34 "Key not found in keyring.",
35 "Invalid sized parameter.",
37 "Invalid size for prime."
40 const char *error_to_string(int err)
42 if (err < 0 || err >= (int)(sizeof(err_2_str)/sizeof(err_2_str[0]))) {
43 return "Invalid error code.";
45 return err_2_str[err];