if (!TEST_BN_eq(c, d))
goto err;
+ /* Regression test for bug in rsaz_1024_mul_avx2 */
+ BN_hex2bn(&a,
+ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
+ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
+ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
+ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF2020202020DF");
+ BN_hex2bn(&b,
+ "2020202020202020202020202020202020202020202020202020202020202020"
+ "2020202020202020202020202020202020202020202020202020202020202020"
+ "20202020202020FF202020202020202020202020202020202020202020202020"
+ "2020202020202020202020202020202020202020202020202020202020202020");
+ BN_hex2bn(&n,
+ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
+ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
+ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
+ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF2020202020FF");
+ BN_MONT_CTX_set(mont, n, ctx);
+ BN_mod_exp_mont_consttime(c, a, b, n, ctx, mont);
+ BN_mod_exp_mont(d, a, b, n, ctx, mont);
+ if (!TEST_BN_eq(c, d))
+ goto err;
+
/* Zero input */
BN_bntest_rand(p, 1024, 0, 0);
BN_zero(a);