CVSROOT: /cvs
Module name: src
Changes by: [email protected] 2022/12/03 02:37:02
Modified files:
regress/lib/libcrypto/bn: bn_mod_exp.c
Log message:
Refactor and fix bn_mod_exp test
The amount of copy-paste in this test led to a few bugs and it was hard to
spot them since things were done in random order. Use a different approach:
compute the result of a^b (mod m) according to BN_mod_exp_simple(), then
compare the results of all the other *_mod_exp* functions to that.
Reuse the test structure from bn_mod_exp_zero.c to loop over the list of
functions. This way we test more functions and don't forget to check some
crucial bits.