rnp
rnp copied to clipboard
Investigate why test_ffi_keygen_json_pair_dsa_elg runs so long.
Description
It just generates single 1024/1536 DSA/ElGamal keypair however it is the longest running test, so usually overall rnp_tests suite time depends on it. As instrumented most time is spent in Botan's primality test(s).
Here is the possible reason:
if (bn_num_bytes(*y) < BITS_TO_BYTES(keybits)) {
botan_privkey_destroy(key_priv);
goto start;
}
This would re-generate underlying group, spending again more time in the primality test. Also gives random code coverage changes. We should rewrite it to use botan's native classes instead of FFI.
Note: don't see a good way to extract Botan's native RNG from the FFI RNG struct as it uses calls from the private header. So we should rewrite all RNG-related crypto to the Botan's native classes or keep two RNG's - FFI and native one.
Note 2: this could also randomly cause coverage difference.
Closing this as it should be resolved by refactoring via issue #2005