Hard-coded usage of the system RNG in ffi_pk_op
Fixes https://github.com/randombit/botan/issues/4340
Open questions:
- How best to unify the
_with_rngversions with their original ones?
coverage: 91.145% (+0.01%) from 91.135% when pulling 598a45eff4a6b828e8e92cf8ad3b58751b93edde on plancksecurity:ffi_rng into d1ad41eef0d7039f79ac89d180f0d697936b09f1 on randombit:master.
Zooming out a bit: Perhaps this could be answered in the context of #4318. Essentially, for C++ we're experimenting with a new builder-style API to configure the public key operations. For instance:
auto rng = AutoSeeded_RNG{};
auto sk = create_private_key("RSA", rng);
auto signer = sk->signer()
.with_rng(rng)
.with_padding("PSS")
.with_hash("SHA-256")
/* ... */
.create();
signer.sign();
In #4318 there's an open TODO on how to expose this paradigm via the FFI. I don't have a concrete proposal at this point. But perhaps its worth thinking in that direction and finding a usable (generic) design for this before creating many more FFI function with _with_rng().
(Please don't take this as actual opposition to these new functions from my side. I just try to connect some loose ends here.)
In #4318 there's an open TODO on how to expose this paradigm via the FFI. I don't have a concrete proposal at this point. But perhaps its worth thinking in that direction and finding a usable (generic) design for this before creating many more FFI function with
_with_rng().
Thank you very much for the heads up, this is something to consider.
Some initial idea: https://github.com/randombit/botan/pull/4318#issuecomment-2451487304 The linked API suggestion is very much a work in progress. Feel free to join the discussion.