* 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>
65 lines
2.6 KiB
TOML
65 lines
2.6 KiB
TOML
[package]
|
|
name = "rsa"
|
|
version = "0.9.0-pre.2"
|
|
authors = ["RustCrypto Developers", "dignifiedquire <dignifiedquire@gmail.com>"]
|
|
edition = "2021"
|
|
description = "Pure Rust RSA implementation"
|
|
license = "MIT OR Apache-2.0"
|
|
documentation = "https://docs.rs/rsa"
|
|
repository = "https://github.com/RustCrypto/RSA"
|
|
keywords = ["rsa", "encryption", "security", "crypto"]
|
|
categories = ["cryptography"]
|
|
readme = "README.md"
|
|
rust-version = "1.65"
|
|
|
|
[dependencies]
|
|
num-bigint = { version = "0.8.2", features = ["i128", "u64_digit", "prime", "zeroize"], default-features = false, package = "num-bigint-dig" }
|
|
num-traits = { version= "0.2.9", default-features = false, features = ["libm"] }
|
|
num-integer = { version = "0.1.39", default-features = false }
|
|
num-iter = { version = "0.1.37", default-features = false }
|
|
rand_core = { version = "0.6.4", default-features = false }
|
|
byteorder = { version = "1.3.1", default-features = false }
|
|
const-oid = { version = "0.9", default-features = false }
|
|
subtle = { version = "2.1.1", default-features = false }
|
|
digest = { version = "0.10.5", default-features = false, features = ["alloc", "oid"] }
|
|
pkcs1 = { version = "0.7.3", default-features = false, features = ["alloc", "pkcs8"] }
|
|
pkcs8 = { version = "0.10.2", default-features = false, features = ["alloc"] }
|
|
signature = { version = "2", default-features = false , features = ["digest", "rand_core"] }
|
|
zeroize = { version = "1", features = ["alloc"] }
|
|
|
|
# optional dependencies
|
|
serde = { version = "1.0.103", optional = true, default-features = false, features = ["derive"] }
|
|
sha1 = { version = "0.10.5", optional = true, default-features = false, features = ["oid"] }
|
|
sha2 = { version = "0.10.6", optional = true, default-features = false, features = ["oid"] }
|
|
|
|
[dev-dependencies]
|
|
base64ct = { version = "1", features = ["alloc"] }
|
|
hex-literal = "0.3.3"
|
|
serde_test = "1.0.89"
|
|
rand_xorshift = "0.3"
|
|
rand_chacha = "0.3"
|
|
rand = "0.8"
|
|
rand_core = { version = "0.6", default-features = false }
|
|
sha1 = { version = "0.10.5", default-features = false, features = ["oid"] }
|
|
sha2 = { version = "0.10.6", default-features = false, features = ["oid"] }
|
|
sha3 = { version = "0.10.5", default-features = false, features = ["oid"] }
|
|
|
|
[[bench]]
|
|
name = "key"
|
|
|
|
[features]
|
|
default = ["std", "pem"]
|
|
getrandom = ["rand_core/getrandom"]
|
|
nightly = ["num-bigint/nightly"]
|
|
serde = ["dep:serde", "num-bigint/serde"]
|
|
pem = ["pkcs1/pem", "pkcs8/pem"]
|
|
pkcs5 = ["pkcs8/encryption"]
|
|
std = ["digest/std", "pkcs1/std", "pkcs8/std", "rand_core/std", "signature/std"]
|
|
|
|
[package.metadata.docs.rs]
|
|
features = ["std", "pem", "serde", "sha2"]
|
|
rustdoc-args = ["--cfg", "docsrs"]
|
|
|
|
[profile.dev]
|
|
opt-level = 2
|