commit_hash
stringlengths
40
40
author
stringlengths
1
57
date
timestamp[s]date
2010-07-26 04:45:09
2026-04-14 18:21:10
message
stringlengths
8
1.39M
diff
stringlengths
68
51.2k
files_changed
int64
1
136
insertions
int64
0
2.35k
deletions
int64
0
1.9k
6f82fd8227f17a6ab3e95957180c5352ad229c15
Tony Arcieri
2025-07-10T22:50:55
rsa: weakly activate encoding deps with `std` feature (#543) Don't implicitly activate them
diff --git a/Cargo.toml b/Cargo.toml index f589369..41f1e16 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -57,7 +57,7 @@ hazmat = [] os_rng = ["rand_core/os_rng", "crypto-bigint/rand_core"] serde = ["encoding", "dep:serde", "dep:serdect", "crypto-bigint/serde"] pkcs5 = ["pkcs8/encryption"] -std = ["pkcs1/std", "pkcs8/...
1
1
1
a31a1b5fc3789ed8455bdaa49acac664583f7f2f
Tony Arcieri
2025-07-10T15:35:43
v0.10.0-rc.3 (#542)
diff --git a/Cargo.lock b/Cargo.lock index eef3554..dd93284 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -519,7 +519,7 @@ checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "rsa" -version = "0.10.0-rc.2" +version = "0.10.0-rc.3" dependencies = [ "base64ct", "const-o...
2
4
4
3c82a6d95a21cb146546237acd2c218ec2a59894
Tony Arcieri
2025-07-10T15:20:45
Bump `crypto-bigint` to v0.7.0-pre.6 (#541)
diff --git a/Cargo.lock b/Cargo.lock index b2b2ad2..eef3554 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -136,9 +136,9 @@ dependencies = [ [[package]] name = "crypto-bigint" -version = "0.7.0-pre.5" +version = "0.7.0-pre.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a06a5e703b883b...
2
3
3
9969d227576cc8d46d420c9a9d6c0359a94e0b5c
Tony Arcieri
2025-07-10T03:59:00
v0.10.0-rc.2 (#540)
diff --git a/Cargo.lock b/Cargo.lock index 7fd3c0e..b2b2ad2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -51,9 +51,9 @@ checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" [[package]] name = "base64ct" -version = "1.7.3" +version = "1.8.0" source = "registry+https://github.com/rust-lang/cr...
2
25
81
6af80f63f9dc390c19de6388e309ff8ecd9592bb
Tony Arcieri
2025-07-10T03:51:51
Bump format crates to latest prereleases (#539) Bumps the following: - pkcs1 v0.8.0-rc.3 - pkcs8 v.11.0-rc.6 - spki v0.8.0-rc.4
diff --git a/Cargo.lock b/Cargo.lock index 92d1630..7fd3c0e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -178,9 +178,9 @@ dependencies = [ [[package]] name = "der" -version = "0.8.0-rc.6" +version = "0.8.0-rc.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7d571780ddd86c50ecbcf7099...
2
14
16
311879ae2a4ff94518317affa1214467d72eb8bb
Tony Arcieri
2025-07-10T02:03:32
Remove PKCS#8 blanket impls for PKCS#1 traits (#538) Companion PR to RustCrypto/formats#1927 which properly composes the PKCS#8 impl in terms of the PKCS#1 impl
diff --git a/Cargo.lock b/Cargo.lock index 9d59b07..92d1630 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -178,9 +178,9 @@ dependencies = [ [[package]] name = "der" -version = "0.8.0-rc.3" +version = "0.8.0-rc.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b00a9651bf9c00a38b7c383073...
4
125
70
34d5d4607e9e5625080ded2faf7230345fe68800
Tony Arcieri
2025-06-21T01:45:59
v0.10.0-rc.1 (#534) This notably includes the `crypto-bigint` v0.7.0-pre.5 upgrade
diff --git a/Cargo.lock b/Cargo.lock index 7adec20..9d59b07 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -570,7 +570,7 @@ checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "rsa" -version = "0.10.0-rc.0" +version = "0.10.0-rc.1" dependencies = [ "base64ct", "const-o...
2
2
2
c2fe37593716420b04e2989b6ec75eafd1e7be2e
Tony Arcieri
2025-06-18T14:59:30
Bump `crypto-bigint` to v0.7.0-pre.5 (#533) This notably adds `BoxedUint::from_be_slice_vartime` which has been used where appropriate, namely for parsing signatures
diff --git a/Cargo.lock b/Cargo.lock index 7b93a3f..7adec20 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -136,9 +136,9 @@ dependencies = [ [[package]] name = "crypto-bigint" -version = "0.7.0-pre.4" +version = "0.7.0-pre.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edaae5fb9dac79...
6
11
24
4631ab6463600bcae21701e6c5470d11cad33e8d
Tony Arcieri
2025-06-16T18:14:08
Have `RsaPrivateKey::from_components` convert `n` to `Odd` (#532) Changes the `n` parameter of this function from `Odd<BoxedUint>` to just `BoxedUint`, and converts to `Odd` internally, returning an error in the event the provided `n` is even. Previously this was a conversion the API caller had to do, which is a litt...
diff --git a/benches/key.rs b/benches/key.rs index ab4e4b4..5f52dab 100644 --- a/benches/key.rs +++ b/benches/key.rs @@ -3,7 +3,7 @@ extern crate test; use base64ct::{Base64, Encoding}; -use crypto_bigint::{BoxedUint, Odd}; +use crypto_bigint::BoxedUint; use hex_literal::hex; use rand_chacha::{rand_core::Seedable...
5
24
23
79641e1f2abb76091465630e91b5c1f197f9e0a2
Tony Arcieri
2025-06-16T15:57:11
Fix modulus size check in `check_public_with_max_size` (#529) It was checking the bits of precision, rather than the actual bit length of the key. Closes #528.
diff --git a/src/key.rs b/src/key.rs index ab52135..91b10aa 100644 --- a/src/key.rs +++ b/src/key.rs @@ -622,7 +622,7 @@ pub fn check_public(public_key: &impl PublicKeyParts) -> Result<()> { /// Check that the public key is well formed and has an exponent within acceptable bounds. #[inline] fn check_public_with_max_...
1
1
1
087c3d37b550d52d9a26eb0f61405f07215d469e
Arthur Gautier
2025-06-16T12:03:51
error: impl `core::error::Error` (#530)
diff --git a/src/errors.rs b/src/errors.rs index d90c48e..83f1bbd 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -74,8 +74,8 @@ pub enum Error { Rng, } -#[cfg(feature = "std")] -impl std::error::Error for Error {} +impl core::error::Error for Error {} + impl core::fmt::Display for Error { fn fmt(&self,...
1
2
2
1ffef57e6b62b8a7abf43ddc14dd3b0fd057a2ee
daxpedda
2025-06-03T12:40:53
Implement `MultipartSign/Verify` (#525) Implementation of `MultipartSigner` and `MultipartVerifier` added in https://github.com/RustCrypto/traits/pull/1880.
diff --git a/Cargo.lock b/Cargo.lock index dbcb584..7b93a3f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -736,9 +736,9 @@ dependencies = [ [[package]] name = "signature" -version = "3.0.0-rc.0" +version = "3.0.0-rc.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7ae074ff62261487480...
5
81
10
40a58a92e8561ce06b57197e0789b2ff8f59463f
Tony Arcieri
2025-06-02T11:53:25
Remove deprecated `pkcs1v15` methods (#524) In `rsa` v0.9 we changed these types to be prefixed-by-default, but retained and deprecated the `*_with_prefix` method names. Now that `master` is tracking the v0.10 release, we can remove these.
diff --git a/src/pkcs1v15.rs b/src/pkcs1v15.rs index 35751e3..65cea3a 100644 --- a/src/pkcs1v15.rs +++ b/src/pkcs1v15.rs @@ -89,14 +89,6 @@ impl Pkcs1v15Sign { prefix: Box::new([]), } } - - /// Create new PKCS#1 v1.5 padding for computing an unprefixed signature. - /// - /// This set...
3
0
26
184e71286a9a60d7796f36af4f9be728d490f8cb
Arthur Gautier
2025-05-30T23:38:40
chore(deps): use rc dependencies (#521) - `sha1` 0.11.0-rc.0 - `sha2` 0.11.0-rc.0 - `sha3` 0.11.0-rc.0 - `digest` 0.11.0-rc.0 - `signature` 0.3.0-rc.0 - `pkcs1` 0.8.0-rc.2 - `pkcs8` 0.11.0-rc.4 - `spki` 0.8.0-rc.2
diff --git a/Cargo.lock b/Cargo.lock index f0e8ec5..57e8f07 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,8 +4,9 @@ version = 4 [[package]] name = "aead" -version = "0.6.0-rc.0" -source = "git+https://github.com/RustCrypto/traits.git#915474f1ed5be0a19fd102d5f75ef8e04c765416" +version = "0.6.0-rc.1" +source = "regi...
2
86
109
cc7e734653913d59a1d1cb7a32b41fc02605d26a
Tony Arcieri
2025-05-27T19:40:25
Cargo.lock: bump dependencies (#520) Updates the following dependencies: Updating crates.io index Locking 23 packages to latest compatible versions Updating base64ct v1.7.1 -> v1.7.3 Updating bitflags v2.9.0 -> v2.9.1 Updating const-oid v0.10.0 -> v0.10.1 Updating crypto-bigint v0.7.0-pre.3 (http...
diff --git a/Cargo.lock b/Cargo.lock index 4ed24b6..f0e8ec5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -49,9 +49,9 @@ checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" [[package]] name = "base64ct" -version = "1.7.1" +version = "1.7.3" source = "registry+https://github.com/rust-lang/cr...
1
53
49
bac46c9a24592ef82842a07b12af3c4709fa36a7
Arthur Gautier
2025-05-27T19:14:27
chore(deps): use digest newtypes (#517)
diff --git a/Cargo.lock b/Cargo.lock index 3933f61..4ed24b6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5,17 +5,17 @@ version = 4 [[package]] name = "aead" version = "0.6.0-rc.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5f451b77e2f92932dc411da6ef9f3d33efad68a6f14a7a83e55945345...
2
46
40
731f5d37254f1b680ac60dd619f6b99104c0d915
Arthur Gautier
2025-05-24T19:00:34
PublicKeyParts: provide serialization helpers (#519) When serializing the exponent or the modulus from a key, `BoxedUint::to_be_bytes` will return a slice padded with zeroes on the left because of its inner representation. Not every implementation out there will handle leading zeroes. This provides a `PublicKeyParts:...
diff --git a/Cargo.lock b/Cargo.lock index bc9ee3f..3933f61 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -136,8 +136,7 @@ dependencies = [ [[package]] name = "crypto-bigint" version = "0.7.0-pre.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f727d84cf16cb51297e4388421e2e51b2f94ffe92...
4
17
2
b831df856f694dfdbba9727d739219acce0f9c81
Arthur Gautier
2025-05-13T22:17:21
chore(deps): bump `crypto-bigint` to `0.7.0-pre.3`; use core naming conventions (#516) See: - https://github.com/RustCrypto/crypto-bigint/pull/817
diff --git a/Cargo.lock b/Cargo.lock index b6be9a5..bc9ee3f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -135,9 +135,9 @@ dependencies = [ [[package]] name = "crypto-bigint" -version = "0.7.0-pre.2" +version = "0.7.0-pre.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87a5061ea0870b...
4
15
8
01c9228a547b9aaf761a768593bcb07552459440
Arthur Gautier
2025-05-06T19:18:34
bump signature git pin (#515) This removes the `derive` feature from `signature`: - https://github.com/RustCrypto/traits/pull/1843
diff --git a/Cargo.lock b/Cargo.lock index 365e024..b6be9a5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -725,7 +725,7 @@ dependencies = [ [[package]] name = "signature" version = "3.0.0-pre" -source = "git+https://github.com/RustCrypto/traits.git#ac5443909846354e11570e2968937a62f2019bed" +source = "git+https://githu...
1
1
1
471c06b15d3f5d735e4a34e7db9b56efce325014
Arthur Gautier
2025-05-04T02:03:59
chore(deps): bump `crypto-bigint` to `0.7.0-pre.2` (#514)
diff --git a/Cargo.lock b/Cargo.lock index ed1bba3..365e024 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -135,8 +135,9 @@ dependencies = [ [[package]] name = "crypto-bigint" -version = "0.7.0-pre.1" -source = "git+https://github.com/RustCrypto/crypto-bigint.git#cd2ccf3878739ecf9f2eb0b035587987c5f4dc47" +version = "0...
2
4
7
51c97844bd1190d16100b4711c79fdff07dffa2c
Arthur Gautier
2025-05-03T13:37:59
chore(deps): bump `signature` to `3.0.0-pre` (#513)
diff --git a/Cargo.lock b/Cargo.lock index 8c58741..ed1bba3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -723,8 +723,8 @@ dependencies = [ [[package]] name = "signature" -version = "2.3.0-pre.6" -source = "git+https://github.com/RustCrypto/traits.git#7b82f397511d68f823d06a0fe50867e9011dd0f0" +version = "3.0.0-pre" +...
2
4
4
96e059c5433ad2ba7ff81430f64e5ea4919b1f44
Bogdan Opanchuk
2025-04-28T00:28:50
Shorten widths of `BoxedUint`s (#506) Fixes #490 - Bump `crypto-bigint` dependency to the current trunk. - Use the width of a single prime instead of the full modulus where possible. Brings `bench_rsa_2048_pkcsv1_decrypt` to pre-`crypto-bigint` values. - Add a check to `RsaPrivateKey::from_components()` to ensure co...
diff --git a/Cargo.lock b/Cargo.lock index 7ccfc9a..8c58741 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -135,8 +135,8 @@ dependencies = [ [[package]] name = "crypto-bigint" -version = "0.7.0-pre.0" -source = "git+https://github.com/RustCrypto/crypto-bigint.git#2734f1852d9a713dc92183bb6e2d4b987f1e38f1" +version = "0...
13
190
87
cba78063a10fd76d10569653a8372c2af395f414
Arthur Gautier
2025-04-13T22:17:32
Bump pin for crypto-primes (#504)
diff --git a/Cargo.lock b/Cargo.lock index 90446ca..7ccfc9a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -157,7 +157,7 @@ dependencies = [ [[package]] name = "crypto-primes" version = "0.7.0-dev" -source = "git+https://github.com/entropyxyz/crypto-primes.git#dfc396609a8fdaab895976933edad36c06de8a19" +source = "git+ht...
2
10
8
a9fcf2275ba1afbf43cdd418059aa6b944c7dd97
Marshall Pierce
2025-03-13T14:41:38
Make SigningKey::from use Self::new() (#498) This matches https://github.com/RustCrypto/RSA/pull/472.
diff --git a/src/pkcs1v15/signing_key.rs b/src/pkcs1v15/signing_key.rs index a354acc..badef88 100644 --- a/src/pkcs1v15/signing_key.rs +++ b/src/pkcs1v15/signing_key.rs @@ -197,10 +197,10 @@ where impl<D> From<RsaPrivateKey> for SigningKey<D> where - D: Digest, + D: Digest + AssociatedOid, { fn from(key...
2
59
2
52425b5b7a90ee5daf2ef615d1ab59226efc2396
Artyom Pavlov
2025-03-12T16:10:15
Fix `manual_div_ceil` Clippy lint (#492)
diff --git a/src/algorithms/pss.rs b/src/algorithms/pss.rs index db58584..78cdd27 100644 --- a/src/algorithms/pss.rs +++ b/src/algorithms/pss.rs @@ -25,7 +25,7 @@ pub(crate) fn emsa_pss_encode( // See [1], section 9.1.1 let h_len = hash.output_size(); let s_len = salt.len(); - let em_len = (em_bits + ...
2
7
7
c8955c92c7c680245a7928bf97f52af16a0b6be2
Artyom Pavlov
2025-03-12T16:01:57
Bump `hex-literal` to v1 (#491)
diff --git a/Cargo.lock b/Cargo.lock index 3cf4b43..90446ca 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -50,9 +50,9 @@ checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" [[package]] name = "base64ct" -version = "1.6.0" +version = "1.7.1" source = "registry+https://github.com/rust-lang/cr...
2
51
78
5935935f93acea3d244f4d3ff70d9e88fa703951
Friedel Ziegelmayer
2025-03-12T15:54:43
fix: ensure Debug implementations do not leak private info (#480)
diff --git a/src/key.rs b/src/key.rs index 641b9a0..250ad13 100644 --- a/src/key.rs +++ b/src/key.rs @@ -1,5 +1,7 @@ use alloc::vec::Vec; +use core::fmt; use core::hash::{Hash, Hasher}; + use crypto_bigint::modular::{BoxedMontyForm, BoxedMontyParams}; use crypto_bigint::{BoxedUint, Integer, NonZero, Odd}; use rand...
1
20
2
9e7faa42bf84ee5a8487012303cf50f297f91f4c
Arthur Gautier
2025-02-14T15:45:45
chore: remove git dependencies on pkcs1/pkcs8
diff --git a/Cargo.lock b/Cargo.lock index 011651e..81d2f1c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -385,7 +385,8 @@ dependencies = [ [[package]] name = "pkcs1" version = "0.8.0-rc.1" -source = "git+https://github.com/RustCrypto/formats.git#c2bbe3308b2338954581e7125dbefb23d6519474" +source = "registry+https://gi...
2
6
8
d7fa156456f95019819219cbb4685baf5a385ded
Tony Arcieri
2025-02-14T02:19:33
v0.10.0-pre.4 (#474) Notably includes #394 which migrates to `crypto-bigint`
diff --git a/Cargo.lock b/Cargo.lock index 3f3732e..5476f5d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -511,7 +511,7 @@ checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "rsa" -version = "0.10.0-pre.3" +version = "0.10.0-pre.4" dependencies = [ "base64ct", "const...
2
2
2
84dde17837de56bb1abcbc7de3186707d5edea9b
Bogdan Opanchuk
2025-02-14T01:41:19
Use a direct formula to calculate `log(2^x)` (#475) Replaces the current approximate `logf()` which we don't really need for this specific form of the argument. Note: I am not sure why we calculate `log(2^floor(bit_size / nprimes))` while we could just as well calculate `log(2^(bit_size/nprimes))`, but I left that pa...
diff --git a/src/algorithms/generate.rs b/src/algorithms/generate.rs index 8475bb4..cc2d293 100644 --- a/src/algorithms/generate.rs +++ b/src/algorithms/generate.rs @@ -45,7 +45,10 @@ pub(crate) fn generate_multi_prime_key_with_exp<R: CryptoRngCore>( let prime_limit = (1u64 << (bit_size / nprimes) as u64) as f...
1
4
42
8e8bd6ae645b8b4cd9134e2ff30ff1baabc70d9f
Arthur Gautier
2025-02-13T19:52:54
oaep: support non-string labels (#467) This rework oaep to support non-string labels. One use-case is encryption of secrets in TPM. https://trustedcomputinggroup.org/wp-content/uploads/TPM-2.0-1.83-Part-1-Architecture.pdf#page=297 > # Section B.4 RSAES_OAEP > > For RSA keys protecting a secret value (such as, an enc...
diff --git a/src/algorithms/oaep.rs b/src/algorithms/oaep.rs index 37bfaa3..b2a5102 100644 --- a/src/algorithms/oaep.rs +++ b/src/algorithms/oaep.rs @@ -1,6 +1,6 @@ //! Encryption and Decryption using [OAEP padding](https://datatracker.ietf.org/doc/html/rfc8017#section-7.1). //! -use alloc::string::String; +use alloc...
4
40
64
b019aa15d50f0a80375a7cd546f6783d6d20d70f
Arthur Gautier
2025-02-05T17:09:21
pkcs1v15: VerifyingKey::from to use prefixed version (#472) As discussed in #341, `pkcs1v15::VerifyingKey::from` should use the prefixed keys. Just lost a couple hours on this one behavior, and since 0.10 is just around the corner, might as well fix it before that. Fixes #341
diff --git a/src/pkcs1v15/verifying_key.rs b/src/pkcs1v15/verifying_key.rs index fa23e8f..d988af2 100644 --- a/src/pkcs1v15/verifying_key.rs +++ b/src/pkcs1v15/verifying_key.rs @@ -170,10 +170,10 @@ where impl<D> From<RsaPublicKey> for VerifyingKey<D> where - D: Digest, + D: Digest + AssociatedOid, { fn...
1
2
2
9956b8f898fdb79d055219608d4e257c9ea30a70
Friedel Ziegelmayer
2024-12-17T11:06:16
fix: handle odd keys (#459) Ther are two issues with oddly formed keys that were not properly handled - avoid using `-` to avoid a subtraction with overflow for pkcs - always validate the key in `from_components` to avoid errors in the internal `precompute`
diff --git a/src/algorithms/pkcs1v15.rs b/src/algorithms/pkcs1v15.rs index c1f0779..e813de1 100644 --- a/src/algorithms/pkcs1v15.rs +++ b/src/algorithms/pkcs1v15.rs @@ -41,7 +41,7 @@ pub(crate) fn pkcs1v15_encrypt_pad<R>( where R: CryptoRngCore + ?Sized, { - if msg.len() > k - 11 { + if msg.len() + 11 > k ...
2
15
10
324c5674d505db3ce6744377e412a37402d793cd
Arthur Gautier
2024-10-08T01:00:51
0.10.0 pre.3 (#452)
diff --git a/Cargo.lock b/Cargo.lock index b22274f..2f7a2e2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -515,7 +515,7 @@ checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" [[package]] name = "rsa" -version = "0.10.0-pre.2" +version = "0.10.0-pre.3" dependencies = [ "base64ct", "const...
2
2
2
a39a5e53c4d1d48e349c05237a678f90bac64733
Arthur Gautier
2024-09-14T20:05:33
pss: expose salt len in the verifyingkey (#448) Some vendor serialization (NDA :() of signature and public keys will need the size of the salt that was used for signature. Sadly this is only exposed in the signing key (which may be out of reach (HSM)).
diff --git a/src/pss/verifying_key.rs b/src/pss/verifying_key.rs index 2fd62d3..8c4af74 100644 --- a/src/pss/verifying_key.rs +++ b/src/pss/verifying_key.rs @@ -46,6 +46,11 @@ where phantom: Default::default(), } } + + /// Return specified salt length for this key + pub fn salt_len(&sel...
1
5
0
aeedb5adf5297892fcb9e11f7c0f6c0157005c58
Arthur Gautier
2024-09-05T23:34:06
pkcs8 API changes (#446) see https://github.com/RustCrypto/formats/pull/1483
diff --git a/Cargo.lock b/Cargo.lock index 6e7678f..14f4f51 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -371,8 +371,7 @@ dependencies = [ [[package]] name = "pkcs1" version = "0.8.0-rc.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d2f4c73d459a85331915baebd5082dce5ee8ef16fd9a1ca75...
6
21
14
5de518cd8969cb5a5a229ea4006d051595d5cc27
Tony Arcieri
2024-07-28T00:33:53
v0.10.0-pre.2 (#444)
diff --git a/Cargo.lock b/Cargo.lock index 68a4216..8143ebf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -517,7 +517,7 @@ checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" [[package]] name = "rsa" -version = "0.10.0-pre.1" +version = "0.10.0-pre.2" dependencies = [ "base64ct", "const...
2
2
2
eb412a1562834162522af9a56eca905d3385621d
Tony Arcieri
2024-07-28T00:12:47
Use latest prereleases (#443) Bumps the following dependencies to their latest prerelease versions: - `const-oid` v0.10.0-rc.0 - `digest` v0.11.0-pre.9 - `pkcs1` v0.8.0-rc.0 - `pkcs8` v0.11.0-rc.0 - `signature` v2.3.0-pre.4 - `spki` v0.8.0-rc.0 - `sha1` v0.11.0-pre.4 - `sha2` v0.11.0-pre.4 Note: `pkcs5` i...
diff --git a/Cargo.lock b/Cargo.lock index 8e074dd..68a4216 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,17 +2,40 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "aead" +version = "0.6.0-rc.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5f451b77e2f9...
2
145
128
c66690221bbbef9a912adbbd6cfc518a827720f7
Gabriele Musco
2024-07-08T19:36:12
fix: remove oaep decrypt key size limit (#418) (#441) As per #418, let me know if this is the preferred way or if you'd rather remove the limit some other way Co-authored-by: Gabriele Musco <gabmus@disroot.org>
diff --git a/src/oaep.rs b/src/oaep.rs index 0cbd1e3..31c0705 100644 --- a/src/oaep.rs +++ b/src/oaep.rs @@ -240,8 +240,6 @@ fn decrypt<R: CryptoRngCore + ?Sized>( mgf_digest: &mut dyn DynDigest, label: Option<String>, ) -> Result<Vec<u8>> { - key::check_public(priv_key)?; - if ciphertext.len() != pr...
1
0
2
e6c4db707b662eb2afcc12d4b693f1e203ecd4fd
Artyom Pavlov
2024-06-26T14:15:39
Tweak OAEP's `MAX_LABEL_LEN` constant (#437)
diff --git a/src/algorithms/oaep.rs b/src/algorithms/oaep.rs index 0ba2de9..37bfaa3 100644 --- a/src/algorithms/oaep.rs +++ b/src/algorithms/oaep.rs @@ -11,9 +11,12 @@ use zeroize::Zeroizing; use super::mgf::{mgf1_xor, mgf1_xor_digest}; use crate::errors::{Error, Result}; -// 2**61 -1 (pow is not const yet) -// TOD...
1
10
7
429a137a4b2cf1331d24f5682286684771d7cac1
Tony Arcieri
2024-06-05T15:14:24
Cargo.lock: bump dependencies (#433) Updates the following dependencies: $ cargo update Updating crates.io index Updating aes v0.8.3 -> v0.8.4 Updating autocfg v1.1.0 -> v1.3.0 Removing bitflags v1.3.2 Removing bitflags v2.4.1 Adding bitflags v2.5.0 Updating cpufeatures v0.2...
diff --git a/Cargo.lock b/Cargo.lock index ddfc86f..8e074dd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "aes" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac1f845298e95f983ff1944b728ae08b8cebab80d684f...
1
73
83
4512b5a59e5c9ff6dbdb46cacafaeb540997e296
Lasse Edslev
2024-04-05T01:26:17
added serdect support (#420) Co-authored-by: Tony Arcieri <bascule@gmail.com>
diff --git a/Cargo.lock b/Cargo.lock index be2f48c..ddfc86f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -19,6 +19,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +[[package]] +name = "base16ct" +ve...
15
661
82
4cb8aece0b8f2c3f85d752c15afb94f5d546bd26
Tony Arcieri
2024-02-06T16:09:41
v0.10.0-pre.1 (#411)
diff --git a/Cargo.lock b/Cargo.lock index 0fae987..be2f48c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -504,7 +504,7 @@ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "rsa" -version = "0.10.0-pre.0" +version = "0.10.0-pre.1" dependencies = [ "base64ct", "const...
2
2
2
4097f17fee4a1280ed162d84f3053fe60e42a8d8
Arthur Gautier
2024-02-06T12:46:39
Bump digest/signature dependencies to new prereleases (#410) Bumps the following: - `digest` v0.11.0-pre.8 - `signature` v2.3.0-pre.3 - `sha1` v0.11.0-pre.3 - `sha2` v0.11.0-pre.3
diff --git a/Cargo.lock b/Cargo.lock index e50aa01..0fae987 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -63,11 +63,11 @@ dependencies = [ [[package]] name = "block-buffer" -version = "0.11.0-pre.4" +version = "0.11.0-pre.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0edadbde8e024...
2
32
32
c1205ff208fe769fe34c65d7cb6a261818c51588
Tony Arcieri
2024-01-19T21:45:48
v0.10.0-pre.0 (#406)
diff --git a/Cargo.lock b/Cargo.lock index dfa6027..e50aa01 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -504,7 +504,7 @@ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "rsa" -version = "0.10.0-pre" +version = "0.10.0-pre.0" dependencies = [ "base64ct", "const-o...
2
2
2
dfb719fcac81929f899c2eed156d1bb3359db557
Tony Arcieri
2024-01-19T21:13:17
Bump version to v0.10.0-pre (#403) NOTE: not for release. This signifies that we are going to make breaking changes to the `master` branch which are incompatible with v0.9 releases. The first prerelease of this series published to crates.io will be v0.10.0-pre.0 at some point in the future.
diff --git a/Cargo.toml b/Cargo.toml index e4b2265..86da55c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rsa" -version = "0.9.6" +version = "0.10.0-pre" authors = ["RustCrypto Developers", "dignifiedquire <dignifiedquire@gmail.com>"] edition = "2021" description = "Pure Rust RSA imple...
1
1
1
cef3942178fc34b04dfc14f80c2cf309bff4ed26
Tony Arcieri
2024-01-19T20:52:13
Fix unused import warnings (#404) Newer versions of rustc report these. They were previously ignored because they were `pub use`, but inside of a non-`pub` module.
diff --git a/src/pkcs1v15/signature.rs b/src/pkcs1v15/signature.rs index a640da3..a07b646 100644 --- a/src/pkcs1v15/signature.rs +++ b/src/pkcs1v15/signature.rs @@ -1,17 +1,14 @@ -pub use ::signature::{ - hazmat::{PrehashSigner, PrehashVerifier}, - DigestSigner, DigestVerifier, Error, Keypair, RandomizedDigestSig...
2
13
19
7803ce534ec94dc08b591c8c3bb434f8207a9dde
Arthur Gautier
2023-11-29T21:55:44
pkcs1v15: expose `RsaSignatureAssociatedOid` (#392) This allows reuse of the `RsaSignatureAssociatedOid` trait to pull implementation of `SignatureAlgorithmIdentifier` in other crates (like `yubihsm.rs`).
diff --git a/src/pkcs1v15.rs b/src/pkcs1v15.rs index 4600aeb..aa572c5 100644 --- a/src/pkcs1v15.rs +++ b/src/pkcs1v15.rs @@ -222,7 +222,7 @@ mod oid { use const_oid::ObjectIdentifier; /// A trait which associates an RSA-specific OID with a type. - pub(crate) trait RsaSignatureAssociatedOid { + pub tra...
1
3
1
7341cd0159d49464f7f3639c998c4b66d6bf9e49
Arthur Gautier
2023-11-29T21:54:56
pss: expose a `get_default_pss_signature_algo_id` helper (#393) This returns the `AlgorithmIdentifierOwned` assuming the default situation where the salt_len is the `output_size` of the `Digest`. This is meant to be used by HSM where the private key is hidden behind an abstraction but to still expose a `DynSignat...
diff --git a/src/pss.rs b/src/pss.rs index dd6ebcc..e0b9413 100644 --- a/src/pss.rs +++ b/src/pss.rs @@ -227,6 +227,15 @@ fn sign_pss_with_salt_digest<T: CryptoRngCore + ?Sized, D: Digest + FixedOutputR ) } +/// Returns the [`AlgorithmIdentifierOwned`] associated with PSS signature using a given digest. +pub fn...
1
9
0
a26e7f563cd53f180a0da263397dd8bcb1ae78d8
Tony Arcieri
2023-11-20T19:53:32
Cargo.lock: bump dependencies (#383) Updates the following dependencies: $ cargo update Updating crates.io index Updating bitflags v2.4.0 -> v2.4.1 Updating byteorder v1.4.3 -> v1.5.0 Removing cc v1.0.83 Updating cpufeatures v0.2.9 -> v0.2.11 Updating errno v0.3.4 -> v0.3.7 Re...
diff --git a/Cargo.lock b/Cargo.lock index 5091668..1750cf1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -48,9 +48,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/cr...
1
44
64
341f06f4496cef53a5bb7640876c3d023daf13ee
Tony Arcieri
2023-11-11T19:29:55
OAEP example now uses `sha2` re-export (#381) People were missing that the example required the `sha2` crate as a dependency. See #340. This changes it to use the re-exported `sha2` crate and notes that the `sha2` feature must be enabled.
diff --git a/src/lib.rs b/src/lib.rs index d9fe6b1..2232f37 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -18,8 +18,12 @@ //! # Usage //! //! ## OAEP encryption -//! ``` -//! use rsa::{RsaPrivateKey, RsaPublicKey, Oaep}; +//! +//! Note: requires `sha2` feature of `rsa` crate is enabled. +//! +#![cfg_attr(feature = "sh...
1
8
4
b513ee399837ba38796a6336d9e1501c2c0e195e
Zach Heylmun
2023-11-11T18:10:42
Deterministic implementation of prime factors recovery (#380) Implements deterministic recovery of `p` and `q` from `n`, `e,` and `d` using the algorithm specified in NIST 800-56B Appendix C.2
diff --git a/src/algorithms/rsa.rs b/src/algorithms/rsa.rs index 3480acd..6473f37 100644 --- a/src/algorithms/rsa.rs +++ b/src/algorithms/rsa.rs @@ -3,9 +3,10 @@ use alloc::borrow::Cow; use alloc::vec::Vec; use num_bigint::{BigInt, BigUint, IntoBigInt, IntoBigUint, ModInverse, RandBigInt, ToBigInt}; -use num_traits:...
3
98
6
3a2906675aa7e1e91da6b1e191a0e9b5fdf50614
Tony Arcieri
2023-10-03T13:35:48
Cargo.lock: update dependencies (#371) Bumps the following dependencies: $ cargo update Updating crates.io index Updating errno v0.3.2 -> v0.3.4 Updating fastrand v2.0.0 -> v2.0.1 Updating libc v0.2.147 -> v0.2.148 Updating linux-raw-sys v0.4.5 -> v0.4.8 Updating proc-macro2 v1.0.6...
diff --git a/Cargo.lock b/Cargo.lock index c08807e..5f5d0aa 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -160,9 +160,9 @@ dependencies = [ [[package]] name = "errno" -version = "0.3.2" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b30f669a7961ef1631673d2766cc92f52...
1
34
34
c04c65447e898c29379cc05e764ed48294dd0187
Uli Schlachter
2023-08-18T12:53:24
Remove unused dependencies (#357) Signed-off-by: Uli Schlachter <psychon@znc.in>
diff --git a/Cargo.lock b/Cargo.lock index f97d5be..0fbc4b1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -508,13 +508,11 @@ name = "rsa" version = "0.9.2" dependencies = [ "base64ct", - "byteorder", "const-oid", "digest", "hex-literal", "num-bigint-dig", "num-integer", - "num-iter", "num-traits", "pkcs...
2
0
4
aed51e718df86c07711c123b9144ad5ccb36bea5
Tony Arcieri
2023-06-29T20:29:22
Impl PKCS#8/SPKI decoding traits for `pkcs1v15` keys (#346) Adds PKCS#8 (and via blanket impl, PKCS#1) and SPKI decoding trait support to `pkcs1v15::{SigningKey, VerifyingKey}`. Also adds basic tests that decoding and encoding works.
diff --git a/src/pkcs1v15/signing_key.rs b/src/pkcs1v15/signing_key.rs index 66bc2b9..2475458 100644 --- a/src/pkcs1v15/signing_key.rs +++ b/src/pkcs1v15/signing_key.rs @@ -29,36 +29,6 @@ where phantom: PhantomData<D>, } -impl<D> SigningKey<D> -where - D: Digest, -{ - /// Create a new signing key from the...
3
91
50
c7b0eae935d5c434c78e0a78ba79df1654146ede
Tony Arcieri
2023-06-29T19:14:12
Add clarifying comment for totient check in key generation (#345) See #343 where it wasn't entirely clear
diff --git a/src/algorithms/generate.rs b/src/algorithms/generate.rs index fff895d..8908fd0 100644 --- a/src/algorithms/generate.rs +++ b/src/algorithms/generate.rs @@ -104,6 +104,8 @@ pub(crate) fn generate_multi_prime_key_with_exp<R: CryptoRngCore + ?Sized>( continue 'next; } + // NOTE:...
1
2
0
b65f352299c8535df7271600dbd04ea6060ba1e3
tison
2023-05-12T21:18:26
pkcs1v15: add regression test (#332) Signed-off-by: tison <wander4096@gmail.com>
diff --git a/tests/pkcs1v15.rs b/tests/pkcs1v15.rs new file mode 100644 index 0000000..2b42ed7 --- /dev/null +++ b/tests/pkcs1v15.rs @@ -0,0 +1,23 @@ +// simple but prevent regression - see https://github.com/RustCrypto/RSA/issues/329 +#[cfg(feature = "pem")] +#[test] +fn signature_stringify() { + use pkcs8::DecodeP...
1
23
0
09254b0ab559238c66d52b8896d11f0d6661fb33
Tony Arcieri
2023-05-08T13:04:05
pkcs1v15: have `fmt` impls call `SignatureEncoding::to_bytes` (#330) The `fmt::{LowerHex, UpperHex}` impls, with the latter called vicariously via `fmt::Display`, were showing the unpadded signature rather than the padded one. This changes these impls to call `SignatureEncoding::to_bytes` first before displaying...
diff --git a/src/pkcs1v15/signature.rs b/src/pkcs1v15/signature.rs index 552ab4f..a640da3 100644 --- a/src/pkcs1v15/signature.rs +++ b/src/pkcs1v15/signature.rs @@ -61,13 +61,19 @@ impl Debug for Signature { impl LowerHex for Signature { fn fmt(&self, f: &mut Formatter<'_>) -> core::fmt::Result { - write...
1
8
2
7a58281a055faaef87e6bba8868c0c57afacdf3f
Arthur Gautier
2023-05-04T23:12:43
Adds support for the `SignatureBitStringEncoding` trait (#328)
diff --git a/Cargo.lock b/Cargo.lock index ee7950d..1e351bd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -536,6 +536,7 @@ dependencies = [ "sha2", "sha3", "signature", + "spki", "subtle", "zeroize", ] @@ -671,9 +672,9 @@ checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" [[packag...
4
25
3
1d1037b912e0fd8e72a0c4e80f02eeb7c700cc82
Tony Arcieri
2023-05-04T00:50:04
Initial proptests (#326) Adds proptests for RSASSA-PKCS1-v1_5. Includes a commented-out test for RSASSA-PSS which is currently failing.
diff --git a/Cargo.lock b/Cargo.lock index 3280c65..2374ad1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -25,6 +25,27 @@ version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" +[[package]] +name = "bit-set" +ver...
3
375
2
53bb256451e8988c336a0ee5fedb0468349d2671
Tony Arcieri
2023-05-04T00:34:50
Left pad signatures when encoding (#325) The `SignatureEncoding` impl added in `rsa` v0.9 (or more specifically, the `From<Signature>` impl for `Box<[u8]>` failed to properly left pad the signatures so they matched the modulus size. This adds the appropriate padding to the signature encoder.
diff --git a/src/pkcs1v15/signature.rs b/src/pkcs1v15/signature.rs index ea57b34..f5dcaa9 100644 --- a/src/pkcs1v15/signature.rs +++ b/src/pkcs1v15/signature.rs @@ -4,6 +4,7 @@ pub use ::signature::{ SignatureEncoding, Signer, Verifier, }; +use crate::algorithms::pad::uint_to_be_pad; use alloc::{boxed::Box, st...
2
8
2
94856ec765986b9b04a9a84cae0cccd552c2c06d
Tony Arcieri
2023-05-03T23:13:52
pkcs1v15: note `RSASSA-PKCS1-v1_5` in docs (#324) This is the name for PKCS#1v1.5 signatures originally specified in RFC3447 but is also used by RFC8017 (which we cite)
diff --git a/src/pkcs1v15.rs b/src/pkcs1v15.rs index 1beca6a..4600aeb 100644 --- a/src/pkcs1v15.rs +++ b/src/pkcs1v15.rs @@ -56,7 +56,7 @@ impl PaddingScheme for Pkcs1v15Encrypt { } } -/// Digital signatures using PKCS#1 v1.5 padding. +/// `RSASSA-PKCS1-v1_5`: digital signatures using PKCS#1 v1.5 padding. #[de...
4
4
4
ec499565f964976c24f565cae2d8a3c651190b72
Tony Arcieri
2023-04-27T15:23:58
Replace `Deref` impl on `RsaPrivateKey` with `AsRef` (#317) The `RsaPrivateKey` type previously had a `Deref` impl providing access to the associated `RsaPublicKey`. `Deref` is intended for "smart pointer types", i.e. container types which manage a (typically generic) inner type in some way. This doesn't seem li...
diff --git a/src/key.rs b/src/key.rs index 2a6c788..b9cfd86 100644 --- a/src/key.rs +++ b/src/key.rs @@ -1,8 +1,5 @@ use alloc::vec::Vec; -use core::{ - hash::{Hash, Hasher}, - ops::Deref, -}; +use core::hash::{Hash, Hasher}; use num_bigint::traits::ModInverse; use num_bigint::Sign::Plus; use num_bigint::{Big...
2
16
18
db2559faa73a6c7f76e874dbb091d80ea3884ffe
Tony Arcieri
2023-04-27T14:23:41
Add comments to fields of `RsaPublicKey` (#316)
diff --git a/src/key.rs b/src/key.rs index ff0d555..2a6c788 100644 --- a/src/key.rs +++ b/src/key.rs @@ -23,7 +23,12 @@ use crate::CrtValue; #[derive(Debug, Clone, Hash, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub struct RsaPublicKey { + /// Modulus: product of prime numbers...
1
5
0
d9968bc0c9aa465dda5f8a4e4ba57d1989ba5ed4
Tony Arcieri
2023-04-27T13:39:37
Refactor traits (#315) There were several modules that defined traits, including one called `traits`. This consolidates all of them under `traits`, retaining the previous module structure as internal submodules: - `keytraits` => `traits::keys` - `padding` => `traits::padding` - `traits` => `traits::encryptio...
diff --git a/src/algorithms/rsa.rs b/src/algorithms/rsa.rs index 2fa5d2d..51299e5 100644 --- a/src/algorithms/rsa.rs +++ b/src/algorithms/rsa.rs @@ -8,7 +8,7 @@ use rand_core::CryptoRngCore; use zeroize::Zeroize; use crate::errors::{Error, Result}; -use crate::keytraits::{PrivateKeyParts, PublicKeyParts}; +use crat...
13
66
59
a8bddc2f6bc16a908f6fe0729d1fbfd51034c384
Tony Arcieri
2023-04-27T13:39:25
Add `u64_digit` feature (#313) Adds an on-by-default feature which enables `num-bigint-dig/u64_digit`. Disabling this on 32-bit platforms (e.g. WASM) should improve performance. Closes #252
diff --git a/Cargo.toml b/Cargo.toml index ffe5a5a..8e8514c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,7 +13,7 @@ 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-di...
1
3
2
6d915b30f86d9182f4f1a661d92f3b886ce01002
Tony Arcieri
2023-04-27T02:26:44
Rename `CRTValue` => `CrtValue` (#314) Follows RFC430 (C-CASE) https://rust-lang.github.io/api-guidelines/naming.html
diff --git a/src/key.rs b/src/key.rs index 9cfda57..ef82d3e 100644 --- a/src/key.rs +++ b/src/key.rs @@ -16,7 +16,7 @@ use zeroize::{Zeroize, ZeroizeOnDrop}; use crate::algorithms::generate::generate_multi_prime_key_with_exp; use crate::dummy_rng::DummyRng; use crate::errors::{Error, Result}; -use crate::keytraits::...
3
10
10
78ea9cb7dabb9d360aa1ad2d8e91f64c1e7d62eb
Tony Arcieri
2023-04-26T16:39:18
Impl `ZeroizeOnDrop` for `RsaPrivateKey`+newtypes (#311) `RsaPrivateKey` self-zeroizes on drop, so add the `ZeroizeOnDrop` marker trait to `RsaPrivateKey` and all newtypes thereof, i.e. `DecryptingKey` and `SigningKey` for the various padding modes. This also removes the `Zeroize` impl on `RsaPrivateKey`, since i...
diff --git a/Cargo.toml b/Cargo.toml index 12618e0..ffe5a5a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -25,7 +25,7 @@ digest = { version = "0.10.5", default-features = false, features = ["alloc", "o pkcs1 = { version = "0.7.5", default-features = false, features = ["alloc", "pkcs8"] } pkcs8 = { version = "0.10.2", d...
5
27
19
b1151dfb0eef9f8026fe1521b69b019158b99ec0
Tony Arcieri
2023-04-25T14:48:24
v0.9.0-rc.0 (#309)
diff --git a/Cargo.lock b/Cargo.lock index af5bc00..89125b1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -369,7 +369,7 @@ dependencies = [ [[package]] name = "rsa" -version = "0.9.0-pre.2" +version = "0.9.0-rc.0" dependencies = [ "base64ct", "byteorder", diff --git a/Cargo.toml b/Cargo.toml index 650bc66..12618...
2
2
2
c012868118de9670c946e3262ed03e6bbc5d2b0c
Tony Arcieri
2023-04-25T14:37:01
Impl `core::hash::Hash` for `RsaPrivateKey` (#308) Adds an impl which hashes only the public key components, along with a domain separator string (`RsaPrivateKey`). Closes #165
diff --git a/src/key.rs b/src/key.rs index 597aa9f..0923228 100644 --- a/src/key.rs +++ b/src/key.rs @@ -1,5 +1,8 @@ use alloc::vec::Vec; -use core::ops::Deref; +use core::{ + hash::{Hash, Hasher}, + ops::Deref, +}; use num_bigint::traits::ModInverse; use num_bigint::Sign::Plus; use num_bigint::{BigInt, BigUi...
1
12
2
faabaa71418f9f99f6f616d4441afa4efc482743
Tony Arcieri
2023-04-25T14:36:46
Improved public key checks (#307) Adds the following checks: - `n` is odd - `e` is odd - `e` < `n` Closes #99
diff --git a/src/key.rs b/src/key.rs index a1fa6c5..597aa9f 100644 --- a/src/key.rs +++ b/src/key.rs @@ -3,6 +3,7 @@ use core::ops::Deref; use num_bigint::traits::ModInverse; use num_bigint::Sign::Plus; use num_bigint::{BigInt, BigUint}; +use num_integer::Integer; use num_traits::{FromPrimitive, One, ToPrimitive}; ...
1
9
0
b55c75ec39be27b2a586742820f0c79727db4d96
Tony Arcieri
2023-04-25T14:36:26
Ensure signatures have right length and don't overflow (#306) In both the PKCS#1v1.5 and PSS implementations, checks the signature value to ensure it does not overflow the modulus. In the PKCS#1v1.5 implementation, checks the signature length to ensure it matches the public key size. The PSS implementation was al...
diff --git a/src/pkcs1v15.rs b/src/pkcs1v15.rs index 88c9190..ce7e769 100644 --- a/src/pkcs1v15.rs +++ b/src/pkcs1v15.rs @@ -133,6 +133,7 @@ impl SignatureScheme for Pkcs1v15Sign { self.prefix.as_ref(), hashed, &BigUint::from_bytes_be(sig), + sig.len(), ) ...
2
25
3
bd14ee90b6ec75f2490d4990347cc401f0489d42
Tony Arcieri
2023-04-24T19:43:49
Bump `pkcs1` dependency to v0.7.5 (#305) Workaround for RustCrypto/formats#1021
diff --git a/Cargo.lock b/Cargo.lock index 690cdd6..af5bc00 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -268,14 +268,13 @@ dependencies = [ [[package]] name = "pkcs1" -version = "0.7.3" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a80397ccad3b40508254eee787bcd28...
2
3
4
4df2262960f97dc1e9c217db88903d741a9f67c2
Tony Arcieri
2023-04-19T15:46:14
Use `doc_auto_cfg` (#303) Automatically document feature-gated functionality
diff --git a/src/lib.rs b/src/lib.rs index 5efcb86..d29222c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,4 +1,9 @@ +#![cfg_attr(not(test), no_std)] +#![cfg_attr(docsrs, feature(doc_auto_cfg))] #![doc = include_str!("../README.md")] +#![doc(html_logo_url = "https://raw.githubusercontent.com/RustCrypto/meta/master/log...
1
5
6
3292db138d29946f97e314ccbe3bb8370a3af9a8
Tony Arcieri
2023-04-19T15:06:51
v0.9.0-pre.2 (#302)
diff --git a/Cargo.lock b/Cargo.lock index 321bbd6..690cdd6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -370,7 +370,7 @@ dependencies = [ [[package]] name = "rsa" -version = "0.9.0-pre.1" +version = "0.9.0-pre.2" dependencies = [ "base64ct", "byteorder", diff --git a/Cargo.toml b/Cargo.toml index 40f7159..eb9a...
2
2
2
2ec870854119610b596d46f2cdfa746d7588be52
Tony Arcieri
2023-04-18T18:17:07
pkcs1v15: use `BigUint` as `Signature`'s inner type (#298) This one half of #220. Doing anything with a signature involves converting it from bytes into a `BigUint`, so this changes the inner type the latter which is more useful. It should also help address #272, since it will enable doing those sort of check...
diff --git a/src/pkcs1v15.rs b/src/pkcs1v15.rs index 27cce3a..a6cb13a 100644 --- a/src/pkcs1v15.rs +++ b/src/pkcs1v15.rs @@ -6,11 +6,11 @@ //! //! [RFC8017 § 8.2]: https://datatracker.ietf.org/doc/html/rfc8017#section-8.2 -use alloc::boxed::Box; -use alloc::vec::Vec; +use alloc::{boxed::Box, string::ToString, vec::...
2
88
87
a6fd36d5c54cd4de1a64acc3deed109b4e54527b
Dmitry Baryshkov
2023-04-18T17:13:52
feat: switch to RsaPssParams::new() (#299) Switch to using RsaPssParams::new() from pkcs1 crate. This fixes the issue reported by zlint for x509-cert, where SHA* digest algorithms had empty parameters instead of NULL parameters (as required by Mozilla policy and permitted by RFC4055). Signed-off-by: Dmitry Barys...
diff --git a/Cargo.lock b/Cargo.lock index c9beaa9..321bbd6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -268,9 +268,9 @@ dependencies = [ [[package]] name = "pkcs1" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "575fd6eebed721a2929faa1ee1383a4978...
3
6
21
1eb59f48f7bfc32fb412061a96c264305775c5b0
Tony Arcieri
2023-04-18T01:00:23
Impl `Signer` for `pss::SigningKey` (#297) Gated under the `getrandom` feature. Calls `RandomizedSigner` with `OsRng`.
diff --git a/src/pss.rs b/src/pss.rs index ebb245f..7b45c7c 100644 --- a/src/pss.rs +++ b/src/pss.rs @@ -38,6 +38,9 @@ use crate::key::{PrivateKey, PublicKey}; use crate::padding::SignatureScheme; use crate::{RsaPrivateKey, RsaPublicKey}; +#[cfg(feature = "getrandom")] +use {rand_core::OsRng, signature::Signer}; + ...
1
13
0
d3a25cd2b208dd15725cfe34842d232be8beb8ec
Tony Arcieri
2023-04-17T20:57:00
Cargo.toml: alphabetize feature names (#296)
diff --git a/Cargo.toml b/Cargo.toml index 5a713cb..bce34b7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -49,13 +49,13 @@ name = "key" [features] default = ["std", "pem"] +expose-internals = [] +getrandom = ["rand_core/getrandom"] nightly = ["num-bigint/nightly"] serde = ["dep:serde", "num-bigint/serde"] -expose-i...
1
3
3
891a4caba953b6068b6b31cb796f8a8ac4ee265b
Tony Arcieri
2023-04-17T12:40:24
Rename `Pkcs1v15Sign::new_raw` to `Pkcs1v15Sign::new_unprefixed` (#293) Following #290, which amended `pkcs1v15::SigningKey`, this commit makes a corresponding change to `Pkcs1v15Sign` so the method name is consistent with `SigningKey::new_unprefixed`
diff --git a/src/pkcs1v15.rs b/src/pkcs1v15.rs index 5561077..27cce3a 100644 --- a/src/pkcs1v15.rs +++ b/src/pkcs1v15.rs @@ -83,15 +83,23 @@ impl Pkcs1v15Sign { } } - /// Create new PKCS#1 v1.5 padding for computing a raw signature. + /// Create new PKCS#1 v1.5 padding for computing an unprefixed ...
1
12
4
842c1f60f7729dda7e0a16d400400e1e404ba3d2
Dmitry Baryshkov
2023-04-17T12:39:57
pss: add random key generation for BlindedSigningKey (#295) Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
diff --git a/src/pss.rs b/src/pss.rs index bc34bbe..ebb245f 100644 --- a/src/pss.rs +++ b/src/pss.rs @@ -842,6 +842,27 @@ where } } + /// Create a new random RSASSA-PSS signing key which produces "blinded" + /// signatures. + /// Digest output size is used as a salt length. + pub fn random<R...
1
21
0
e7201ed244fad5a703576f3133a0b8f24f11e6d5
Dmitry Baryshkov
2023-04-17T00:04:56
Remove 'unsalted' PSS handling (#294) Current new() and random() functions cause confusion. There is the default from ASN.1 encoding of RSAPSS parameters (20). There is also another default of (mod_size - 2 - hash_size). And there is a recommendation to use salt_len of hash_size. Drop old defaults and always use...
diff --git a/src/pss.rs b/src/pss.rs index 5042eda..bc34bbe 100644 --- a/src/pss.rs +++ b/src/pss.rs @@ -30,7 +30,7 @@ use signature::{ hazmat::{PrehashVerifier, RandomizedPrehashSigner}, DigestVerifier, Keypair, RandomizedDigestSigner, RandomizedSigner, SignatureEncoding, Verifier, }; -use subtle::ConstantT...
1
96
112
67515a0e5fb637468e2e58af57a33abaab05a4d3
Dmitry Baryshkov
2023-04-15T00:57:05
lib: stop using deprecated SigningKey<D>::new_with_prefix (#292) Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
diff --git a/src/lib.rs b/src/lib.rs index 4748b7f..76956fe 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -69,7 +69,7 @@ //! //! let bits = 2048; //! let private_key = RsaPrivateKey::new(&mut rng, bits).expect("failed to generate a key"); -//! let signing_key = SigningKey::<Sha256>::new_with_prefix(private_key); +//! ...
1
1
1
bf1defd014b44b7cf3c01d5dbcc0d4b6e61abd1f
Tony Arcieri
2023-04-11T12:37:34
pkcs1v15: make `*_with_prefix` methods the default (#290) Renames the following: - `SigningKey::new` => `SigningKey::new_unprefixed` - `SigningKey::new_with_prefix` => `SigningKey::new` - `VerifyingKey::new` => `VerifyingKey::new_unprefixed` - `VerifyingKey::new_with_prefix` => `VerifyingKey::new` The `*_with...
diff --git a/src/pkcs1v15.rs b/src/pkcs1v15.rs index 30d29df..5561077 100644 --- a/src/pkcs1v15.rs +++ b/src/pkcs1v15.rs @@ -423,8 +423,8 @@ where /// /// ## Note: unprefixed signatures are uncommon /// - /// In most cases you'll want to use [`SigningKey::new_with_prefix`]. - pub fn new(key: RsaPri...
1
43
21
534eca6ae80098382c8301e2eb95232b16888376
Tony Arcieri
2023-04-05T03:10:12
v0.9.0-pre.1 (#286)
diff --git a/Cargo.lock b/Cargo.lock index 7f92bb3..c9beaa9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -370,7 +370,7 @@ dependencies = [ [[package]] name = "rsa" -version = "0.9.0-pre.0" +version = "0.9.0-pre.1" dependencies = [ "base64ct", "byteorder", diff --git a/Cargo.toml b/Cargo.toml index 51fefdf..5a71...
2
2
2
cf90255057dbe207820d8f70b77e570124c426a8
Dmitry Baryshkov
2023-04-05T02:12:08
AssociatedAlgorithmIdentifier implementation (#278) Implement associated AlgorithmIdentifier traits for PKCS1v15 and PSS keys Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
diff --git a/Cargo.lock b/Cargo.lock index 33f6853..7f92bb3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -101,9 +101,9 @@ dependencies = [ [[package]] name = "der" -version = "0.7.0" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc302fd9b18d66834a6f092d10ea85489c0c...
4
197
15
70d185bb1cf1d6b500cea926591b9bd9f165ce0e
Dmitry Baryshkov
2023-04-02T23:15:08
Fixes for 'cargo clippy' and 'rustfmt' issues (#283) Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
diff --git a/src/oaep.rs b/src/oaep.rs index f792a42..309a0cd 100644 --- a/src/oaep.rs +++ b/src/oaep.rs @@ -175,12 +175,7 @@ impl fmt::Debug for Oaep { } #[inline] -fn encrypt_internal< - 'a, - R: CryptoRngCore + ?Sized, - K: PublicKey, - MGF: FnMut(&mut [u8], &mut [u8]) -> (), ->( +fn encrypt_internal...
2
13
17
933bbdf2c3f5909428a5d041b0c87fa400051649
Dmitry Baryshkov
2023-03-27T00:56:40
pss: add function to get salt length from RSA PSS keys (#277) To create proper RsaPssParams it is necessary to determine the salt length specified for the signing key. Add a function to get it from signing keys. Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
diff --git a/src/pss.rs b/src/pss.rs index 6b0ccbf..cd75fe8 100644 --- a/src/pss.rs +++ b/src/pss.rs @@ -677,6 +677,11 @@ where phantom: Default::default(), }) } + + /// Return specified salt length for this key + pub fn salt_len(&self) -> Option<usize> { + self.salt_len + } ...
1
10
0
31f25daceeaa3d91614764a2e45e3bf8c31c4330
Tony Arcieri
2023-03-06T20:51:13
v0.9.0-pre.0 (#271)
diff --git a/Cargo.lock b/Cargo.lock index 5d2c9e1..0965cf8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -370,7 +370,7 @@ dependencies = [ [[package]] name = "rsa" -version = "0.9.0-pre" +version = "0.9.0-pre.0" dependencies = [ "base64ct", "byteorder", diff --git a/Cargo.toml b/Cargo.toml index a63d58d..e8a05d...
2
2
2
39d3eb95f2a928b7f14d7f4e9814caf91e5325f2
Matt Keeter
2023-03-02T17:05:53
Fix incorrect doc link (#267)
diff --git a/src/pkcs1v15.rs b/src/pkcs1v15.rs index 8aa0a1f..5d9bac4 100644 --- a/src/pkcs1v15.rs +++ b/src/pkcs1v15.rs @@ -596,7 +596,7 @@ where /// /// ## Note: unprefixed signatures are uncommon /// - /// In most cases you'll want to use [`SigningKey::new_with_prefix`]. + /// In most cases you'...
1
1
1
3061c9c5bf18f5d4e6f23fb7540ec9271ec44e67
Diego
2023-02-14T21:33:27
fix: correct pss sign/verify when key length is multiple of 8 + 1 bits. Co-authored-by: Diego Fabregat Traver <diego.fabregat@rwth-aachen.de>
diff --git a/src/pss.rs b/src/pss.rs index f58580f..6b0ccbf 100644 --- a/src/pss.rs +++ b/src/pss.rs @@ -196,9 +196,10 @@ pub(crate) fn verify<PK: PublicKey>( let em_bits = pub_key.n().bits() - 1; let em_len = (em_bits + 7) / 8; - let mut em = pub_key.raw_encryption_primitive(sig, em_len)?; + let key_...
1
27
6
dacabfc5ffac27aa8e38a97f0d2c54ca309ef089
Dmitry Baryshkov
2023-02-13T15:35:20
Add Encryption-related traits (#259) * feat: relax Sized requirement for random source parameters * oaep: move OAEP test cases to src/oaep.rs There is little point in having only OAEP test cases in src/key.rs. Move them to proper module, oaep.rs. * oaep: mark two functions as private Currently the crate d...
diff --git a/src/key.rs b/src/key.rs index 031b1e1..6a2f799 100644 --- a/src/key.rs +++ b/src/key.rs @@ -504,19 +504,10 @@ fn check_public_with_max_size(public_key: &impl PublicKeyParts, max_size: usize) mod tests { use super::*; use crate::internals; - use crate::oaep::Oaep; - use alloc::string::Str...
5
781
250
6f8d112cead989f56a20388eae90f53713946e81
Diego
2023-02-10T13:54:52
Fix possible panic in internals::left_pad (#262) Co-authored-by: Diego Fabregat Traver <diego.fabregat@rwth-aachen.de>
diff --git a/src/errors.rs b/src/errors.rs index c117726..d416aa0 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -60,6 +60,9 @@ pub enum Error { /// Label too long. LabelTooLong, + + /// Invalid padding length. + InvalidPadLen, } #[cfg(feature = "std")] @@ -87,6 +90,7 @@ impl core::fmt::Display...
3
36
16
9f1595b962db0c2d4c86da6e1f2ef42e3b8bade8
Tony Arcieri
2023-01-21T18:00:03
Update PSS rustdoc example to match PKCS#1 v1.5 example (#257) Uses `rsa::sha2` to access `Sha256` in the code example, noting the `sha2` feature must be enabled, ala #255
diff --git a/src/lib.rs b/src/lib.rs index 1149b0e..c11771a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -81,11 +81,15 @@ //! ``` //! //! ## PSS signatures -//! ``` +//! +//! Note: requires `sha2` feature of `rsa` crate is enabled. +//! +#![cfg_attr(feature = "sha2", doc = "```")] +#![cfg_attr(not(feature = "sha2"), ...
1
6
2
134a0612375e5f68965c13e8094fc32ff2d0b337
Tony Arcieri
2023-01-20T23:46:27
Add `sha2` feature with `oid` subfeature enabled (#255) We seem to be running into a lot of people who are having trouble with PKCS#1 v1.5 signatures because the failure mode for the `oid` feature of the `sha2` crate being disabled is fairly unscrutable. See #234, #253, and the semi-related tracking issue for #23...
diff --git a/Cargo.toml b/Cargo.toml index 80563b0..f201b08 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,6 +26,12 @@ pkcs8 = { version = "0.9", default-features = false, features = ["alloc"] } signature = { version = "2", default-features = false , features = ["digest", "rand_core"] } zeroize = { version = "1", fe...
3
25
5
b10b924c5d172d13bd9e4c8c00ca82e025bc2a85
Tony Arcieri
2023-01-16T20:25:29
Bump `signature` crate dependency to v2 (#249) Release notes: https://github.com/RustCrypto/traits/pull/1211
diff --git a/Cargo.toml b/Cargo.toml index 7612688..87f82c9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,7 +23,7 @@ subtle = { version = "2.1.1", default-features = false } digest = { version = "0.10.5", default-features = false, features = ["alloc", "oid"] } pkcs1 = { version = "0.4", default-features = false, fe...
1
1
1
37c1e1406924c77f1d09f2d7fd355d6829211a16
Tony Arcieri
2023-01-11T04:29:34
rsa v0.8.0-rc.0 (#248)
diff --git a/Cargo.toml b/Cargo.toml index 177f7a9..7612688 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rsa" -version = "0.8.0-pre.0" +version = "0.8.0-rc.0" authors = ["RustCrypto Developers", "dignifiedquire <dignifiedquire@gmail.com>"] edition = "2021" description = "Pure Rust RSA...
1
1
1
35372d9516c8d5dd28222e26b7292d6459c8f3ff
Tony Arcieri
2023-01-10T20:59:31
Refactor `PaddingScheme` into a trait (#244) Splits up the `PaddingScheme` enum into four structs, named after the previous variants of the struct (adopting capitalization from the Rust API guidelines): - `oaep::Oaep` - `pkcs1v15::{Pkcs1v15Encrypt, Pkcs1v15Sign}` - `pss::Pss` All of these are re-exported fro...
diff --git a/benches/key.rs b/benches/key.rs index 26c6616..3926038 100644 --- a/benches/key.rs +++ b/benches/key.rs @@ -6,7 +6,7 @@ use base64ct::{Base64, Encoding}; use num_bigint::BigUint; use num_traits::{FromPrimitive, Num}; use rand_chacha::{rand_core::SeedableRng, ChaCha8Rng}; -use rsa::{PaddingScheme, RsaPri...
7
448
380
35a32093f0ac23df2f7e54d786c63924ce7370a2
Tony Arcieri
2023-01-08T04:26:52
Bump `signature` to v2.0.0-rc.1 (#247)
diff --git a/Cargo.toml b/Cargo.toml index ef72d38..177f7a9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,7 +23,7 @@ subtle = { version = "2.1.1", default-features = false } digest = { version = "0.10.5", default-features = false, features = ["alloc", "oid"] } pkcs1 = { version = "0.4", default-features = false, fe...
3
17
17
6b5dcc8afe43a2a354dad498ab99a0fa107a4598
Tony Arcieri
2023-01-05T22:20:00
Make `padding` module private (#243) The only public type in the `padding` module is `PaddingScheme`, which is already re-exported from the toplevel. There is no rustdoc documentation at the top of the module, and therefore little value in having `PaddingScheme` available as both `rsa::PaddingScheme` and `rsa::p...
diff --git a/src/lib.rs b/src/lib.rs index f30e763..c9e690b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -214,7 +214,6 @@ pub use signature; pub mod algorithms; pub mod errors; -pub mod padding; pub mod pkcs1v15; pub mod pss; @@ -222,6 +221,7 @@ mod dummy_rng; mod encoding; mod key; mod oaep; +mod padding; m...
1
1
1