-/* $OpenBSD: bn_div.c,v 1.39 2023/02/16 10:41:03 jsing Exp $ */
+/* $OpenBSD: bn_div.c,v 1.40 2023/03/27 10:21:23 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
if (!no_branch) {
if (BN_ucmp(numerator, divisor) < 0) {
if (remainder != NULL) {
- if (BN_copy(remainder, numerator) == NULL)
+ if (!bn_copy(remainder, numerator))
goto err;
}
if (quotient != NULL)
-/* $OpenBSD: bn_exp.c,v 1.41 2023/03/26 19:09:42 tb Exp $ */
+/* $OpenBSD: bn_exp.c,v 1.42 2023/03/27 10:21:23 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
if (rr == NULL || v == NULL)
goto err;
- if (BN_copy(v, a) == NULL)
+ if (!bn_copy(v, a))
goto err;
bits = BN_num_bits(p);
if (BN_is_odd(p)) {
- if (BN_copy(rr, a) == NULL)
+ if (!bn_copy(rr, a))
goto err;
} else {
if (!BN_one(rr))
-/* $OpenBSD: bn_gcd.c,v 1.21 2023/01/21 09:21:11 jsing Exp $ */
+/* $OpenBSD: bn_gcd.c,v 1.22 2023/03/27 10:21:23 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
if (!BN_one(X))
goto err;
BN_zero(Y);
- if (BN_copy(B, a) == NULL)
+ if (!bn_copy(B, a))
goto err;
- if (BN_copy(A, n) == NULL)
+ if (!bn_copy(A, n))
goto err;
A->neg = 0;
if ((b = BN_CTX_get(ctx)) == NULL)
goto err;
- if (BN_copy(a, in_a) == NULL)
+ if (!bn_copy(a, in_a))
goto err;
- if (BN_copy(b, in_b) == NULL)
+ if (!bn_copy(b, in_b))
goto err;
a->neg = 0;
b->neg = 0;
if (t == NULL)
goto err;
- if (BN_copy(r, t) == NULL)
+ if (!bn_copy(r, t))
goto err;
ret = 1;
if (!BN_one(X))
goto err;
BN_zero(Y);
- if (BN_copy(B, a) == NULL)
+ if (!bn_copy(B, a))
goto err;
- if (BN_copy(A, n) == NULL)
+ if (!bn_copy(A, n))
goto err;
A->neg = 0;
if (!BN_one(X))
goto err;
BN_zero(Y);
- if (BN_copy(B, a) == NULL)
+ if (!bn_copy(B, a))
goto err;
- if (BN_copy(A, n) == NULL)
+ if (!bn_copy(A, n))
goto err;
A->neg = 0;
if (B->neg || (BN_ucmp(B, A) >= 0)) {
-/* $OpenBSD: bn_kron.c,v 1.13 2023/03/25 10:51:18 tb Exp $ */
+/* $OpenBSD: bn_kron.c,v 1.14 2023/03/27 10:21:23 tb Exp $ */
/* ====================================================================
* Copyright (c) 1998-2000 The OpenSSL Project. All rights reserved.
*
if ((b = BN_CTX_get(ctx)) == NULL)
goto end;
- if (BN_copy(a, A) == NULL)
+ if (!bn_copy(a, A))
goto end;
- if (BN_copy(b, B) == NULL)
+ if (!bn_copy(b, B))
goto end;
/*
-/* $OpenBSD: bn_mod.c,v 1.19 2023/02/03 05:15:40 jsing Exp $ */
+/* $OpenBSD: bn_mod.c,v 1.20 2023/03/27 10:21:23 tb Exp $ */
/* Includes code written by Lenka Fibikova <fibikova@exp-math.uni-essen.de>
* for the OpenSSL project. */
/* ====================================================================
if (BN_is_negative(m)) {
if ((abs_m = BN_CTX_get(ctx)) == NULL)
goto err;
- if (BN_copy(abs_m, m) == NULL)
+ if (!bn_copy(abs_m, m))
goto err;
BN_set_negative(abs_m, 0);
m = abs_m;
{
int max_shift;
- if (BN_copy(r, a) == NULL)
+ if (!bn_copy(r, a))
return 0;
while (n > 0) {
-/* $OpenBSD: bn_mont.c,v 1.53 2023/03/26 19:09:42 tb Exp $ */
+/* $OpenBSD: bn_mont.c,v 1.54 2023/03/27 10:21:23 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
if ((tmp = BN_CTX_get(ctx)) == NULL)
goto err;
- if (BN_copy(tmp, a) == NULL)
+ if (!bn_copy(tmp, a))
goto err;
if (!bn_montgomery_reduce(r, tmp, mctx))
goto err;
-/* $OpenBSD: ecs_ossl.c,v 1.29 2023/03/07 09:27:10 jsing Exp $ */
+/* $OpenBSD: ecs_ossl.c,v 1.30 2023/03/27 10:21:23 tb Exp $ */
/*
* Written by Nils Larsch for the OpenSSL project
*/
ckinv = kinv;
} else {
ckinv = in_kinv;
- if (BN_copy(ret->r, in_r) == NULL) {
+ if (!bn_copy(ret->r, in_r)) {
ECDSAerror(ERR_R_MALLOC_FAILURE);
goto err;
}