-/* $OpenBSD: bn_blind.c,v 1.20 2023/03/07 09:27:10 jsing Exp $ */
+/* $OpenBSD: bn_blind.c,v 1.21 2023/03/27 10:25:02 tb Exp $ */
/* ====================================================================
* Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved.
*
return (0);
if (r != NULL) {
- if (!BN_copy(r, b->Ai))
+ if (!bn_copy(r, b->Ai))
ret = 0;
}
-/* $OpenBSD: bn_exp.c,v 1.43 2023/03/27 10:22:47 tb Exp $ */
+/* $OpenBSD: bn_exp.c,v 1.44 2023/03/27 10:25:02 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
(BN_mod_ct(t, r, m, ctx) && (swap_tmp = r, r = t, t = swap_tmp, 1))))
/* BN_MOD_MUL_WORD is only used with 'w' large,
* so the BN_ucmp test is probably more overhead
- * than always using BN_mod (which uses BN_copy if
+ * than always using BN_mod (which uses bn_copy if
* a similar test returns true). */
/* We can use BN_mod and do not need BN_nnmod because our
* accumulator is never negative (the result of BN_mod does
if (m->neg) {
/* ignore sign of 'm' */
- if (!BN_copy(aa, m))
+ if (!bn_copy(aa, m))
goto err;
aa->neg = 0;
if (BN_RECP_CTX_set(&recp, aa, ctx) <= 0)
-/* $OpenBSD: bn_gcd.c,v 1.22 2023/03/27 10:21:23 tb Exp $ */
+/* $OpenBSD: bn_gcd.c,v 1.23 2023/03/27 10:25:02 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
* A == gcd(a,n);
*/
- if (!BN_copy(R, A))
+ if (!bn_copy(R, A))
goto err;
ret = R;
err:
if (BN_is_one(A)) {
/* Y*a == 1 (mod |n|) */
if (!Y->neg && BN_ucmp(Y, n) < 0) {
- if (!BN_copy(R, Y))
+ if (!bn_copy(R, Y))
goto err;
} else {
if (!BN_nnmod(R, Y, n, ctx))
if (!BN_lshift(tmp, X, 2))
goto err;
} else if (D->top == 1) {
- if (!BN_copy(tmp, X))
+ if (!bn_copy(tmp, X))
goto err;
if (!BN_mul_word(tmp, D->d[0]))
goto err;
if (BN_is_one(A)) {
/* Y*a == 1 (mod |n|) */
if (!Y->neg && BN_ucmp(Y, n) < 0) {
- if (!BN_copy(R, Y))
+ if (!bn_copy(R, Y))
goto err;
} else {
if (!BN_nnmod(R, Y,n, ctx))
-/* $OpenBSD: bn_gf2m.c,v 1.31 2023/03/27 10:20:27 tb Exp $ */
+/* $OpenBSD: bn_gf2m.c,v 1.32 2023/03/27 10:25:02 tb Exp $ */
/* ====================================================================
* Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
*
if (BN_is_zero(u))
goto err;
- if (!BN_copy(v, p))
+ if (!bn_copy(v, p))
goto err;
#if 0
if (!BN_one(b))
}
#endif
- if (!BN_copy(r, b))
+ if (!bn_copy(r, b))
goto err;
ret = 1;
goto err;
if (!BN_GF2m_mod(a, x, p))
goto err;
- if (!BN_copy(b, p))
+ if (!bn_copy(b, p))
goto err;
while (!BN_is_odd(a)) {
}
} while (1);
- if (!BN_copy(r, u))
+ if (!bn_copy(r, u))
goto err;
ret = 1;
goto err;
}
}
- if (!BN_copy(r, u))
+ if (!bn_copy(r, u))
goto err;
ret = 1;
if (p[0] & 0x1) /* m is odd */
{
/* compute half-trace of a */
- if (!BN_copy(z, a))
+ if (!bn_copy(z, a))
goto err;
for (j = 1; j <= (p[0] - 1) / 2; j++) {
if (!BN_GF2m_mod_sqr_arr(z, z, p, ctx))
if (!BN_GF2m_mod_arr(rho, rho, p))
goto err;
BN_zero(z);
- if (!BN_copy(w, rho))
+ if (!bn_copy(w, rho))
goto err;
for (j = 1; j <= p[0] - 1; j++) {
if (!BN_GF2m_mod_sqr_arr(z, z, p, ctx))
goto err;
}
- if (!BN_copy(r, z))
+ if (!bn_copy(r, z))
goto err;
ret = 1;
-/* $OpenBSD: bn_isqrt.c,v 1.6 2022/12/17 15:56:25 jsing Exp $ */
+/* $OpenBSD: bn_isqrt.c,v 1.7 2023/03/27 10:25:02 tb Exp $ */
/*
* Copyright (c) 2022 Theo Buehler <tb@openbsd.org>
*
*out_perfect = perfect;
if (out_sqrt != NULL) {
- if (!BN_copy(out_sqrt, a))
+ if (!bn_copy(out_sqrt, a))
goto err;
}
-/* $OpenBSD: bn_lib.c,v 1.77 2023/03/27 08:37:33 tb Exp $ */
+/* $OpenBSD: bn_lib.c,v 1.78 2023/03/27 10:25:02 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
t = BN_new();
if (t == NULL)
return NULL;
- if (!BN_copy(t, a)) {
+ if (!bn_copy(t, a)) {
BN_free(t);
return NULL;
}
-/* $OpenBSD: bn_mont.c,v 1.54 2023/03/27 10:21:23 tb Exp $ */
+/* $OpenBSD: bn_mont.c,v 1.55 2023/03/27 10:25:02 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
if (dst == src)
return dst;
- if (!BN_copy(&dst->RR, &src->RR))
+ if (!bn_copy(&dst->RR, &src->RR))
return NULL;
- if (!BN_copy(&dst->N, &src->N))
+ if (!bn_copy(&dst->N, &src->N))
return NULL;
dst->ri = src->ri;
/* Save modulus and determine length of R. */
if (BN_is_zero(mod))
goto err;
- if (!BN_copy(&mont->N, mod))
+ if (!bn_copy(&mont->N, mod))
goto err;
mont->N.neg = 0;
mont->ri = ((BN_num_bits(mod) + BN_BITS2 - 1) / BN_BITS2) * BN_BITS2;
-/* $OpenBSD: bn_recp.c,v 1.18 2023/02/13 04:25:37 jsing Exp $ */
+/* $OpenBSD: bn_recp.c,v 1.19 2023/03/27 10:25:02 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
int
BN_RECP_CTX_set(BN_RECP_CTX *recp, const BIGNUM *d, BN_CTX *ctx)
{
- if (!BN_copy(&(recp->N), d))
+ if (!bn_copy(&(recp->N), d))
return 0;
BN_zero(&(recp->Nr));
recp->num_bits = BN_num_bits(d);
if (BN_ucmp(m, &(recp->N)) < 0) {
BN_zero(d);
- if (!BN_copy(r, m)) {
+ if (!bn_copy(r, m)) {
BN_CTX_end(ctx);
return 0;
}
-/* $OpenBSD: bn_sqrt.c,v 1.15 2023/03/07 09:27:10 jsing Exp $ */
+/* $OpenBSD: bn_sqrt.c,v 1.16 2023/03/27 10:25:02 tb Exp $ */
/* Written by Lenka Fibikova <fibikova@exp-math.uni-essen.de>
* and Bodo Moeller for the OpenSSL project. */
/* ====================================================================
if (!BN_mod_mul(x, x, t, p, ctx))
goto end;
- if (!BN_copy(ret, x))
+ if (!bn_copy(ret, x))
goto end;
err = 0;
goto vrfy;
/* e > 2, so we really have to use the Tonelli/Shanks algorithm.
* First, find some y that is not a square. */
- if (!BN_copy(q, p)) /* use 'q' as temp */
+ if (!bn_copy(q, p)) /* use 'q' as temp */
goto end;
q->neg = 0;
i = 2;
*/
if (BN_is_one(b)) {
- if (!BN_copy(ret, x))
+ if (!bn_copy(ret, x))
goto end;
err = 0;
goto vrfy;
}
/* t := y^2^(e - i - 1) */
- if (!BN_copy(t, y))
+ if (!bn_copy(t, y))
goto end;
for (j = e - i - 1; j > 0; j--) {
if (!BN_mod_sqr(t, t, p, ctx))
-/* $OpenBSD: bn_x931p.c,v 1.15 2022/12/26 07:18:51 jmc Exp $ */
+/* $OpenBSD: bn_x931p.c,v 1.16 2023/03/27 10:25:02 tb Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 2005.
*/
{
int i = 0, is_prime;
- if (!BN_copy(pi, Xpi))
+ if (!bn_copy(pi, Xpi))
return 0;
if (!BN_is_odd(pi) && !BN_add_word(pi, 1))
return 0;
for (;;) {
int i = 1;
BN_GENCB_call(cb, 0, i++);
- if (!BN_copy(pm1, p))
+ if (!bn_copy(pm1, p))
goto err;
if (!BN_sub_word(pm1, 1))
goto err;
-/* $OpenBSD: dsa_gen.c,v 1.27 2023/01/11 04:39:42 jsing Exp $ */
+/* $OpenBSD: dsa_gen.c,v 1.28 2023/03/27 10:25:02 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
/* more of step 8 */
if (!BN_mask_bits(W, bits - 1))
goto err;
- if (!BN_copy(X, W))
+ if (!bn_copy(X, W))
goto err;
if (!BN_add(X, X, test))
goto err;
-/* $OpenBSD: dsa_ossl.c,v 1.50 2023/03/04 21:30:23 tb Exp $ */
+/* $OpenBSD: dsa_ossl.c,v 1.51 2023/03/27 10:25:02 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
* small timing information leakage. We then choose the sum that is
* one bit longer than the modulus.
*
- * TODO: revisit the BN_copy aiming for a memory access agnostic
+ * TODO: revisit the bn_copy aiming for a memory access agnostic
* conditional copy.
*/
if (!BN_add(l, k, dsa->q) ||
!BN_add(m, l, dsa->q) ||
- !BN_copy(k, BN_num_bits(l) > q_bits ? l : m))
+ !bn_copy(k, BN_num_bits(l) > q_bits ? l : m))
goto err;
if (dsa->meth->bn_mod_exp != NULL) {
-/* $OpenBSD: ec2_mult.c,v 1.15 2022/11/26 16:08:52 tb Exp $ */
+/* $OpenBSD: ec2_mult.c,v 1.16 2023/03/27 10:25:02 tb Exp $ */
/* ====================================================================
* Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
*
if ((t2 = BN_CTX_get(ctx)) == NULL)
goto err;
- if (!BN_copy(t1, x))
+ if (!bn_copy(t1, x))
goto err;
if (!group->meth->field_mul(group, x1, x1, z2, ctx))
goto err;
return 1;
}
if (BN_is_zero(z2)) {
- if (!BN_copy(x2, x))
+ if (!bn_copy(x2, x))
return 0;
if (!BN_GF2m_add(z2, x, y))
return 0;
-/* $OpenBSD: ec2_smpl.c,v 1.33 2023/03/08 05:45:31 jsing Exp $ */
+/* $OpenBSD: ec2_smpl.c,v 1.34 2023/03/27 10:25:02 tb Exp $ */
/* ====================================================================
* Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
*
{
int i;
- if (!BN_copy(&dest->field, &src->field))
+ if (!bn_copy(&dest->field, &src->field))
return 0;
- if (!BN_copy(&dest->a, &src->a))
+ if (!bn_copy(&dest->a, &src->a))
return 0;
- if (!BN_copy(&dest->b, &src->b))
+ if (!bn_copy(&dest->b, &src->b))
return 0;
dest->poly[0] = src->poly[0];
dest->poly[1] = src->poly[1];
int ret = 0, i;
/* group->field */
- if (!BN_copy(&group->field, p))
+ if (!bn_copy(&group->field, p))
goto err;
i = BN_GF2m_poly2arr(&group->field, group->poly, 6) - 1;
if ((i != 5) && (i != 3)) {
int ret = 0;
if (p != NULL) {
- if (!BN_copy(p, &group->field))
+ if (!bn_copy(p, &group->field))
return 0;
}
if (a != NULL) {
- if (!BN_copy(a, &group->a))
+ if (!bn_copy(a, &group->a))
goto err;
}
if (b != NULL) {
- if (!BN_copy(b, &group->b))
+ if (!bn_copy(b, &group->b))
goto err;
}
ret = 1;
static int
ec_GF2m_simple_point_copy(EC_POINT *dest, const EC_POINT *src)
{
- if (!BN_copy(&dest->X, &src->X))
+ if (!bn_copy(&dest->X, &src->X))
return 0;
- if (!BN_copy(&dest->Y, &src->Y))
+ if (!bn_copy(&dest->Y, &src->Y))
return 0;
- if (!BN_copy(&dest->Z, &src->Z))
+ if (!bn_copy(&dest->Z, &src->Z))
return 0;
dest->Z_is_one = src->Z_is_one;
ECerror(ERR_R_PASSED_NULL_PARAMETER);
return 0;
}
- if (!BN_copy(&point->X, x))
+ if (!bn_copy(&point->X, x))
goto err;
BN_set_negative(&point->X, 0);
- if (!BN_copy(&point->Y, y))
+ if (!bn_copy(&point->Y, y))
goto err;
BN_set_negative(&point->Y, 0);
- if (!BN_copy(&point->Z, BN_value_one()))
+ if (!bn_copy(&point->Z, BN_value_one()))
goto err;
BN_set_negative(&point->Z, 0);
point->Z_is_one = 1;
return 0;
}
if (x != NULL) {
- if (!BN_copy(x, &point->X))
+ if (!bn_copy(x, &point->X))
goto err;
BN_set_negative(x, 0);
}
if (y != NULL) {
- if (!BN_copy(y, &point->Y))
+ if (!bn_copy(y, &point->Y))
goto err;
BN_set_negative(y, 0);
}
goto err;
if (a->Z_is_one) {
- if (!BN_copy(x0, &a->X))
+ if (!bn_copy(x0, &a->X))
goto err;
- if (!BN_copy(y0, &a->Y))
+ if (!bn_copy(y0, &a->Y))
goto err;
} else {
if (!EC_POINT_get_affine_coordinates(group, a, x0, y0, ctx))
goto err;
}
if (b->Z_is_one) {
- if (!BN_copy(x1, &b->X))
+ if (!bn_copy(x1, &b->X))
goto err;
- if (!BN_copy(y1, &b->Y))
+ if (!bn_copy(y1, &b->Y))
goto err;
} else {
if (!EC_POINT_get_affine_coordinates(group, b, x1, y1, ctx))
if (!EC_POINT_get_affine_coordinates(group, point, x, y, ctx))
goto err;
- if (!BN_copy(&point->X, x))
+ if (!bn_copy(&point->X, x))
goto err;
- if (!BN_copy(&point->Y, y))
+ if (!bn_copy(&point->Y, y))
goto err;
if (!BN_one(&point->Z))
goto err;
-/* $OpenBSD: ec_key.c,v 1.31 2023/03/07 09:27:10 jsing Exp $ */
+/* $OpenBSD: ec_key.c,v 1.32 2023/03/27 10:25:02 tb Exp $ */
/*
* Written by Nils Larsch for the OpenSSL project.
*/
if (dest->priv_key == NULL)
return NULL;
}
- if (!BN_copy(dest->priv_key, src->priv_key))
+ if (!bn_copy(dest->priv_key, src->priv_key))
return NULL;
}
/* copy method/extra data */
-/* $OpenBSD: ec_lib.c,v 1.51 2023/03/08 06:47:30 jsing Exp $ */
+/* $OpenBSD: ec_lib.c,v 1.52 2023/03/27 10:25:02 tb Exp $ */
/*
* Originally written by Bodo Moeller for the OpenSSL project.
*/
dest->generator = NULL;
}
- if (!BN_copy(&dest->order, &src->order))
+ if (!bn_copy(&dest->order, &src->order))
return 0;
- if (!BN_copy(&dest->cofactor, &src->cofactor))
+ if (!bn_copy(&dest->cofactor, &src->cofactor))
return 0;
dest->curve_name = src->curve_name;
if (!BN_set_bit(q, BN_num_bits(&group->field) - 1))
goto err;
} else {
- if (!BN_copy(q, &group->field))
+ if (!bn_copy(q, &group->field))
goto err;
}
if (!EC_POINT_copy(group->generator, generator))
return 0;
- if (!BN_copy(&group->order, order))
+ if (!bn_copy(&group->order, order))
return 0;
/* Either take the provided positive cofactor, or try to compute it. */
if (cofactor != NULL && !BN_is_zero(cofactor)) {
- if (!BN_copy(&group->cofactor, cofactor))
+ if (!bn_copy(&group->cofactor, cofactor))
return 0;
} else if (!ec_guess_cofactor(group))
return 0;
int
EC_GROUP_get_order(const EC_GROUP *group, BIGNUM *order, BN_CTX *ctx)
{
- if (!BN_copy(order, &group->order))
+ if (!bn_copy(order, &group->order))
return 0;
return !BN_is_zero(order);
int
EC_GROUP_get_cofactor(const EC_GROUP *group, BIGNUM *cofactor, BN_CTX *ctx)
{
- if (!BN_copy(cofactor, &group->cofactor))
+ if (!bn_copy(cofactor, &group->cofactor))
return 0;
return !BN_is_zero(&group->cofactor);
-/* $OpenBSD: ecp_mont.c,v 1.27 2023/03/08 05:45:31 jsing Exp $ */
+/* $OpenBSD: ecp_mont.c,v 1.28 2023/03/27 10:25:02 tb Exp $ */
/*
* Originally written by Bodo Moeller for the OpenSSL project.
*/
ECerror(EC_R_NOT_INITIALIZED);
return 0;
}
- if (!BN_copy(r, group->mont_one))
+ if (!bn_copy(r, group->mont_one))
return 0;
return 1;
}
-/* $OpenBSD: ecp_smpl.c,v 1.42 2023/03/08 05:45:31 jsing Exp $ */
+/* $OpenBSD: ecp_smpl.c,v 1.43 2023/03/27 10:25:02 tb Exp $ */
/* Includes code written by Lenka Fibikova <fibikova@exp-math.uni-essen.de>
* for the OpenSSL project.
* Includes code written by Bodo Moeller for the OpenSSL project.
int
ec_GFp_simple_group_copy(EC_GROUP *dest, const EC_GROUP *src)
{
- if (!BN_copy(&dest->field, &src->field))
+ if (!bn_copy(&dest->field, &src->field))
return 0;
- if (!BN_copy(&dest->a, &src->a))
+ if (!bn_copy(&dest->a, &src->a))
return 0;
- if (!BN_copy(&dest->b, &src->b))
+ if (!bn_copy(&dest->b, &src->b))
return 0;
dest->a_is_minus3 = src->a_is_minus3;
goto err;
/* group->field */
- if (!BN_copy(&group->field, p))
+ if (!bn_copy(&group->field, p))
goto err;
BN_set_negative(&group->field, 0);
if (group->meth->field_encode) {
if (!group->meth->field_encode(group, &group->a, tmp_a, ctx))
goto err;
- } else if (!BN_copy(&group->a, tmp_a))
+ } else if (!bn_copy(&group->a, tmp_a))
goto err;
/* group->b */
BN_CTX *new_ctx = NULL;
if (p != NULL) {
- if (!BN_copy(p, &group->field))
+ if (!bn_copy(p, &group->field))
return 0;
}
if (a != NULL || b != NULL) {
}
} else {
if (a != NULL) {
- if (!BN_copy(a, &group->a))
+ if (!bn_copy(a, &group->a))
goto err;
}
if (b != NULL) {
- if (!BN_copy(b, &group->b))
+ if (!bn_copy(b, &group->b))
goto err;
}
}
if (!group->meth->field_decode(group, b, &group->b, ctx))
goto err;
} else {
- if (!BN_copy(a, &group->a))
+ if (!bn_copy(a, &group->a))
goto err;
- if (!BN_copy(b, &group->b))
+ if (!bn_copy(b, &group->b))
goto err;
}
int
ec_GFp_simple_point_copy(EC_POINT *dest, const EC_POINT *src)
{
- if (!BN_copy(&dest->X, &src->X))
+ if (!bn_copy(&dest->X, &src->X))
return 0;
- if (!BN_copy(&dest->Y, &src->Y))
+ if (!bn_copy(&dest->Y, &src->Y))
return 0;
- if (!BN_copy(&dest->Z, &src->Z))
+ if (!bn_copy(&dest->Z, &src->Z))
return 0;
dest->Z_is_one = src->Z_is_one;
}
} else {
if (x != NULL) {
- if (!BN_copy(x, &point->X))
+ if (!bn_copy(x, &point->X))
goto err;
}
if (y != NULL) {
- if (!BN_copy(y, &point->Y))
+ if (!bn_copy(y, &point->Y))
goto err;
}
if (z != NULL) {
- if (!BN_copy(z, &point->Z))
+ if (!bn_copy(z, &point->Z))
goto err;
}
}
}
} else {
if (x != NULL) {
- if (!BN_copy(x, &point->X))
+ if (!bn_copy(x, &point->X))
goto err;
}
if (y != NULL) {
- if (!BN_copy(y, &point->Y))
+ if (!bn_copy(y, &point->Y))
goto err;
}
}
/* n1, n2 */
if (b->Z_is_one) {
- if (!BN_copy(n1, &a->X))
+ if (!bn_copy(n1, &a->X))
goto end;
- if (!BN_copy(n2, &a->Y))
+ if (!bn_copy(n2, &a->Y))
goto end;
/* n1 = X_a */
/* n2 = Y_a */
/* n3, n4 */
if (a->Z_is_one) {
- if (!BN_copy(n3, &b->X))
+ if (!bn_copy(n3, &b->X))
goto end;
- if (!BN_copy(n4, &b->Y))
+ if (!bn_copy(n4, &b->Y))
goto end;
/* n3 = X_b */
/* n4 = Y_b */
/* Z_r */
if (a->Z_is_one && b->Z_is_one) {
- if (!BN_copy(&r->Z, n5))
+ if (!bn_copy(&r->Z, n5))
goto end;
} else {
if (a->Z_is_one) {
- if (!BN_copy(n0, &b->Z))
+ if (!bn_copy(n0, &b->Z))
goto end;
} else if (b->Z_is_one) {
- if (!BN_copy(n0, &a->Z))
+ if (!bn_copy(n0, &a->Z))
goto end;
} else {
if (!field_mul(group, n0, &a->Z, &b->Z, ctx))
/* Z_r */
if (a->Z_is_one) {
- if (!BN_copy(n0, &a->Y))
+ if (!bn_copy(n0, &a->Y))
goto err;
} else {
if (!field_mul(group, n0, &a->Y, &a->Z, ctx))
if (heap[2 * i] != NULL) {
if ((heap[2 * i + 1] == NULL) || BN_is_zero(heap[2 * i + 1])) {
- if (!BN_copy(heap[i], heap[2 * i]))
+ if (!bn_copy(heap[i], heap[2 * i]))
goto err;
} else {
if (BN_is_zero(heap[2 * i])) {
- if (!BN_copy(heap[i], heap[2 * i + 1]))
+ if (!bn_copy(heap[i], heap[2 * i + 1]))
goto err;
} else {
if (!group->meth->field_mul(group, heap[i],
goto err;
if (!group->meth->field_mul(group, tmp1, heap[i / 2], heap[i], ctx))
goto err;
- if (!BN_copy(heap[i], tmp0))
+ if (!bn_copy(heap[i], tmp0))
goto err;
- if (!BN_copy(heap[i + 1], tmp1))
+ if (!bn_copy(heap[i + 1], tmp1))
goto err;
} else {
- if (!BN_copy(heap[i], heap[i / 2]))
+ if (!bn_copy(heap[i], heap[i / 2]))
goto err;
}
}
!bn_wexpand(lambda, group_top + 2))
goto err;
- if (!BN_copy(k, scalar))
+ if (!bn_copy(k, scalar))
goto err;
BN_set_flags(k, BN_FLG_CONSTTIME);
-/* $OpenBSD: ecs_ossl.c,v 1.30 2023/03/27 10:21:23 tb Exp $ */
+/* $OpenBSD: ecs_ossl.c,v 1.31 2023/03/27 10:25:02 tb Exp $ */
/*
* Written by Nils Larsch for the OpenSSL project
*/
* code path used in the constant time implementations
* elsewhere.
*
- * TODO: revisit the BN_copy aiming for a memory access agnostic
+ * TODO: revisit the bn_copy aiming for a memory access agnostic
* conditional copy.
*/
if (!BN_add(r, k, order) ||
!BN_add(X, r, order) ||
- !BN_copy(k, BN_num_bits(r) > order_bits ? r : X))
+ !bn_copy(k, BN_num_bits(r) > order_bits ? r : X))
goto err;
BN_set_flags(k, BN_FLG_CONSTTIME);