Skip to content

Commit

Permalink
v0.9.4 (#384)
Browse files Browse the repository at this point in the history
  • Loading branch information
tarcieri authored Nov 20, 2023
1 parent a26e7f5 commit 3eb4e38
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 4 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## 0.9.4 (2023-11-20)
### Added
- Deterministic implementation of prime factors recovery ([#380])

[#380]: https://github.com/RustCrypto/RSA/pull/380

## 0.9.3 (2023-10-26)
### Added
- PKCS#8/SPKI decoding trait impls for `pkcs1v15` keys ([#346])
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rsa"
version = "0.9.3"
version = "0.9.4"
authors = ["RustCrypto Developers", "dignifiedquire <dignifiedquire@gmail.com>"]
edition = "2021"
description = "Pure Rust RSA implementation"
Expand All @@ -22,7 +22,7 @@ subtle = { version = "2.1.1", default-features = false }
digest = { version = "0.10.5", default-features = false, features = ["alloc", "oid"] }
pkcs1 = { version = "0.7.5", default-features = false, features = ["alloc", "pkcs8"] }
pkcs8 = { version = "0.10.2", default-features = false, features = ["alloc"] }
signature = { version = "2", default-features = false , features = ["alloc", "digest", "rand_core"] }
signature = { version = ">2.0, <2.3", default-features = false , features = ["alloc", "digest", "rand_core"] }
spki = { version = "0.7.2", default-features = false, features = ["alloc"] }
zeroize = { version = "1.5", features = ["alloc"] }

Expand Down
14 changes: 13 additions & 1 deletion src/key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,19 @@ impl RsaPrivateKey {
RsaPrivateKey::from_components(components.n, components.e, components.d, components.primes)
}

/// Constructs an RSA key pair from the individual components.
/// Constructs an RSA key pair from individual components:
///
/// - `n`: RSA modulus
/// - `e`: public exponent (i.e. encrypting exponent)
/// - `d`: private exponent (i.e. decrypting exponent)
/// - `primes`: prime factors of `n`: typically two primes `p` and `q`. More than two primes can
/// be provided for multiprime RSA, however this is generally not recommended. If no `primes`
/// are provided, a prime factor recovery algorithm will be employed to attempt to recover the
/// factors (as described in [NIST SP 800-56B Revision 2] Appendix C.2). This algorithm only
/// works if there are just two prime factors `p` and `q` (as opposed to multiprime), and `e`
/// is between 2^16 and 2^256.
///
/// [NIST SP 800-56B Revision 2]: https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-56Br2.pdf
pub fn from_components(
n: BigUint,
e: BigUint,
Expand Down

0 comments on commit 3eb4e38

Please # to comment.