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 |
|---|---|---|---|---|---|---|---|
b3263983d585171a3c91c7074dab48c46f0c754b | Tony Arcieri | 2023-04-10T01:23:24 | wycheproof2blb: secp224r1 support (#891)
Adds support for extracting secp224r1 test vectors from Wycheproof, in
order to test the `p224` crate. | diff --git a/wycheproof2blb/src/ecdsa.rs b/wycheproof2blb/src/ecdsa.rs
index 2e0fc70..7c01a11 100644
--- a/wycheproof2blb/src/ecdsa.rs
+++ b/wycheproof2blb/src/ecdsa.rs
@@ -55,7 +55,7 @@ pub fn generator(data: &[u8], algorithm: &str, _key_size: u32) -> Vec<TestInfo>
let mut infos = vec![];
for g in &suite.tes... | 2 | 5 | 1 |
c1e32c58ca814c0b6265725002f4d853c3272bef | Артём Павлов [Artyom Pavlov] | 2023-04-01T23:55:36 | Update Cargo.lock | diff --git a/Cargo.lock b/Cargo.lock
index 70d3290..4715600 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -20,7 +20,7 @@ dependencies = [
[[package]]
name = "block-padding"
-version = "0.3.2"
+version = "0.3.3"
dependencies = [
"generic-array",
]
@@ -125,9 +125,9 @@ version = "0.3.0"
[[package]]
name = "proc-... | 1 | 11 | 11 |
734c63b03165ae249fd02e6ebc5a21b2a4971993 | jake | 2023-04-01T17:35:54 | cmov: implement constant-time equality comparisons (#873) | diff --git a/cmov/src/aarch64.rs b/cmov/src/aarch64.rs
index 700b4b4..8292047 100644
--- a/cmov/src/aarch64.rs
+++ b/cmov/src/aarch64.rs
@@ -1,15 +1,15 @@
-use crate::{Cmov, Condition};
+use crate::{Cmov, CmovEq, Condition};
use core::arch::asm;
macro_rules! csel {
- ($cmp:expr, $csel:expr, $dst:expr, $src:expr,... | 5 | 475 | 116 |
4b069849286b6d1bd86fea097ddb66ff3db9d6c0 | Matthew Maurer | 2023-03-31T01:14:56 | zeroize_derive: Inject where clauses; skip unused (#882)
The where clauses I was previously injecting *were* load bearing, but
they needed to be filtered for skipped fields.
Fixes #878 | diff --git a/zeroize/derive/Cargo.toml b/zeroize/derive/Cargo.toml
index 303bb37..baaacf1 100644
--- a/zeroize/derive/Cargo.toml
+++ b/zeroize/derive/Cargo.toml
@@ -17,7 +17,7 @@ proc-macro = true
[dependencies]
proc-macro2 = "1"
quote = "1"
-syn = {version = "2", features = ["full", "extra-traits"]}
+syn = {version... | 3 | 58 | 3 |
74770c8561061483e749caf7256f0301aa8f7234 | Matthew Maurer | 2023-03-27T16:28:35 | Do not automatically inject bounds (#879)
Fixes #878 | diff --git a/zeroize/derive/src/lib.rs b/zeroize/derive/src/lib.rs
index 650dacb..215bd78 100644
--- a/zeroize/derive/src/lib.rs
+++ b/zeroize/derive/src/lib.rs
@@ -8,11 +8,10 @@ use proc_macro2::{Ident, TokenStream};
use quote::{format_ident, quote};
use syn::{
parse::{Parse, ParseStream},
- parse_quote,
... | 2 | 29 | 13 |
30b2c5561613d2ef472ebe25905ed5fbb32f54e3 | Matthew Maurer | 2023-03-26T17:43:19 | fiat-constify/zeroize_derive: bump `syn` to v2 (#858) | diff --git a/Cargo.lock b/Cargo.lock
index 8f1fc1a..cdac0c3 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -109,15 +109,15 @@ dependencies = [
[[package]]
name = "itoa"
-version = "1.0.5"
+version = "1.0.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fad582f4b9e86b6caa621cabeb0963332... | 5 | 380 | 376 |
fc010a560073b5a37c951c990c2a2439dc9dc9af | Tony Arcieri | 2023-03-25T23:20:41 | cmov: make `Cmov::cmovz` a provided method (#871)
This makes it easier to implement the `Cmov` trait for foreign types.
It additionally makes the `value` argument an `&Self` reference, which
should make it easier to impl the trait for non-`Copy` types where it's
desirable to avoid a move.
Note: breaking change | diff --git a/Cargo.lock b/Cargo.lock
index 4b4b6f8..8f1fc1a 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -27,7 +27,7 @@ dependencies = [
[[package]]
name = "cmov"
-version = "0.2.0"
+version = "0.3.0-pre"
[[package]]
name = "collectable"
diff --git a/cmov/Cargo.toml b/cmov/Cargo.toml
index a0c2eac..a185a36 10064... | 7 | 101 | 99 |
dc26334124b6aa0487a9dfdeecd93e48d4334b8c | Tony Arcieri | 2023-03-25T01:59:05 | cpufeatures: document unstable target features (#866)
Document which target feature names have not yet been stabilized and are
subject to change | diff --git a/cpufeatures/src/lib.rs b/cpufeatures/src/lib.rs
index b6c7c10..63c1c7a 100644
--- a/cpufeatures/src/lib.rs
+++ b/cpufeatures/src/lib.rs
@@ -2,13 +2,54 @@
//! as a stopgap until Rust [RFC 2725] adding first-class target feature detection
//! macros to `libcore` is implemented.
//!
-//! Supported target a... | 1 | 48 | 7 |
9ad34485d6809c4840b26b633f3151b1f6270cdc | jake | 2023-03-24T20:01:36 | add `miri` support by forcing the `portable` backend (#864) | diff --git a/cmov/src/lib.rs b/cmov/src/lib.rs
index c899cf9..471db6f 100644
--- a/cmov/src/lib.rs
+++ b/cmov/src/lib.rs
@@ -6,10 +6,15 @@
)]
#![warn(missing_docs, rust_2018_idioms, unused_qualifications)]
+#[cfg(not(miri))]
#[cfg(target_arch = "aarch64")]
mod aarch64;
-#[cfg(not(any(target_arch = "aarch64", targ... | 1 | 6 | 1 |
1ffdfbecbe55818c7c7a1e0c6472244e9c546a2f | Tony Arcieri | 2023-03-24T19:58:19 | cpufeatures: add support for detecting AVX-512 (#862)
Adds support for detecting the following features:
- `avx512f`
- `avx512dq`
- `avx512ifma`
- `avx512pf`
- `avx512er`
- `avx512cd`
- `avx512bw`
- `avx512vl`
CPUID bitflags obtained from this table:
https://en.wikichip.org/wiki/x86/avx-512#Detection
... | diff --git a/cpufeatures/src/x86.rs b/cpufeatures/src/x86.rs
index c973b74..a60fa0d 100644
--- a/cpufeatures/src/x86.rs
+++ b/cpufeatures/src/x86.rs
@@ -99,7 +99,15 @@ __expand_check_macro! {
("bmi1", 1, ebx, 3),
("avx2", 0, ecx, 28, 1, ebx, 5),
("bmi2", 1, ebx, 8),
+ ("avx512f", 1, ebx, 16),
+ ("a... | 1 | 8 | 0 |
b05b15afa08e9d51402dbc5f7fb5b7a9f088eece | jake | 2023-03-24T17:38:51 | cmov: fix builds on `x86` (32-bit) targets (#863) | diff --git a/cmov/src/x86.rs b/cmov/src/x86.rs
index cc4c60b..aa0fe12 100644
--- a/cmov/src/x86.rs
+++ b/cmov/src/x86.rs
@@ -49,6 +49,7 @@ impl Cmov for u32 {
}
}
+#[cfg(target_arch = "x86_64")]
impl Cmov for u64 {
#[inline(always)]
fn cmovz(&mut self, value: Self, condition: Condition) {
@@ -60,3 +6... | 2 | 48 | 22 |
06427069ee676fb185d6738d327dfe9353f17346 | ComplexSpaces | 2023-03-18T17:16:17 | Support dynamic feature detection on iOS and derivative platforms (#848) | diff --git a/cpufeatures/Cargo.toml b/cpufeatures/Cargo.toml
index d42f9dc..4022d0a 100644
--- a/cpufeatures/Cargo.toml
+++ b/cpufeatures/Cargo.toml
@@ -14,7 +14,7 @@ categories = ["no-std"]
edition = "2018"
readme = "README.md"
-[target.aarch64-apple-darwin.dependencies]
+[target.'cfg(all(target_arch = "aarch64", ... | 2 | 8 | 36 |
e4a2627bfab37d382573b5732e68b004062dfa2d | Yoshiya Hinosawa | 2023-03-10T09:23:42 | docs: fix typo in doc of `pad` (#845) | diff --git a/block-padding/src/lib.rs b/block-padding/src/lib.rs
index 0779b79..3f2fc67 100644
--- a/block-padding/src/lib.rs
+++ b/block-padding/src/lib.rs
@@ -41,7 +41,7 @@ pub trait Padding<BlockSize: ArrayLength<u8>> {
/// stored in the block is equal to `pos`).
///
/// # Panics
- /// If `pos` is ... | 1 | 1 | 1 |
d7b383d85def928c04ec3eee434d3f6a1a43d563 | Nugine | 2023-03-02T16:08:09 | zeroize: impl Zeroize for `str` and `Box<str>` (#842) | diff --git a/zeroize/src/lib.rs b/zeroize/src/lib.rs
index 3663122..4e00657 100644
--- a/zeroize/src/lib.rs
+++ b/zeroize/src/lib.rs
@@ -476,6 +476,14 @@ where
}
}
+impl Zeroize for str {
+ fn zeroize(&mut self) {
+ // Safety:
+ // A zeroized byte slice is a valid UTF-8 string.
+ unsafe ... | 1 | 16 | 0 |
91c2c216a5017d444dfd718c198ad3a3e31452c6 | Tshepang Mbambo | 2023-02-16T15:26:12 | doc: remove extraneous words (#838) | diff --git a/zeroize/src/lib.rs b/zeroize/src/lib.rs
index 3cb5822..3663122 100644
--- a/zeroize/src/lib.rs
+++ b/zeroize/src/lib.rs
@@ -64,7 +64,7 @@
//!
//! With the `std` feature enabled (which it is **not** by default), [`Zeroize`]
//! is also implemented for [`CString`]. After calling `zeroize()` on a `CString`... | 1 | 1 | 1 |
92f47b9380452f9abd875f0251436cef99c0f59d | Tony Arcieri | 2023-02-12T17:23:17 | fiat-constify: fix rustdoc lint warning in output (#836)
The link to the utils repo should be angle-bracketed to make the rustdoc
linter happy. | diff --git a/fiat-constify/src/main.rs b/fiat-constify/src/main.rs
index fb1bd40..a0df28a 100644
--- a/fiat-constify/src/main.rs
+++ b/fiat-constify/src/main.rs
@@ -52,7 +52,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
}
}
- println!("#![doc = \" fiat-crypto output postprocessed by fiat... | 1 | 1 | 1 |
8c8bbf76e0545024c53f5f2eb54b6288adc1e7f3 | Tony Arcieri | 2023-01-21T04:59:39 | cmov: redesigned trait-based API (#830)
Replaces the existing API with a `Cmov` trait which is impl'd for all of
the unsigned integer types.
On x86 platforms this adds support for using both EAX and RAX register
operands.
On aarch64 platforms it adds support for using both W0 and X0 register
operands.
Supp... | diff --git a/Cargo.lock b/Cargo.lock
index cada6f4..c5efa06 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -27,7 +27,7 @@ dependencies = [
[[package]]
name = "cmov"
-version = "0.1.1"
+version = "0.2.0-pre"
[[package]]
name = "collectable"
diff --git a/cmov/Cargo.toml b/cmov/Cargo.toml
index 581f4b4..6b05109 10064... | 7 | 420 | 129 |
2a55b8965cc10b755464fa153d480a51aa76dbd6 | David Cook | 2023-01-14T13:46:44 | Fix doc typo in dbl (#828) | diff --git a/dbl/src/lib.rs b/dbl/src/lib.rs
index 66fd555..bddc565 100644
--- a/dbl/src/lib.rs
+++ b/dbl/src/lib.rs
@@ -31,7 +31,7 @@ pub trait Dbl {
#[must_use]
fn dbl(self) -> Self;
- /// Reverse double block. (alternatively: divbide block by x)
+ /// Reverse double block. (alternatively: divide bl... | 1 | 1 | 1 |
c809e3d7b3895f1254f44039105baf2c9905c132 | Tony Arcieri | 2022-12-01T21:23:20 | zeroize: impl `Zeroize` for `core::num::Wrapping` (#818)
Closes #803 | diff --git a/zeroize/src/lib.rs b/zeroize/src/lib.rs
index 5ee0f2c..3cb5822 100644
--- a/zeroize/src/lib.rs
+++ b/zeroize/src/lib.rs
@@ -254,8 +254,8 @@ use core::{
marker::{PhantomData, PhantomPinned},
mem::{self, MaybeUninit},
num::{
- NonZeroI128, NonZeroI16, NonZeroI32, NonZeroI64, NonZeroI8, ... | 1 | 11 | 2 |
52f9125385de64649e6e381f2bfdb311623121e7 | Dirk Stolle | 2022-10-03T10:19:37 | Fix some typos (#806) | diff --git a/block-buffer/src/lib.rs b/block-buffer/src/lib.rs
index b738678..ac9055e 100644
--- a/block-buffer/src/lib.rs
+++ b/block-buffer/src/lib.rs
@@ -215,13 +215,13 @@ where
self.set_pos_unchecked(pos);
}
- /// Return size of the internall buffer in bytes.
+ /// Return size of the internal ... | 5 | 7 | 7 |
ce0ab191c2636ed9f72ac847f21b72b61743b5a7 | Ruslan Piasetskyi | 2022-09-04T21:31:44 | block-buffer: add try_new method (#799)
try_new creates BlockBuffer or returns an error. | diff --git a/block-buffer/src/lib.rs b/block-buffer/src/lib.rs
index cc19b7c..b738678 100644
--- a/block-buffer/src/lib.rs
+++ b/block-buffer/src/lib.rs
@@ -8,7 +8,7 @@
pub use generic_array;
-use core::{marker::PhantomData, slice};
+use core::{fmt, marker::PhantomData, slice};
use generic_array::{
typenum::... | 2 | 32 | 4 |
b858f0c8f4959a88e836764e48f5495fbe9243c4 | Kriskras99 | 2022-08-29T14:23:52 | block-padding: fix small typo in docstring (#798) | diff --git a/block-padding/src/lib.rs b/block-padding/src/lib.rs
index 3cbc164..76cf993 100644
--- a/block-padding/src/lib.rs
+++ b/block-padding/src/lib.rs
@@ -25,7 +25,7 @@ pub enum PadType {
Reversible,
/// Ambiguous padding
Ambiguous,
- /// No padding, message must be mutliple of block size
+ /... | 1 | 1 | 1 |
276a4572b79f97379dd046386978b5886d0a760b | Artyom Pavlov | 2022-08-18T15:05:14 | Update Cargo.lock (#794) | diff --git a/Cargo.lock b/Cargo.lock
index 55dca97..9c61b4e 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -56,9 +56,9 @@ dependencies = [
[[package]]
name = "generic-array"
-version = "0.14.5"
+version = "0.14.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fd48d33ec7f05fbfa152300fda... | 1 | 25 | 25 |
8e74aa5b4bd2d1f7c3428649b7c9578592f10f0b | Jordan Rose | 2022-08-08T12:25:32 | cpufeatures: Disable all target features under miri (#779)
Miri is an interpreter, and though it tries to emulate the target CPU
it does not support any target features. | diff --git a/cpufeatures/src/lib.rs b/cpufeatures/src/lib.rs
index 08b6e52..b6c7c10 100644
--- a/cpufeatures/src/lib.rs
+++ b/cpufeatures/src/lib.rs
@@ -59,13 +59,18 @@
html_favicon_url = "https://raw.githubusercontent.com/RustCrypto/media/6ee8e381/logo.svg"
)]
+#[cfg(not(miri))]
#[cfg(all(target_arch = "aarch... | 2 | 25 | 0 |
81536ee278943c128c033813227c3bd57639e20a | daxpedda | 2022-08-03T22:50:19 | Fix deriving `ZeroizeOnDrop` on items with generics (#787) | diff --git a/zeroize/derive/src/lib.rs b/zeroize/derive/src/lib.rs
index 1efc3b4..baf6990 100644
--- a/zeroize/derive/src/lib.rs
+++ b/zeroize/derive/src/lib.rs
@@ -71,7 +71,7 @@ fn derive_zeroize(mut s: synstructure::Structure<'_>) -> TokenStream {
fn derive_zeroize_on_drop(mut s: synstructure::Structure<'_>) -> Toke... | 2 | 11 | 1 |
7a083ff3d25685d6e6429e8b4a0593c648c8e996 | Daniel Cogan | 2022-08-02T00:12:44 | update libc deps to 0.2.95 (#789) | diff --git a/cpufeatures/Cargo.toml b/cpufeatures/Cargo.toml
index fa590c6..31b328c 100644
--- a/cpufeatures/Cargo.toml
+++ b/cpufeatures/Cargo.toml
@@ -15,10 +15,10 @@ edition = "2018"
readme = "README.md"
[target.aarch64-apple-darwin.dependencies]
-libc = "0.2.68"
+libc = "0.2.95"
[target.'cfg(all(target_arch ... | 1 | 3 | 3 |
f096d5f1bb3a59dcb0a7f37290d7c38eb9786a75 | Nathaniel McCallum | 2022-07-20T14:08:43 | feat: add serde support (#780)
This (optional) feature implements Serialize/Deserialize for Zeroizing when
the inner type implements these traits. This makes it possible to use
Zeroizing in serde contexts.
Signed-off-by: Nathaniel McCallum <nathaniel@profian.com> | diff --git a/Cargo.lock b/Cargo.lock
index 38f8f78..18d6736 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -221,6 +221,7 @@ dependencies = [
name = "zeroize"
version = "1.5.6"
dependencies = [
+ "serde",
"zeroize_derive",
]
diff --git a/zeroize/Cargo.toml b/zeroize/Cargo.toml
index 71a3213..4eec817 100644
--- a/ze... | 3 | 30 | 0 |
cee7946fd766ce57cfa8a1467139c254edba5078 | Tony Arcieri | 2022-06-29T19:26:59 | zeroize: add `#[ignore]` to flaky CString test (#776)
This test relies on UB and is flaking out in certain cases:
https://github.com/RustCrypto/utils/issues/774
It's unclear if the test failure indicates a genuine bug in the
implementation, or is the result of a test with UB.
However, in the meantime it shou... | diff --git a/zeroize/tests/zeroize.rs b/zeroize/tests/zeroize.rs
index b59eabc..32281c1 100644
--- a/zeroize/tests/zeroize.rs
+++ b/zeroize/tests/zeroize.rs
@@ -166,7 +166,9 @@ fn zeroize_string_entire_capacity() {
assert!(as_vec.iter().all(|byte| *byte == 0));
}
+// TODO(tarcieri): debug flaky test (with poten... | 1 | 2 | 0 |
fdad462f2b3a78f5751e91cdd3ee3698fd28dc39 | Tony Arcieri | 2022-06-16T23:46:52 | zeroize: add `#[inline(always)]` annotations (#772) | diff --git a/zeroize/src/lib.rs b/zeroize/src/lib.rs
index d27ec41..a013209 100644
--- a/zeroize/src/lib.rs
+++ b/zeroize/src/lib.rs
@@ -284,6 +284,19 @@ pub trait ZeroizeOnDrop {}
/// Marker trait for types whose [`Default`] is the desired zeroization result
pub trait DefaultIsZeroes: Copy + Default + Sized {}
+//... | 1 | 25 | 17 |
4d0c62e53071003cbf4efa0fec05da5ffbe8b18e | Tony Arcieri | 2022-06-16T23:32:46 | zeroize: factor integration tests into `tests/` (#771) | diff --git a/zeroize/src/lib.rs b/zeroize/src/lib.rs
index f19abb7..d27ec41 100644
--- a/zeroize/src/lib.rs
+++ b/zeroize/src/lib.rs
@@ -236,7 +236,6 @@
//! [`Ordering::SeqCst`]: core::sync::atomic::Ordering::SeqCst
#[cfg(feature = "alloc")]
-#[cfg_attr(test, macro_use)]
extern crate alloc;
#[cfg(feature = "std... | 2 | 208 | 214 |
9270ee927f17a682d59dcbf13d0676b7f0251a51 | Tony Arcieri | 2022-06-16T23:10:15 | zeroize: formatting fixups (#770)
Reorder code in terms of precedence; add whitespace | diff --git a/zeroize/src/lib.rs b/zeroize/src/lib.rs
index a8b34b8..f19abb7 100644
--- a/zeroize/src/lib.rs
+++ b/zeroize/src/lib.rs
@@ -251,56 +251,38 @@ mod aarch64;
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
mod x86;
-use core::marker::{PhantomData, PhantomPinned};
-use core::mem::{self, MaybeUnini... | 1 | 139 | 110 |
855d0cafa00867dbcdf94e9f8a745df8ddbf2620 | Tony Arcieri | 2022-06-09T17:25:27 | fiat-constify: add clippy allows (#769)
Adds `allow` directives for the following:
- `clippy::identity_op`
- `clippy::unnecessary_cast` | diff --git a/fiat-constify/src/main.rs b/fiat-constify/src/main.rs
index 531ff0a..fb1bd40 100644
--- a/fiat-constify/src/main.rs
+++ b/fiat-constify/src/main.rs
@@ -31,6 +31,8 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
ast.attrs.push(build_attribute(
"allow",
&[
+ "clippy... | 1 | 2 | 0 |
7583f2ed9ca523ccecb32cc0ce16718cdadcef7c | Tony Arcieri | 2022-05-28T00:22:50 | wycheproof2blb: secp384r1 support (#767)
Adds support for extracting secp384r1 test vectors from Wycheproof, in
order to test the `p384` crate. | diff --git a/wycheproof2blb/src/ecdsa.rs b/wycheproof2blb/src/ecdsa.rs
index edb6908..2e0fc70 100644
--- a/wycheproof2blb/src/ecdsa.rs
+++ b/wycheproof2blb/src/ecdsa.rs
@@ -55,7 +55,7 @@ pub fn generator(data: &[u8], algorithm: &str, _key_size: u32) -> Vec<TestInfo>
let mut infos = vec![];
for g in &suite.tes... | 2 | 5 | 1 |
86455d547f86ebb1e20844ba938f0063e2b5bbbf | Nathaniel McCallum | 2022-04-20T16:11:47 | feat: make `Zeroizing` transparent for cheap conversions (#761)
Sometimes libraries want to be generic across types like `Vec<u8>` and
`Box<[u8]>`. Therefore, they use bounds like `T: AsRef<[u8]>`. The
`Zeroizing<Vec<u8>>` type should be transparently equivalent to
`Vec<u8>` in this regard. This allows `Zeroizing` ... | diff --git a/zeroize/src/lib.rs b/zeroize/src/lib.rs
index 5006fb6..ceca606 100644
--- a/zeroize/src/lib.rs
+++ b/zeroize/src/lib.rs
@@ -580,6 +580,26 @@ where
}
}
+impl<T, Z> AsRef<T> for Zeroizing<Z>
+where
+ T: ?Sized,
+ Z: AsRef<T> + Zeroize,
+{
+ fn as_ref(&self) -> &T {
+ self.0.as_ref()
+... | 1 | 35 | 0 |
aa6bb32ab8cc352b763afa8b0076421c177d739a | Nicolas Abram | 2022-03-30T11:47:33 | Fix MIRI error in inout_buf.rs (#755)
See https://github.com/rust-lang/unsafe-code-guidelines/issues/133
Calling as_mut_ptr creates a unique reference, and as_ptr a shared
reference. These 2 conflict, and one invalidates the other. Both
ptr need to be reborrows of or be basically the same pointer. | diff --git a/inout/src/inout_buf.rs b/inout/src/inout_buf.rs
index 0ab1b8d..398fe79 100644
--- a/inout/src/inout_buf.rs
+++ b/inout/src/inout_buf.rs
@@ -18,9 +18,10 @@ pub struct InOutBuf<'inp, 'out, T> {
impl<'a, T> From<&'a mut [T]> for InOutBuf<'a, 'a, T> {
#[inline(always)]
fn from(buf: &'a mut [T]) -> S... | 1 | 3 | 2 |
97775676a5d553275e2eb66dee6203411a937b44 | Jordan Rose | 2022-03-18T19:29:42 | Add support for AArch64 Android (essentially a Linux variant) (#752) | diff --git a/cpufeatures/Cargo.toml b/cpufeatures/Cargo.toml
index 244ac4a..1bfba92 100644
--- a/cpufeatures/Cargo.toml
+++ b/cpufeatures/Cargo.toml
@@ -19,3 +19,6 @@ libc = "0.2.68"
[target.'cfg(all(target_arch = "aarch64", target_os = "linux"))'.dependencies]
libc = "0.2.68"
+
+[target.aarch64-linux-android.depen... | 2 | 14 | 6 |
286dc1a09a7f10bfa82cf0c4cab53a988f457259 | Konrad Borowski | 2022-03-02T19:55:44 | cmov: Set asm options (#746)
Those options tell the compiler that ASM statements do not read
or write memory, can be removed if the dst ends up unused during
compilation, and that they don't push data to the stack. | diff --git a/cmov/src/lib.rs b/cmov/src/lib.rs
index 584dca6..c72cda9 100644
--- a/cmov/src/lib.rs
+++ b/cmov/src/lib.rs
@@ -23,7 +23,8 @@ pub fn cmovz(condition: usize, src: usize, dst: &mut usize) {
"cmovz {1}, {2}",
in(reg) condition,
inlateout(reg) *dst,
- in(reg) s... | 1 | 6 | 2 |
77eb0a2e34264b799b076eafef00b32b283668cc | daxpedda | 2022-02-25T18:26:47 | Fixed deriving `ZeroizeOnDrop` on `DerefMut` (#739) | diff --git a/zeroize/src/lib.rs b/zeroize/src/lib.rs
index 1b11ddc..e6cecad 100644
--- a/zeroize/src/lib.rs
+++ b/zeroize/src/lib.rs
@@ -271,7 +271,7 @@ pub mod __internal {
fn zeroize_or_on_drop(self);
}
- impl<T: ZeroizeOnDrop> AssertZeroizeOnDrop for &&mut T {
+ impl<T: ZeroizeOnDrop + ?Sized> ... | 2 | 30 | 2 |
907b3ed3c08de9ef373b75a94b47c5bf28e695df | Artyom Pavlov | 2022-02-17T12:38:20 | block-padding: fix html_root_url (#736) | diff --git a/block-padding/src/lib.rs b/block-padding/src/lib.rs
index 8c87ce2..cd78e4c 100644
--- a/block-padding/src/lib.rs
+++ b/block-padding/src/lib.rs
@@ -7,7 +7,7 @@
#![doc(
html_logo_url = "https://raw.githubusercontent.com/RustCrypto/media/6ee8e381/logo.svg",
html_favicon_url = "https://raw.githubus... | 1 | 1 | 1 |
d1efec578f726109042a0a66d18c81f49f13ca66 | Artyom Pavlov | 2022-02-10T06:49:09 | Fix min deps versions (#732) | diff --git a/cpufeatures/Cargo.toml b/cpufeatures/Cargo.toml
index 94f8ace..244ac4a 100644
--- a/cpufeatures/Cargo.toml
+++ b/cpufeatures/Cargo.toml
@@ -15,7 +15,7 @@ edition = "2018"
readme = "README.md"
[target.aarch64-apple-darwin.dependencies]
-libc = "0.2.103"
+libc = "0.2.68"
[target.'cfg(all(target_arch =... | 3 | 4 | 4 |
a85fb856c35a33b13d061ee639a605307a0b0d58 | Ben Kimock | 2022-02-04T23:36:28 | Use as_mut_ptr to get a pointer for mutation (#728)
The documentation for `slice::as_mut_ptr` says:
The caller must also ensure that the memory the pointer (non-transitively)
points to is never written to (except inside an UnsafeCell) using this pointer
or any pointer derived from it. If you need to mutate the cont... | diff --git a/block-buffer/src/lib.rs b/block-buffer/src/lib.rs
index 52e63bf..b156bef 100644
--- a/block-buffer/src/lib.rs
+++ b/block-buffer/src/lib.rs
@@ -317,8 +317,9 @@ where
fn to_blocks_mut<N: ArrayLength<u8>>(data: &mut [u8]) -> (&mut [Block<N>], &mut [u8]) {
let nb = data.len() / N::USIZE;
let (left,... | 1 | 3 | 2 |
ba4e7e732dea2c9adaf6fa4803362cd9a2b1adfe | daxpedda | 2022-01-31T15:04:57 | Fix ambiguous method for `AssertZeroizeOnDrop` (#725) | diff --git a/zeroize/src/lib.rs b/zeroize/src/lib.rs
index 7890d8f..3f1fd1f 100644
--- a/zeroize/src/lib.rs
+++ b/zeroize/src/lib.rs
@@ -271,7 +271,7 @@ pub mod __internal {
fn zeroize_or_on_drop(self);
}
- impl<T: ZeroizeOnDrop> AssertZeroizeOnDrop for &mut T {
+ impl<T: ZeroizeOnDrop> AssertZero... | 2 | 32 | 2 |
c261a1ed57d9a018d75ad454cf0823d58d3b1e28 | Tony Arcieri | 2022-01-27T14:48:15 | Bump `quote` to v1.0.11 (#720)
Supersedes #718 | diff --git a/Cargo.lock b/Cargo.lock
index 3af4622..566775d 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -79,18 +79,18 @@ version = "0.3.0"
[[package]]
name = "proc-macro2"
-version = "1.0.34"
+version = "1.0.36"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2f84e92c0f7c9d58328b85a78... | 1 | 4 | 4 |
44bed6eab24fea3496f746498ee5c0f755d1e60c | daxpedda | 2022-01-27T14:28:05 | Fix double `mut` on `AssertZeroizeOnDrop` (#719) | diff --git a/zeroize/src/lib.rs b/zeroize/src/lib.rs
index 58dc4d9..b9a143b 100644
--- a/zeroize/src/lib.rs
+++ b/zeroize/src/lib.rs
@@ -268,11 +268,11 @@ pub mod __internal {
/// Auto-deref workaround for deriving `ZeroizeOnDrop`.
pub trait AssertZeroizeOnDrop {
- fn zeroize_or_on_drop(&mut self);
+... | 2 | 17 | 2 |
ca1632522a6fbcc055bbf6daebdde9eaf31df047 | daxpedda | 2022-01-14T21:24:01 | Remove `ZeroizeOnDrop` implementation for `#[zeroize(drop)]` (#715) | diff --git a/zeroize/derive/src/lib.rs b/zeroize/derive/src/lib.rs
index b96e9e7..1efc3b4 100644
--- a/zeroize/derive/src/lib.rs
+++ b/zeroize/derive/src/lib.rs
@@ -317,8 +317,6 @@ fn derive_zeroize_with_drop(s: synstructure::Structure<'_>) -> TokenStream {
}
});
- let zeroize_on_drop_impl = impl_zer... | 1 | 0 | 10 |
16d2e694ee260363e78216ebd08278d3ad09db8f | Alexander Wagner | 2022-01-13T16:47:52 | zeroize: Fix typo in doctests (#710) | diff --git a/zeroize/src/lib.rs b/zeroize/src/lib.rs
index ccb4cb4..cb061e6 100644
--- a/zeroize/src/lib.rs
+++ b/zeroize/src/lib.rs
@@ -84,7 +84,7 @@
//! Example which derives `Drop`:
//!
//! ```
-//! # #[cfg(feature = "derive")]
+//! # #[cfg(feature = "zeroize_derive")]
//! # {
//! use zeroize::{Zeroize, Zeroize... | 1 | 3 | 3 |
dcb5ed9bfd5809db94920981e8644dd2c6fe7a13 | Alexander Wagner | 2022-01-13T16:01:42 | zeroize: Fix docs (#709) | diff --git a/zeroize/src/lib.rs b/zeroize/src/lib.rs
index 101aa1b..ccb4cb4 100644
--- a/zeroize/src/lib.rs
+++ b/zeroize/src/lib.rs
@@ -86,10 +86,10 @@
//! ```
//! # #[cfg(feature = "derive")]
//! # {
-//! use zeroize::{Zeroize, ZeroizeDrop};
+//! use zeroize::{Zeroize, ZeroizeOnDrop};
//!
//! // This struct will... | 1 | 4 | 4 |
0dfd4eb9d65b1180d0f934d8f0375972e96c7fc1 | Tony Arcieri | 2022-01-07T17:27:19 | zeroize v1.5.0-pre (#706) | diff --git a/Cargo.lock b/Cargo.lock
index 99782b9..02a7ba6 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -185,7 +185,7 @@ dependencies = [
[[package]]
name = "zeroize"
-version = "1.4.3"
+version = "1.5.0-pre"
dependencies = [
"zeroize_derive",
]
diff --git a/zeroize/Cargo.toml b/zeroize/Cargo.toml
index f45bc21... | 3 | 3 | 3 |
20a4882c34249ffcb01841b727eccf4c63640c0c | Tony Arcieri | 2022-01-07T17:14:17 | zeroize_derive v1.3.0-pre (#705) | diff --git a/Cargo.lock b/Cargo.lock
index 467a7ac..99782b9 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -192,7 +192,7 @@ dependencies = [
[[package]]
name = "zeroize_derive"
-version = "1.2.2"
+version = "1.3.0-pre"
dependencies = [
"proc-macro2",
"quote",
diff --git a/zeroize/Cargo.toml b/zeroize/Cargo.toml
i... | 3 | 3 | 3 |
de5f6762e31f0f6d9818ee8e1ef256ef27b1ac5e | daxpedda | 2022-01-06T21:53:06 | Add auto-deref workaround for `ZeroizeOnDrop` (#700) | diff --git a/zeroize/derive/src/lib.rs b/zeroize/derive/src/lib.rs
index 549cda0..b96e9e7 100644
--- a/zeroize/derive/src/lib.rs
+++ b/zeroize/derive/src/lib.rs
@@ -69,11 +69,13 @@ fn derive_zeroize(mut s: synstructure::Structure<'_>) -> TokenStream {
/// Custom derive for `ZeroizeOnDrop`
fn derive_zeroize_on_drop(... | 2 | 36 | 7 |
3d9cd398983032f012b8f54f0ab958f8df7f2609 | daxpedda | 2022-01-06T19:19:08 | Implement `ZeroizeOnDrop` for containers (#703) | diff --git a/zeroize/src/lib.rs b/zeroize/src/lib.rs
index 05c29d9..deba5f7 100644
--- a/zeroize/src/lib.rs
+++ b/zeroize/src/lib.rs
@@ -260,8 +260,7 @@ pub trait Zeroize {
}
/// Marker trait signifying that this type will [`zeroize`](Zeroize::zeroize) itself on [`Drop`].
-#[allow(drop_bounds)]
-pub trait ZeroizeOn... | 1 | 50 | 2 |
3f645e3bbf9393883f2199e1f39eabab9fe20900 | daxpedda | 2022-01-05T00:20:45 | Implement `ZeroizeOnDrop` (#699) | diff --git a/zeroize/derive/src/lib.rs b/zeroize/derive/src/lib.rs
index 4566ac1..549cda0 100644
--- a/zeroize/derive/src/lib.rs
+++ b/zeroize/derive/src/lib.rs
@@ -22,7 +22,7 @@ decl_derive!(
/// Supports the following attributes:
///
/// On the item level:
- /// - `#[zeroize(drop)]`: call `zeroize()... | 3 | 168 | 37 |
9f227d3830c983e33cd1e1d37f31b5a085d3f94a | Artyom Pavlov | 2021-12-21T09:33:18 | Update logo URL (#691) | diff --git a/block-padding/src/lib.rs b/block-padding/src/lib.rs
index 9a1d757..8be43a3 100644
--- a/block-padding/src/lib.rs
+++ b/block-padding/src/lib.rs
@@ -5,8 +5,8 @@
//! of the box.
#![no_std]
#![doc(
- html_logo_url = "https://raw.githubusercontent.com/RustCrypto/meta/master/logo.svg",
- html_favicon_u... | 6 | 15 | 11 |
b32928fceec970be4579fcc2d06b2bf3e307ff47 | Artyom Pavlov | 2021-12-21T08:20:06 | dbl: release v0.3.2 (#690) | diff --git a/Cargo.lock b/Cargo.lock
index 16cd92f..891c285 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -36,7 +36,7 @@ dependencies = [
[[package]]
name = "dbl"
-version = "0.3.1"
+version = "0.3.2"
dependencies = [
"generic-array",
]
diff --git a/dbl/Cargo.toml b/dbl/Cargo.toml
index 2655841..d683e84 100644
--... | 3 | 32 | 25 |
9701c71673ef81c6653f18d1b61acdc8ec88ba63 | Alexander Wagner | 2021-12-21T07:49:44 | dbl: Refactor to avoid unsafe (#688) | diff --git a/dbl/src/lib.rs b/dbl/src/lib.rs
index f9c22cf..1f1515c 100644
--- a/dbl/src/lib.rs
+++ b/dbl/src/lib.rs
@@ -1,3 +1,4 @@
+#![forbid(unsafe_code)]
#![no_std]
#![doc(
html_logo_url = "https://raw.githubusercontent.com/RustCrypto/meta/master/logo.svg",
@@ -10,7 +11,7 @@ extern crate generic_array;
use ... | 1 | 48 | 30 |
26299dd6c0400fe938f5a99c1071cd2553360543 | Brice Arnould | 2021-11-20T03:16:31 | Contributing iso-10126 (#643) | diff --git a/block-padding/src/lib.rs b/block-padding/src/lib.rs
index 20698d7..9a1d757 100644
--- a/block-padding/src/lib.rs
+++ b/block-padding/src/lib.rs
@@ -101,6 +101,26 @@ impl<B: ArrayLength<u8>> Padding<B> for ZeroPadding {
#[derive(Clone, Copy, Debug)]
pub struct Pkcs7;
+impl Pkcs7 {
+ #[inline]
+ fn... | 1 | 55 | 14 |
63c8e60fcd40e3fda2d0661514a4d5f43c10ced2 | daxpedda | 2021-11-11T16:48:31 | Implement `#[zeroize(bound = "T: MyTrait")]` (#663) | diff --git a/zeroize/derive/src/lib.rs b/zeroize/derive/src/lib.rs
index fc4e1a5..4566ac1 100644
--- a/zeroize/derive/src/lib.rs
+++ b/zeroize/derive/src/lib.rs
@@ -6,8 +6,13 @@
use proc_macro2::TokenStream;
use quote::quote;
-use syn::{Attribute, Meta, NestedMeta};
-use synstructure::{decl_derive, BindStyle, Bindi... | 3 | 200 | 3 |
3b81567e9a291d0f9c743a96d713dd4526555424 | daxpedda | 2021-11-10T14:16:55 | Document `#[zeroize(skip)]` in the zeroize crate (#662) | diff --git a/zeroize/derive/src/lib.rs b/zeroize/derive/src/lib.rs
index 6c61f2f..fc4e1a5 100644
--- a/zeroize/derive/src/lib.rs
+++ b/zeroize/derive/src/lib.rs
@@ -14,12 +14,13 @@ decl_derive!(
/// Derive the `Zeroize` trait.
///
- /// Supports the following attribute:
+ /// Supports the following at... | 2 | 11 | 6 |
c678c969151448e7b49f5e9fe6ad8f9d6ff61151 | Tony Arcieri | 2021-11-07T23:51:12 | Cargo.lock: bump dependencies (#661) | diff --git a/Cargo.lock b/Cargo.lock
index cddc098..9a210a7 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -70,9 +70,9 @@ checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4"
[[package]]
name = "libc"
-version = "0.2.103"
+version = "0.2.107"
source = "registry+https://github.com/rust-lang/cr... | 1 | 11 | 11 |
d84780528331e0bf74d3179406559402b77a58e5 | Allen-Webb | 2021-11-07T23:38:10 | zeroize: Add Zeroize implementations for common types. (#660)
This adds Zeroize implementations for the following types:
* PhantomData<T>
* PhantomPinned
* Tuples from length 0, to 10
This fixes issue #651. | diff --git a/zeroize/src/lib.rs b/zeroize/src/lib.rs
index 565f9c3..28ee542 100644
--- a/zeroize/src/lib.rs
+++ b/zeroize/src/lib.rs
@@ -214,6 +214,7 @@ pub use zeroize_derive::Zeroize;
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
mod x86;
+use core::marker::{PhantomData, PhantomPinned};
use core::mem:... | 1 | 65 | 0 |
808dd24caf31c8ded50943d77c01447b472aff00 | Tony Arcieri | 2021-11-05T02:12:47 | zeroize_derive: add `#[zeroize(skip)]` attribute (#654)
Original PR: https://github.com/iqlusioninc/crates/pull/900 | diff --git a/zeroize/derive/src/lib.rs b/zeroize/derive/src/lib.rs
index 8bd2528..6c61f2f 100644
--- a/zeroize/derive/src/lib.rs
+++ b/zeroize/derive/src/lib.rs
@@ -18,6 +18,8 @@ decl_derive!(
///
/// - `#[zeroize(drop)]`: derives the `Drop` trait, calling `zeroize()`
/// when this item is dropped.
+ ... | 2 | 255 | 1 |
83f8eae5b654e3c8ab67b985f877ca8ec422d932 | Michael Lodder | 2021-09-14T16:03:13 | Implement Divide and Modulo crypto-bigint (#632)
- add div
- implement ct div
Signed-off-by: Michael Lodder <redmike7@gmail.com> | diff --git a/crypto-bigint/proptests/Cargo.toml b/crypto-bigint/proptests/Cargo.toml
index 68d3648..b34c2a1 100644
--- a/crypto-bigint/proptests/Cargo.toml
+++ b/crypto-bigint/proptests/Cargo.toml
@@ -13,4 +13,5 @@ members = ["."]
[dependencies]
crypto-bigint = { path = ".." }
num-bigint = "0.4"
+num-traits = "0.2"
... | 8 | 449 | 2 |
0fe702320c124abcce9425bf83f40ee0c159f781 | Tony Arcieri | 2021-09-14T04:04:01 | pkcs5: remove unnecessary `doc_cfg` directive (#634)
The toplevel crate feature already takes care of it | diff --git a/pkcs5/src/pbes2.rs b/pkcs5/src/pbes2.rs
index a9f691c..4a870f9 100644
--- a/pkcs5/src/pbes2.rs
+++ b/pkcs5/src/pbes2.rs
@@ -2,8 +2,6 @@
//!
//! [RFC 8018 Section 6.2]: https://tools.ietf.org/html/rfc8018#section-6.2
-#![cfg_attr(docsrs, feature(doc_cfg))]
-
mod kdf;
#[cfg(feature = "pbes2")] | 1 | 0 | 2 |
445ea43b44a34fa38db5bcebcd20001f62e7534f | Tony Arcieri | 2021-09-13T17:30:28 | pkcs8: add "About PKCS#8" intro section to rustdoc (#631)
Describes what PKCS#8 actually is and gives examples of the "BEGIN"
pre-encapsulation boundaries | diff --git a/pkcs1/src/lib.rs b/pkcs1/src/lib.rs
index cc486f1..5fa0507 100644
--- a/pkcs1/src/lib.rs
+++ b/pkcs1/src/lib.rs
@@ -3,7 +3,6 @@
//! RSA Cryptography Specifications Version 2.2 ([RFC 8017])
//!
//! ## About
-//!
//! This crate supports encoding and decoding RSA private and public keys
//! in either PKC... | 2 | 24 | 4 |
4c4011afc063495aa300404db110996b148d0e77 | Tony Arcieri | 2021-09-12T17:39:59 | x509: `cargo audit` workaround (#629)
This is effectively a bug in `cargo audit` where it sees a yanked `x509`
crate published to crates.io and confuses it with the workspace member.
To work around the issue, this commit bumps the version of the `x509`
crate in the workspace to v0.0.1, which hasn't been yanked. | diff --git a/Cargo.lock b/Cargo.lock
index 9675ca7..9b24ce4 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -478,7 +478,7 @@ dependencies = [
[[package]]
name = "x509"
-version = "0.0.0"
+version = "0.0.1"
dependencies = [
"der",
"spki",
diff --git a/x509/Cargo.toml b/x509/Cargo.toml
index 804e3c1..c9f0646 100644
... | 3 | 3 | 3 |
21be1b497b5c5f570f2d36a7271798555369eabb | Tony Arcieri | 2021-09-12T16:31:49 | crypto-bigint: factor const `Limb` selectors into `limb` module (#627)
Small followup from #624: since these functions operate on
limbs/limb-related types, this factors them into the `limb` module. | diff --git a/crypto-bigint/src/limb.rs b/crypto-bigint/src/limb.rs
index 4f98b1d..956dc87 100644
--- a/crypto-bigint/src/limb.rs
+++ b/crypto-bigint/src/limb.rs
@@ -39,7 +39,7 @@ pub type Inner = u32;
/// SignedInner integer type that the [`Limb`] newtype wraps.
#[cfg(target_pointer_width = "32")]
-pub type SignedI... | 5 | 26 | 24 |
0538470f03da97b8eae1ff2f2868d894b0b57e07 | Tony Arcieri | 2021-09-12T16:05:17 | crypto-bigint: fix `add_mod` overflow handling (#619)
This PR is effectively an extraction of modular addition as implemented in
the `p256` crate.
It conditionally subtracts the modulus on overflow.
It includes a test case extracted from `p256` which captures a case
where the previous `add_mod` implementation ... | diff --git a/crypto-bigint/proptests/tests/equivalence.rs b/crypto-bigint/proptests/tests/equivalence.rs
index 122b9c1..192ee7b 100644
--- a/crypto-bigint/proptests/tests/equivalence.rs
+++ b/crypto-bigint/proptests/tests/equivalence.rs
@@ -1,6 +1,6 @@
//! Equivalence tests between `num-bigint` and `crypto-bigint`
-... | 2 | 42 | 96 |
0b6319c05fae456a05b80fcc39287e89afafa60e | Michael Lodder | 2021-09-12T15:48:53 | more tests for shl (#624) | diff --git a/crypto-bigint/src/limb.rs b/crypto-bigint/src/limb.rs
index f7e3a94..4f98b1d 100644
--- a/crypto-bigint/src/limb.rs
+++ b/crypto-bigint/src/limb.rs
@@ -37,6 +37,10 @@ pub const BYTE_SIZE: usize = 4;
#[cfg(target_pointer_width = "32")]
pub type Inner = u32;
+/// SignedInner integer type that the [`Limb`... | 4 | 54 | 7 |
22f81601eaadcaa26c920d86c6cbfc0a70eb910a | Michael Lodder | 2021-09-10T18:10:53 | add shl (#622)
Signed-off-by: Michael Lodder <redmike7@gmail.com> | diff --git a/crypto-bigint/src/uint.rs b/crypto-bigint/src/uint.rs
index 4966abc..0e73df2 100644
--- a/crypto-bigint/src/uint.rs
+++ b/crypto-bigint/src/uint.rs
@@ -16,6 +16,7 @@ mod encoding;
mod from;
mod mul;
mod neg_mod;
+mod shl;
mod shr;
mod sub;
mod sub_mod;
diff --git a/crypto-bigint/src/uint/shl.rs b/cry... | 2 | 116 | 0 |
d5420aff75b61b48e3de36ccad10d7a8aee0e48c | Tony Arcieri | 2021-09-08T16:03:15 | crypto-bigint: Recursive Length Prefix (RLP) encoding support (#616)
Adds an off-by-default optional `rlp` crate feature which adds RLP
encoding/decoding support for `UInt`. | diff --git a/Cargo.lock b/Cargo.lock
index c8cc665..0662024 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -65,6 +65,12 @@ dependencies = [
"generic-array",
]
+[[package]]
+name = "bytes"
+version = "1.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c4872d67bab6358e59559027aa3b9157... | 8 | 179 | 57 |
b4a5373699aa2ec28304558e525c3dc60065367a | Tony Arcieri | 2021-09-07T15:00:32 | crypto-bigint: impl `ShrAssign` for `UInt` (#615) | diff --git a/crypto-bigint/src/uint/shr.rs b/crypto-bigint/src/uint/shr.rs
index 2e552f0..48f8ea2 100644
--- a/crypto-bigint/src/uint/shr.rs
+++ b/crypto-bigint/src/uint/shr.rs
@@ -2,7 +2,7 @@
use super::UInt;
use crate::{limb, Limb};
-use core::ops::Shr;
+use core::ops::{Shr, ShrAssign};
impl<const LIMBS: usize... | 1 | 7 | 1 |
8fa1b4fb22789fb5afd51bc1fad08ebf95789965 | Tony Arcieri | 2021-09-03T17:15:44 | crypto-bigint: `Integer` trait (#612)
Adds a trait encompassing the interesting bounds of `UInt`.
Since traits like `elliptic_curve::Curve` can't yet be generic over
`const LIMBS`, this trait provides a convenient way of wrapping up
`UInt` behavior such that it's still usable without spelling out all of
these bo... | diff --git a/crypto-bigint/Cargo.toml b/crypto-bigint/Cargo.toml
index dd19664..5a1e440 100644
--- a/crypto-bigint/Cargo.toml
+++ b/crypto-bigint/Cargo.toml
@@ -20,7 +20,7 @@ subtle = { version = "2.4", default-features = false }
# optional dependencies
rand_core = { version = "0.6", optional = true }
-zeroize = { ... | 5 | 112 | 9 |
4b47596c96177b656b59e665026c7c35dc64d7e1 | Tony Arcieri | 2021-09-02T19:17:09 | Cargo.lock: bump dependencies (#611) | diff --git a/Cargo.lock b/Cargo.lock
index b2c4a24..63ea880 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -427,9 +427,9 @@ dependencies = [
[[package]]
name = "typenum"
-version = "1.13.0"
+version = "1.14.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "879f6906492a7cd215bfa4cf595b60... | 1 | 2 | 2 |
e987b5b98659b1994a71520d6a66aff6a58be1f3 | Tony Arcieri | 2021-09-02T18:34:36 | crypto-bigint: fix `ConditionallySelectable` impl on `UInt` (#609)
It was only assigning the first limb, causing it to miscompute results.
While it had a test, it was a naive test that didn't ensure the limbs
were unique.
The bug has been fixed and the test has been improved. | diff --git a/crypto-bigint/src/uint.rs b/crypto-bigint/src/uint.rs
index 51c7c08..f00a62a 100644
--- a/crypto-bigint/src/uint.rs
+++ b/crypto-bigint/src/uint.rs
@@ -92,7 +92,7 @@ impl<const LIMBS: usize> ConditionallySelectable for UInt<LIMBS> {
let mut limbs = [Limb::ZERO; LIMBS];
for i in 0..LIMBS... | 2 | 15 | 13 |
0dd1439a6ec388653c1e188864be6438f8439daa | Tony Arcieri | 2021-08-30T14:28:25 | Cargo.lock: bump dependencies (#606) | diff --git a/Cargo.lock b/Cargo.lock
index 9fa22f4..783100a 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -88,16 +88,7 @@ version = "0.0.2"
name = "const-oid"
version = "0.6.0"
dependencies = [
- "hex-literal 0.3.1",
-]
-
-[[package]]
-name = "cpufeatures"
-version = "0.1.4"
-source = "registry+https://github.com/rust... | 1 | 28 | 37 |
a06c16781f45c8a2bb9d77b622c770a380f53eae | Tony Arcieri | 2021-08-29T16:17:27 | cpufeatures: remove vestigial code around `crypto` target feature (#600)
This was removed in #594, however this is some remaining support code
for it. | diff --git a/cpufeatures/src/aarch64.rs b/cpufeatures/src/aarch64.rs
index c5f9d61..727f623 100644
--- a/cpufeatures/src/aarch64.rs
+++ b/cpufeatures/src/aarch64.rs
@@ -83,7 +83,6 @@ pub mod hwcaps {
use libc::c_ulong;
pub const AES: c_ulong = libc::HWCAP_AES | libc::HWCAP_PMULL;
- pub const CRYPTO: c_ul... | 1 | 0 | 1 |
a5b0647950ebdb5f7c9628ec0bb71e89674da844 | Tony Arcieri | 2021-08-26T23:36:52 | Revert "Use from_bytes_with_nul for string check (#583)" (#597)
This reverts commit deec9741a08fb10a1c9a53230872b25aab214a94. | diff --git a/cpufeatures/src/aarch64.rs b/cpufeatures/src/aarch64.rs
index d59b297..c5f9d61 100644
--- a/cpufeatures/src/aarch64.rs
+++ b/cpufeatures/src/aarch64.rs
@@ -121,13 +121,18 @@ macro_rules! check {
/// macOS helper function for calling `sysctlbyname`.
#[cfg(target_os = "macos")]
pub unsafe fn sysctlbyname(... | 1 | 7 | 2 |
d5065ada3cde6d8ee29bf59afbc4c57a4922db00 | Tony Arcieri | 2021-08-26T15:40:50 | cpufeatures: remove AArch64 `crypto` target feature (#594)
It was removed from the nightly compiler in this PR:
https://github.com/rust-lang/rust/pull/87729
This crate attempts to provide a 1:1 mapping of CPU feature detection to
rustc's own target features, so this PR accordingly removes it.
Breaking change... | diff --git a/cpufeatures/src/aarch64.rs b/cpufeatures/src/aarch64.rs
index 9af1bc3..d59b297 100644
--- a/cpufeatures/src/aarch64.rs
+++ b/cpufeatures/src/aarch64.rs
@@ -67,7 +67,6 @@ macro_rules! __expand_check_macro {
#[cfg(target_os = "linux")]
__expand_check_macro! {
("aes", AES), // Enable AES support.... | 1 | 0 | 7 |
3305cf1523f97798a529c2f35588731d4d30608e | Tony Arcieri | 2021-08-23T21:13:42 | crypto-bigint: rename `UInt::shr` to `UInt::shr_vartime` (#590)
Renames this function to note that it's constant-time with respect to
the `self` value, but variable-time with respect to the amount the
`self` value is being shifted by. | diff --git a/crypto-bigint/src/uint/shr.rs b/crypto-bigint/src/uint/shr.rs
index 05aad7d..2e552f0 100644
--- a/crypto-bigint/src/uint/shr.rs
+++ b/crypto-bigint/src/uint/shr.rs
@@ -6,9 +6,13 @@ use core::ops::Shr;
impl<const LIMBS: usize> UInt<LIMBS> {
/// Computes `self >> n`.
- // TODO(tarcieri): replace w... | 1 | 16 | 4 |
33ad0b6cca5f4daf6f6697117abdf7df06b469c2 | Tony Arcieri | 2021-08-22T23:04:19 | crypto-bigint: bitwise right shift support for `UInt` (#586)
Supports bitwise right shifts either as a `const fn` or using the
`core::ops::Shr` trait. | diff --git a/crypto-bigint/src/uint.rs b/crypto-bigint/src/uint.rs
index 5851490..51c7c08 100644
--- a/crypto-bigint/src/uint.rs
+++ b/crypto-bigint/src/uint.rs
@@ -16,6 +16,7 @@ mod encoding;
mod from;
mod mul;
mod neg_mod;
+mod shr;
mod sub;
mod sub_mod;
diff --git a/crypto-bigint/src/uint/shr.rs b/crypto-bigi... | 2 | 76 | 0 |
e927e6e2279282592c262c0121c640b80dc0809c | Tony Arcieri | 2021-08-22T22:17:37 | crypto-bigint: add `[limb::Inner; LIMBS]` conversions for `UInt` (#585)
Adds `const fn` functions `from_uint_array` and `to_uint_array` for
converting `UInt` from/to the inner word-sized unsigned integer that the
`Limb` newtype wraps.
Also adds `From` trait impls which wrap these functions. | diff --git a/crypto-bigint/src/uint/from.rs b/crypto-bigint/src/uint/from.rs
index e336ba4..54e841b 100644
--- a/crypto-bigint/src/uint/from.rs
+++ b/crypto-bigint/src/uint/from.rs
@@ -78,6 +78,37 @@ impl<const LIMBS: usize> UInt<LIMBS> {
Self { limbs }
}
+
+ /// Create a [`UInt`] from an array of th... | 1 | 52 | 3 |
9a0f77ebf00b23d6f6b2f0d15a78115286255b99 | Tony Arcieri | 2021-08-22T18:19:38 | crypto-bigint: expose `limb` module (#584)
This allows the `nlimbs!` macro to work, but also can provide the basis
for expanded limb-related conversions, such as converting to an array of
the inner integers. | diff --git a/Cargo.lock b/Cargo.lock
index 6f2cac7..2c08f13 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -109,7 +109,7 @@ dependencies = [
[[package]]
name = "crypto-bigint"
-version = "0.2.2"
+version = "0.2.3"
dependencies = [
"generic-array",
"hex-literal 0.3.1",
diff --git a/crypto-bigint/src/lib.rs b/crypt... | 3 | 36 | 21 |
deec9741a08fb10a1c9a53230872b25aab214a94 | Kornel | 2021-08-20T20:47:37 | Use from_bytes_with_nul for string check (#583) | diff --git a/cpufeatures/src/aarch64.rs b/cpufeatures/src/aarch64.rs
index 86af2c9..9af1bc3 100644
--- a/cpufeatures/src/aarch64.rs
+++ b/cpufeatures/src/aarch64.rs
@@ -125,18 +125,13 @@ macro_rules! check {
/// macOS helper function for calling `sysctlbyname`.
#[cfg(target_os = "macos")]
pub unsafe fn sysctlbyname(... | 1 | 2 | 7 |
ec11298b5556c898cf81a35ed023630e9dd3003c | Artyom Pavlov | 2021-08-16T16:48:35 | crypto-bigint: implement Hash (#579) | diff --git a/crypto-bigint/src/limb.rs b/crypto-bigint/src/limb.rs
index 8af1351..0b14e6a 100644
--- a/crypto-bigint/src/limb.rs
+++ b/crypto-bigint/src/limb.rs
@@ -1,5 +1,7 @@
//! Limb newtype.
+#![allow(clippy::derive_hash_xor_eq)]
+
mod add;
mod bit_and;
mod bit_or;
@@ -45,7 +47,7 @@ pub(crate) type Wide = u12... | 2 | 9 | 3 |
6fb98cb62a3281dc09bd44134804d1de06787f0b | Tony Arcieri | 2021-08-14T18:04:23 | base64ct: make `Encoding::decode` reject invalid padding (#577)
When `Variant::PADDED` is `true`, ensure that the decoded data
round-trips back to the padded input. If the padding is malformed,
returns `Error::InvalidEncoding`.
Note that this commit only impls this check for the non-in-place
`decode` method, not... | diff --git a/base64ct/src/encoding.rs b/base64ct/src/encoding.rs
index ef4fe1e..911b2d4 100644
--- a/base64ct/src/encoding.rs
+++ b/base64ct/src/encoding.rs
@@ -21,6 +21,9 @@ pub trait Encoding {
fn decode(src: impl AsRef<[u8]>, dst: &mut [u8]) -> Result<&[u8], Error>;
/// Decode a Base64 string in-place.
+... | 2 | 62 | 11 |
dc8f4e19ddbff2821273d94e0cbf0813db28d3db | Alexandre Pauwels | 2021-08-09T00:54:06 | fix: set constructed bit in SET (#572) | diff --git a/der/src/tag.rs b/der/src/tag.rs
index 7438dd8..41f746d 100644
--- a/der/src/tag.rs
+++ b/der/src/tag.rs
@@ -121,7 +121,7 @@ impl Tag {
Tag::ObjectIdentifier => 0x06,
Tag::Utf8String => 0x0C,
Tag::Sequence => 0x10 | CONSTRUCTED_FLAG,
- Tag::Set => 0x11,
+ ... | 1 | 2 | 2 |
52786dd5ae99de913a75d219507f5d343bfe8856 | Tony Arcieri | 2021-08-08T18:39:13 | der: fix encoding for 20xx UTCTime dates (#569)
Closes #568
UTCTime uses a 2-digit year, ranging from 1950 to 2049.
Encoding for years after 1999 was being mishandled, because they rolled
over to 100, resulting in a three digit year when only 2 digits are
supported by the encoder.
This commit ensures dates ... | diff --git a/der/src/asn1/utc_time.rs b/der/src/asn1/utc_time.rs
index e351ac7..0d26c66 100644
--- a/der/src/asn1/utc_time.rs
+++ b/der/src/asn1/utc_time.rs
@@ -125,7 +125,14 @@ impl Encodable for UtcTime {
DateTime::from_unix_duration(self.0).ok_or_else(|| Self::TAG.value_error())?;
debug_asser... | 1 | 34 | 3 |
4ad17f71a44967cb84c0d47a5e9deecad1ef9f63 | Tony Arcieri | 2021-07-27T15:21:17 | Add `parser-implementations` category to parser Cargo.toml(s) (#560)
Adds this category to all crates which implement format parsers | diff --git a/base64ct/Cargo.toml b/base64ct/Cargo.toml
index f320c5e..9459e5e 100644
--- a/base64ct/Cargo.toml
+++ b/base64ct/Cargo.toml
@@ -11,7 +11,7 @@ license = "Apache-2.0 OR MIT"
edition = "2018"
documentation = "https://docs.rs/pkcs8"
repository = "https://github.com/RustCrypto/utils/tree/master/base64ct"
-ca... | 7 | 9 | 8 |
dbb94294e70f9d83233bce524b6fd87d405f20f8 | Tony Arcieri | 2021-07-26T16:03:17 | pkcs8: support for customizing PEM `LineEnding` (#554)
Adds `*pem_with_le` methods that support customizing the `LineEnding`
used when encoding PEM.
See also #553. | diff --git a/pem-rfc7468/src/encoder.rs b/pem-rfc7468/src/encoder.rs
index c59800b..6fe3050 100644
--- a/pem-rfc7468/src/encoder.rs
+++ b/pem-rfc7468/src/encoder.rs
@@ -69,13 +69,13 @@ pub fn encode_string(label: &str, line_ending: LineEnding, input: &[u8]) -> Resu
#[allow(clippy::upper_case_acronyms)]
#[derive(Copy,... | 15 | 95 | 36 |
1d9c271c8beb6023919907b0dfad8633dd518460 | Tony Arcieri | 2021-07-26T15:47:42 | pkcs1: support for customizing PEM `LineEnding` (#553)
Adds `*pem_with_le` methods that support customizing the `LineEnding`
used when encoding PEM. | diff --git a/pkcs1/src/document/private_key.rs b/pkcs1/src/document/private_key.rs
index 0f72cf6..1df41fb 100644
--- a/pkcs1/src/document/private_key.rs
+++ b/pkcs1/src/document/private_key.rs
@@ -11,7 +11,10 @@ use zeroize::{Zeroize, Zeroizing};
#[cfg(feature = "pem")]
use {
- crate::{pem, private_key::PEM_TYPE... | 5 | 60 | 22 |
ba3a10e4f7856b059c72085e3c5232f79dda86f8 | Tony Arcieri | 2021-07-26T15:05:01 | pem-rfc7468: support for customizing PEM line endings (#551)
Makes line endings used for PEM encoding explicit, with the option of
using `Default::default` to use the current operating system's line
endings, or otherwise picking from CR, LF, or CRLF. | diff --git a/pem-rfc7468/src/encoder.rs b/pem-rfc7468/src/encoder.rs
index 8c1c999..c59800b 100644
--- a/pem-rfc7468/src/encoder.rs
+++ b/pem-rfc7468/src/encoder.rs
@@ -1,7 +1,8 @@
//! PEM encoder.
use crate::{
- grammar, Error, Result, BASE64_WRAP_WIDTH, ENCAPSULATION_BOUNDARY_DELIMITER,
+ grammar::{self, CH... | 12 | 105 | 31 |
e9725df586f5ec98672df41824e47d5f153d28bd | Tony Arcieri | 2021-07-25T20:17:11 | pkcs1+pkcs8: simplify/fix version encoder (#547)
Uses the `u8` encoder to encode version numbers | diff --git a/pkcs1/src/version.rs b/pkcs1/src/version.rs
index 9251f7c..74f82f4 100644
--- a/pkcs1/src/version.rs
+++ b/pkcs1/src/version.rs
@@ -59,8 +59,7 @@ impl Encodable for Version {
}
fn encode(&self, encoder: &mut Encoder<'_>) -> der::Result<()> {
- der::Header::new(Self::TAG, 1u8)?.encode(enc... | 2 | 2 | 4 |
3659f3007e7b8f2dbf852a7315eabbac3bb5bf83 | Tony Arcieri | 2021-07-25T18:03:23 | pkcs1: add `Error::Crypto` variant (#544)
Add a variant for relaying cryptographic errors, e.g. a key component
which was expected to be a prime is not a prime. | diff --git a/pkcs1/src/error.rs b/pkcs1/src/error.rs
index b5fee25..1de3018 100644
--- a/pkcs1/src/error.rs
+++ b/pkcs1/src/error.rs
@@ -19,6 +19,14 @@ pub enum Error {
/// ASN.1 DER-related errors.
Asn1(der::Error),
+ /// Cryptographic errors.
+ ///
+ /// These can be used by RSA implementations t... | 1 | 9 | 0 |
a2a8f025524be2b752df6860994c2bb7f85ddb24 | Tony Arcieri | 2021-07-25T14:52:05 | pkcs1: use `FromRsa*`/`ToRsa*` traits with `*Document` types (#541)
This commit impls the decoding/encoding traits for
`RsaPrivateKey`/`RsaPublicKey` on the serialized
`RsaPrivateKeyDocument`/`RsaPublicKeyDocument` types. | diff --git a/pkcs1/src/document/private_key.rs b/pkcs1/src/document/private_key.rs
index 664b9da..780f478 100644
--- a/pkcs1/src/document/private_key.rs
+++ b/pkcs1/src/document/private_key.rs
@@ -1,6 +1,6 @@
//! PKCS#1 RSA private key document.
-use crate::{error, Error, Result, RsaPrivateKey};
+use crate::{error, ... | 6 | 125 | 128 |
2b3c7afc620b19cfe536c27253c4662ba8dca79d | David Drysdale | 2021-07-25T12:34:52 | Tool to convert Wycheproof test vectors to .blb files (#280) | diff --git a/Cargo.lock b/Cargo.lock
index f0b2b0a..66e6ed8 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -200,6 +200,12 @@ dependencies = [
"digest",
]
+[[package]]
+name = "itoa"
+version = "0.4.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "dd25036021b0de88a0aff6b850051563c6516d... | 13 | 850 | 73 |
3964b6b7c6310c4249391a803574177a3ec6a39f | Tony Arcieri | 2021-07-25T03:46:49 | pkcs1: add From*/To* traits for RsaPrivateKey/RsaPublicKey (#540)
Adds traits similar to the ones in the `pkcs8` crate for decoding and
encoding RSA private/public keys, including loading and saving them from
disk when the `std` feature is enabled. | diff --git a/pkcs1/src/lib.rs b/pkcs1/src/lib.rs
index 2386ee1..ff9a66c 100644
--- a/pkcs1/src/lib.rs
+++ b/pkcs1/src/lib.rs
@@ -42,6 +42,7 @@ extern crate std;
mod error;
mod private_key;
mod public_key;
+mod traits;
mod version;
#[cfg(feature = "alloc")]
@@ -49,9 +50,6 @@ mod document;
pub use der::{self, a... | 2 | 172 | 3 |
659bed91a00f39c830af06508d8e150ecaa2ec84 | Tony Arcieri | 2021-07-24T17:34:08 | pkcs1: replace Error::{Decode, Encode} with Error::Asn1 (#538)
Replaces opaque variants for decoding/encoding errors with one which
propagates the underlying `der::Error`.
Technically a breaking change, but the initial release was today, so
it's possible to just nuke it and publish a replacement. | diff --git a/pkcs1/src/error.rs b/pkcs1/src/error.rs
index 52a8620..75d6c7f 100644
--- a/pkcs1/src/error.rs
+++ b/pkcs1/src/error.rs
@@ -20,11 +20,8 @@ pub type Result<T> = core::result::Result<T, Error>;
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
#[non_exhaustive]
pub enum Error {
- /// Decoding errors
- De... | 2 | 6 | 10 |
810d7b473719a21354e8c6a7d3828831133fd61e | Tony Arcieri | 2021-07-24T15:03:54 | pkcs8: add `error::PEM_ENCODING_MSG` constant (#535)
Ensures that the `expect` message for PEM encoding failures is
consistent.
Separately, it might make sense to move to a fallible encoding API
eventually to ensure code is panic-free, but for now this at least
ensures consistency. | diff --git a/pem-rfc7468/Cargo.toml b/pem-rfc7468/Cargo.toml
index b8170c1..06c1962 100644
--- a/pem-rfc7468/Cargo.toml
+++ b/pem-rfc7468/Cargo.toml
@@ -11,7 +11,7 @@ cryptographic private keys.
authors = ["RustCrypto Developers"]
license = "Apache-2.0 OR MIT"
edition = "2018"
-repository = "https://github.com/RustC... | 7 | 21 | 8 |
d58b2cf087a82f75b39ace372a04fce06ce627a4 | Tony Arcieri | 2021-07-20T17:43:46 | pkcs8: add `Error::ParamatersMalformed` variant (#523)
Adds a variant for relaying that `AlgorithmIdentifier::parameters` are
in some way malformed.
This is useful in cases where parameters are expected to be something
other than an OID, for example `None` or ASN.1 NULL. | diff --git a/pkcs8/src/error.rs b/pkcs8/src/error.rs
index 0725c9e..f91ac9c 100644
--- a/pkcs8/src/error.rs
+++ b/pkcs8/src/error.rs
@@ -39,6 +39,10 @@ pub enum Error {
#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
Io,
+ /// [`AlgorithmIdentifier::parameters`][`crate::AlgorithmIdentifier::parameters`]
+... | 1 | 6 | 1 |
2026dc11716d7bf9231c7392fecdda40657956b2 | Tony Arcieri | 2021-07-20T17:06:53 | pkcs8: add `Error::KeyMalformed` variant (#521)
Adds an error variant which makes it easy to relay that raw
octet-encoded key data is malformed/invalid. | diff --git a/pkcs8/src/error.rs b/pkcs8/src/error.rs
index d780347..0725c9e 100644
--- a/pkcs8/src/error.rs
+++ b/pkcs8/src/error.rs
@@ -13,30 +13,40 @@ pub type Result<T> = core::result::Result<T, Error>;
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
#[non_exhaustive]
pub enum Error {
- /// ASN.1 DER-related erro... | 1 | 26 | 15 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.