diff options
Diffstat (limited to 'src/lib/libcrypto/bn/bn_err.c')
-rw-r--r-- | src/lib/libcrypto/bn/bn_err.c | 92 |
1 files changed, 50 insertions, 42 deletions
diff --git a/src/lib/libcrypto/bn/bn_err.c b/src/lib/libcrypto/bn/bn_err.c index fb84ee96d8..5dfac00c88 100644 --- a/src/lib/libcrypto/bn/bn_err.c +++ b/src/lib/libcrypto/bn/bn_err.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* crypto/bn/bn_err.c */ | 1 | /* crypto/bn/bn_err.c */ |
2 | /* ==================================================================== | 2 | /* ==================================================================== |
3 | * Copyright (c) 1999 The OpenSSL Project. All rights reserved. | 3 | * Copyright (c) 1999-2005 The OpenSSL Project. All rights reserved. |
4 | * | 4 | * |
5 | * Redistribution and use in source and binary forms, with or without | 5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions | 6 | * modification, are permitted provided that the following conditions |
@@ -64,52 +64,60 @@ | |||
64 | 64 | ||
65 | /* BEGIN ERROR CODES */ | 65 | /* BEGIN ERROR CODES */ |
66 | #ifndef OPENSSL_NO_ERR | 66 | #ifndef OPENSSL_NO_ERR |
67 | |||
68 | #define ERR_FUNC(func) ERR_PACK(ERR_LIB_BN,func,0) | ||
69 | #define ERR_REASON(reason) ERR_PACK(ERR_LIB_BN,0,reason) | ||
70 | |||
67 | static ERR_STRING_DATA BN_str_functs[]= | 71 | static ERR_STRING_DATA BN_str_functs[]= |
68 | { | 72 | { |
69 | {ERR_PACK(0,BN_F_BN_BLINDING_CONVERT,0), "BN_BLINDING_convert"}, | 73 | {ERR_FUNC(BN_F_BN_BLINDING_CONVERT), "BN_BLINDING_convert"}, |
70 | {ERR_PACK(0,BN_F_BN_BLINDING_INVERT,0), "BN_BLINDING_invert"}, | 74 | {ERR_FUNC(BN_F_BN_BLINDING_INVERT), "BN_BLINDING_invert"}, |
71 | {ERR_PACK(0,BN_F_BN_BLINDING_NEW,0), "BN_BLINDING_new"}, | 75 | {ERR_FUNC(BN_F_BN_BLINDING_NEW), "BN_BLINDING_new"}, |
72 | {ERR_PACK(0,BN_F_BN_BLINDING_UPDATE,0), "BN_BLINDING_update"}, | 76 | {ERR_FUNC(BN_F_BN_BLINDING_UPDATE), "BN_BLINDING_update"}, |
73 | {ERR_PACK(0,BN_F_BN_BN2DEC,0), "BN_bn2dec"}, | 77 | {ERR_FUNC(BN_F_BN_BN2DEC), "BN_bn2dec"}, |
74 | {ERR_PACK(0,BN_F_BN_BN2HEX,0), "BN_bn2hex"}, | 78 | {ERR_FUNC(BN_F_BN_BN2HEX), "BN_bn2hex"}, |
75 | {ERR_PACK(0,BN_F_BN_CTX_GET,0), "BN_CTX_get"}, | 79 | {ERR_FUNC(BN_F_BN_CTX_GET), "BN_CTX_get"}, |
76 | {ERR_PACK(0,BN_F_BN_CTX_NEW,0), "BN_CTX_new"}, | 80 | {ERR_FUNC(BN_F_BN_CTX_NEW), "BN_CTX_new"}, |
77 | {ERR_PACK(0,BN_F_BN_DIV,0), "BN_div"}, | 81 | {ERR_FUNC(BN_F_BN_DIV), "BN_div"}, |
78 | {ERR_PACK(0,BN_F_BN_EXPAND2,0), "bn_expand2"}, | 82 | {ERR_FUNC(BN_F_BN_EXP), "BN_exp"}, |
79 | {ERR_PACK(0,BN_F_BN_EXPAND_INTERNAL,0), "BN_EXPAND_INTERNAL"}, | 83 | {ERR_FUNC(BN_F_BN_EXPAND2), "bn_expand2"}, |
80 | {ERR_PACK(0,BN_F_BN_MOD_EXP2_MONT,0), "BN_mod_exp2_mont"}, | 84 | {ERR_FUNC(BN_F_BN_EXPAND_INTERNAL), "BN_EXPAND_INTERNAL"}, |
81 | {ERR_PACK(0,BN_F_BN_MOD_EXP_MONT,0), "BN_mod_exp_mont"}, | 85 | {ERR_FUNC(BN_F_BN_MOD_EXP2_MONT), "BN_mod_exp2_mont"}, |
82 | {ERR_PACK(0,BN_F_BN_MOD_EXP_MONT_WORD,0), "BN_mod_exp_mont_word"}, | 86 | {ERR_FUNC(BN_F_BN_MOD_EXP_MONT), "BN_mod_exp_mont"}, |
83 | {ERR_PACK(0,BN_F_BN_MOD_INVERSE,0), "BN_mod_inverse"}, | 87 | {ERR_FUNC(BN_F_BN_MOD_EXP_MONT_CONSTTIME), "BN_mod_exp_mont_consttime"}, |
84 | {ERR_PACK(0,BN_F_BN_MOD_LSHIFT_QUICK,0), "BN_mod_lshift_quick"}, | 88 | {ERR_FUNC(BN_F_BN_MOD_EXP_MONT_WORD), "BN_mod_exp_mont_word"}, |
85 | {ERR_PACK(0,BN_F_BN_MOD_MUL_RECIPROCAL,0), "BN_mod_mul_reciprocal"}, | 89 | {ERR_FUNC(BN_F_BN_MOD_EXP_RECP), "BN_mod_exp_recp"}, |
86 | {ERR_PACK(0,BN_F_BN_MOD_SQRT,0), "BN_mod_sqrt"}, | 90 | {ERR_FUNC(BN_F_BN_MOD_EXP_SIMPLE), "BN_mod_exp_simple"}, |
87 | {ERR_PACK(0,BN_F_BN_MPI2BN,0), "BN_mpi2bn"}, | 91 | {ERR_FUNC(BN_F_BN_MOD_INVERSE), "BN_mod_inverse"}, |
88 | {ERR_PACK(0,BN_F_BN_NEW,0), "BN_new"}, | 92 | {ERR_FUNC(BN_F_BN_MOD_LSHIFT_QUICK), "BN_mod_lshift_quick"}, |
89 | {ERR_PACK(0,BN_F_BN_RAND,0), "BN_rand"}, | 93 | {ERR_FUNC(BN_F_BN_MOD_MUL_RECIPROCAL), "BN_mod_mul_reciprocal"}, |
90 | {ERR_PACK(0,BN_F_BN_RAND_RANGE,0), "BN_rand_range"}, | 94 | {ERR_FUNC(BN_F_BN_MOD_SQRT), "BN_mod_sqrt"}, |
91 | {ERR_PACK(0,BN_F_BN_USUB,0), "BN_usub"}, | 95 | {ERR_FUNC(BN_F_BN_MPI2BN), "BN_mpi2bn"}, |
96 | {ERR_FUNC(BN_F_BN_NEW), "BN_new"}, | ||
97 | {ERR_FUNC(BN_F_BN_RAND), "BN_rand"}, | ||
98 | {ERR_FUNC(BN_F_BN_RAND_RANGE), "BN_rand_range"}, | ||
99 | {ERR_FUNC(BN_F_BN_USUB), "BN_usub"}, | ||
92 | {0,NULL} | 100 | {0,NULL} |
93 | }; | 101 | }; |
94 | 102 | ||
95 | static ERR_STRING_DATA BN_str_reasons[]= | 103 | static ERR_STRING_DATA BN_str_reasons[]= |
96 | { | 104 | { |
97 | {BN_R_ARG2_LT_ARG3 ,"arg2 lt arg3"}, | 105 | {ERR_REASON(BN_R_ARG2_LT_ARG3) ,"arg2 lt arg3"}, |
98 | {BN_R_BAD_RECIPROCAL ,"bad reciprocal"}, | 106 | {ERR_REASON(BN_R_BAD_RECIPROCAL) ,"bad reciprocal"}, |
99 | {BN_R_BIGNUM_TOO_LONG ,"bignum too long"}, | 107 | {ERR_REASON(BN_R_BIGNUM_TOO_LONG) ,"bignum too long"}, |
100 | {BN_R_CALLED_WITH_EVEN_MODULUS ,"called with even modulus"}, | 108 | {ERR_REASON(BN_R_CALLED_WITH_EVEN_MODULUS),"called with even modulus"}, |
101 | {BN_R_DIV_BY_ZERO ,"div by zero"}, | 109 | {ERR_REASON(BN_R_DIV_BY_ZERO) ,"div by zero"}, |
102 | {BN_R_ENCODING_ERROR ,"encoding error"}, | 110 | {ERR_REASON(BN_R_ENCODING_ERROR) ,"encoding error"}, |
103 | {BN_R_EXPAND_ON_STATIC_BIGNUM_DATA ,"expand on static bignum data"}, | 111 | {ERR_REASON(BN_R_EXPAND_ON_STATIC_BIGNUM_DATA),"expand on static bignum data"}, |
104 | {BN_R_INPUT_NOT_REDUCED ,"input not reduced"}, | 112 | {ERR_REASON(BN_R_INPUT_NOT_REDUCED) ,"input not reduced"}, |
105 | {BN_R_INVALID_LENGTH ,"invalid length"}, | 113 | {ERR_REASON(BN_R_INVALID_LENGTH) ,"invalid length"}, |
106 | {BN_R_INVALID_RANGE ,"invalid range"}, | 114 | {ERR_REASON(BN_R_INVALID_RANGE) ,"invalid range"}, |
107 | {BN_R_NOT_A_SQUARE ,"not a square"}, | 115 | {ERR_REASON(BN_R_NOT_A_SQUARE) ,"not a square"}, |
108 | {BN_R_NOT_INITIALIZED ,"not initialized"}, | 116 | {ERR_REASON(BN_R_NOT_INITIALIZED) ,"not initialized"}, |
109 | {BN_R_NO_INVERSE ,"no inverse"}, | 117 | {ERR_REASON(BN_R_NO_INVERSE) ,"no inverse"}, |
110 | {BN_R_P_IS_NOT_PRIME ,"p is not prime"}, | 118 | {ERR_REASON(BN_R_P_IS_NOT_PRIME) ,"p is not prime"}, |
111 | {BN_R_TOO_MANY_ITERATIONS ,"too many iterations"}, | 119 | {ERR_REASON(BN_R_TOO_MANY_ITERATIONS) ,"too many iterations"}, |
112 | {BN_R_TOO_MANY_TEMPORARY_VARIABLES ,"too many temporary variables"}, | 120 | {ERR_REASON(BN_R_TOO_MANY_TEMPORARY_VARIABLES),"too many temporary variables"}, |
113 | {0,NULL} | 121 | {0,NULL} |
114 | }; | 122 | }; |
115 | 123 | ||
@@ -123,8 +131,8 @@ void ERR_load_BN_strings(void) | |||
123 | { | 131 | { |
124 | init=0; | 132 | init=0; |
125 | #ifndef OPENSSL_NO_ERR | 133 | #ifndef OPENSSL_NO_ERR |
126 | ERR_load_strings(ERR_LIB_BN,BN_str_functs); | 134 | ERR_load_strings(0,BN_str_functs); |
127 | ERR_load_strings(ERR_LIB_BN,BN_str_reasons); | 135 | ERR_load_strings(0,BN_str_reasons); |
128 | #endif | 136 | #endif |
129 | 137 | ||
130 | } | 138 | } |