rsa/.github
Dmitry Baryshkov 574664808d
Internals refactoring (#304)
* feat: decouple key generation and random generation

Make generate_multi_prime_key_with_exp() generic enough to generate
abstract key structure. Rewrite RsaPrivateKey constructors to use
RsaPrivateKey::from_components().

* feat: move key-related traits to separate module

Move PublicKeyParts to the separate module.

* feat: stop using RsaPrivateKey in internals.rs

Make internals.rs generic enough to be moved to the algorithms module.

* feat: move soft RSA implementation to crate::algorithms::rsa.rs

Separate software RSA implementation to separate module under
crate::algorithms.

* key: drop raw_int_*_primitive wrappers

Now as raw_int_encryption_primitive() and raw_int_decryption_primitive()
became simple wrappers around properly defined functions we can inline
them and always use software RSA algorithm from src::algorithms::rsa.rs.

* feat: move internals.rs to src/algortihms/pad.rs

internals.rs now contains only small functions related to BigUint to
Vec<u8> conversion. Move them to src/algorithms/pad.rs and get rid of
internals.rs

* algorithms: protect all functions with pub(crate)

While it is expected that the functions inside algorithms crates might
be useful (and used) by other parties, they are low level functions and
as such impose a high risk of being misused. Protect all of them with
pub(crate) to prevent them from being exposed by mistake.

Also add big fat warnings to raw RSA functions, which should never be
used unless authors knows exactly what they are using.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
2023-04-23 16:53:21 -06:00
..
2023-04-23 16:53:21 -06:00