summaryrefslogtreecommitdiff
path: root/crypto/bn/bn_intern.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/bn/bn_intern.c')
-rw-r--r--crypto/bn/bn_intern.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/crypto/bn/bn_intern.c b/crypto/bn/bn_intern.c
index d92403608b..614ad5c9cd 100644
--- a/crypto/bn/bn_intern.c
+++ b/crypto/bn/bn_intern.c
@@ -30,7 +30,7 @@ signed char *bn_compute_wNAF(const BIGNUM *scalar, int w, size_t *ret_len)
if (BN_is_zero(scalar)) {
r = OPENSSL_malloc(1);
if (r == NULL) {
- BNerr(BN_F_BN_COMPUTE_WNAF, ERR_R_MALLOC_FAILURE);
+ ERR_raise(ERR_LIB_BN, ERR_R_MALLOC_FAILURE);
goto err;
}
r[0] = 0;
@@ -40,7 +40,7 @@ signed char *bn_compute_wNAF(const BIGNUM *scalar, int w, size_t *ret_len)
if (w <= 0 || w > 7) { /* 'signed char' can represent integers with
* absolute values less than 2^7 */
- BNerr(BN_F_BN_COMPUTE_WNAF, ERR_R_INTERNAL_ERROR);
+ ERR_raise(ERR_LIB_BN, ERR_R_INTERNAL_ERROR);
goto err;
}
bit = 1 << w; /* at most 128 */
@@ -52,7 +52,7 @@ signed char *bn_compute_wNAF(const BIGNUM *scalar, int w, size_t *ret_len)
}
if (scalar->d == NULL || scalar->top == 0) {
- BNerr(BN_F_BN_COMPUTE_WNAF, ERR_R_INTERNAL_ERROR);
+ ERR_raise(ERR_LIB_BN, ERR_R_INTERNAL_ERROR);
goto err;
}
@@ -63,7 +63,7 @@ signed char *bn_compute_wNAF(const BIGNUM *scalar, int w, size_t *ret_len)
* BN_num_bits(scalar) + 1)
*/
if (r == NULL) {
- BNerr(BN_F_BN_COMPUTE_WNAF, ERR_R_MALLOC_FAILURE);
+ ERR_raise(ERR_LIB_BN, ERR_R_MALLOC_FAILURE);
goto err;
}
window_val = scalar->d[0] & mask;
@@ -98,7 +98,7 @@ signed char *bn_compute_wNAF(const BIGNUM *scalar, int w, size_t *ret_len)
}
if (digit <= -bit || digit >= bit || !(digit & 1)) {
- BNerr(BN_F_BN_COMPUTE_WNAF, ERR_R_INTERNAL_ERROR);
+ ERR_raise(ERR_LIB_BN, ERR_R_INTERNAL_ERROR);
goto err;
}
@@ -110,7 +110,7 @@ signed char *bn_compute_wNAF(const BIGNUM *scalar, int w, size_t *ret_len)
*/
if (window_val != 0 && window_val != next_bit
&& window_val != bit) {
- BNerr(BN_F_BN_COMPUTE_WNAF, ERR_R_INTERNAL_ERROR);
+ ERR_raise(ERR_LIB_BN, ERR_R_INTERNAL_ERROR);
goto err;
}
}
@@ -121,13 +121,13 @@ signed char *bn_compute_wNAF(const BIGNUM *scalar, int w, size_t *ret_len)
window_val += bit * BN_is_bit_set(scalar, j + w);
if (window_val > next_bit) {
- BNerr(BN_F_BN_COMPUTE_WNAF, ERR_R_INTERNAL_ERROR);
+ ERR_raise(ERR_LIB_BN, ERR_R_INTERNAL_ERROR);
goto err;
}
}
if (j > len + 1) {
- BNerr(BN_F_BN_COMPUTE_WNAF, ERR_R_INTERNAL_ERROR);
+ ERR_raise(ERR_LIB_BN, ERR_R_INTERNAL_ERROR);
goto err;
}
*ret_len = j;
@@ -188,7 +188,7 @@ void bn_set_static_words(BIGNUM *a, const BN_ULONG *words, int size)
int bn_set_words(BIGNUM *a, const BN_ULONG *words, int num_words)
{
if (bn_wexpand(a, num_words) == NULL) {
- BNerr(BN_F_BN_SET_WORDS, ERR_R_MALLOC_FAILURE);
+ ERR_raise(ERR_LIB_BN, ERR_R_MALLOC_FAILURE);
return 0;
}