-/* $OpenBSD: bn_exp.c,v 1.38 2023/03/15 04:30:20 jsing Exp $ */
+/* $OpenBSD: bn_exp.c,v 1.39 2023/03/26 18:49:48 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
* Build table for a1: val1[i] := a1^(2*i + 1) mod m for i = 0 .. 2^(window1-1)
*/
if (a1->neg || BN_ucmp(a1, m) >= 0) {
- if (!BN_mod_ct(val1[0], a1, m, ctx))
+ if (!BN_nnmod(val1[0], a1, m, ctx))
goto err;
a_mod_m = val1[0];
} else
* Build table for a2: val2[i] := a2^(2*i + 1) mod m for i = 0 .. 2^(window2-1)
*/
if (a2->neg || BN_ucmp(a2, m) >= 0) {
- if (!BN_mod_ct(val2[0], a2, m, ctx))
+ if (!BN_nnmod(val2[0], a2, m, ctx))
goto err;
a_mod_m = val2[0];
} else