This also fixes a bug in BN_MONT_CTX_set(), where the sizeof(BN_ULONG) in
the call to bn_expand() was not multiplied by eight (to get bits).
ok tb@
-/* $OpenBSD: bn_lib.c,v 1.59 2022/11/23 03:04:52 jsing Exp $ */
+/* $OpenBSD: bn_lib.c,v 1.60 2022/11/23 03:10:10 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
BN_set_word(BIGNUM *a, BN_ULONG w)
{
bn_check_top(a);
- if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL)
+ if (bn_wexpand(a, 1) == NULL)
return (0);
a->neg = 0;
a->d[0] = w;
-/* $OpenBSD: bn_mont.c,v 1.28 2022/02/07 19:44:23 tb Exp $ */
+/* $OpenBSD: bn_mont.c,v 1.29 2022/11/23 03:10:10 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
}
else /* if N mod word size == 1 */
{
- if (bn_expand(Ri, (int)sizeof(BN_ULONG) * 2) == NULL)
+ if (bn_wexpand(Ri, 2) == NULL)
goto err;
/* Ri-- (mod double word size) */
Ri->neg = 0;