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
515b00611611707782f694e4138ab3ac847814b4
Tony Arcieri
2020-12-17T04:17:30
elliptic-curve: test `EncodedPoint::conditional_select` (#410)
diff --git a/elliptic-curve/src/sec1.rs b/elliptic-curve/src/sec1.rs index d754f3a..0e29627 100644 --- a/elliptic-curve/src/sec1.rs +++ b/elliptic-curve/src/sec1.rs @@ -499,6 +499,7 @@ mod tests { use crate::{weierstrass, Curve}; use generic_array::{typenum::U32, GenericArray}; use hex_literal::hex; + ...
1
13
0
aac590b62befdc0eddaf0b60e9ae5028a8d93fcd
Tony Arcieri
2020-12-17T04:08:26
elliptic-curve: impl `ConditionallySelectable` for `EncodedPoint` (#409) Support for conditionally selecting an `EncodedPoint` in constant time leveraging the `ConditionallySelectable` trait from the `subtle` crate.
diff --git a/elliptic-curve/src/sec1.rs b/elliptic-curve/src/sec1.rs index 62da077..d754f3a 100644 --- a/elliptic-curve/src/sec1.rs +++ b/elliptic-curve/src/sec1.rs @@ -14,23 +14,21 @@ use generic_array::{ typenum::{Unsigned, U1}, ArrayLength, GenericArray, }; +use subtle::{Choice, ConditionallySelectable}; ...
1
24
8
b860d6ca16d96cdeefaa26ebcabe970c96e21bc7
Tony Arcieri
2020-12-17T03:33:46
elliptic-curve: add `sec1::EncodedPoint::identity()` (#408) Adds a convenience method for obtaining a SEC1-encoded identity point
diff --git a/elliptic-curve/src/sec1.rs b/elliptic-curve/src/sec1.rs index e7c9374..62da077 100644 --- a/elliptic-curve/src/sec1.rs +++ b/elliptic-curve/src/sec1.rs @@ -143,6 +143,12 @@ where .to_encoded_point(compress) } + /// Return [`EncodedPoint`] representing the additive identity + /// (...
1
14
0
01ee4e5e3f6b1eb454a0ab2f92c57e25ffd5e8fa
Tony Arcieri
2020-12-17T03:09:59
elliptic-curve: add `sec1::Coordinates::tag` method (#407) Obtain the `Tag` needed to encode a given set of `sec1::Coordinates`
diff --git a/elliptic-curve/src/sec1.rs b/elliptic-curve/src/sec1.rs index cb66c4f..e7c9374 100644 --- a/elliptic-curve/src/sec1.rs +++ b/elliptic-curve/src/sec1.rs @@ -353,36 +353,21 @@ pub enum Coordinates<'a, C: Curve> { }, } -/// Trait for deserializing a value from a SEC1 encoded curve point. -/// -/// Thi...
1
47
30
2aac343217ed1a13faf1398f5af0b7cd7c8260d7
Tony Arcieri
2020-12-17T02:40:15
elliptic-curve v0.8.0-pre (#406)
diff --git a/Cargo.lock b/Cargo.lock index 20600ba..dca4dbe 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -145,7 +145,7 @@ dependencies = [ [[package]] name = "elliptic-curve" -version = "0.7.1" +version = "0.8.0-pre" dependencies = [ "bitvec", "digest 0.9.0 (registry+https://github.com/rust-lang/crates.io-index...
4
4
4
6edfb14cb317776699adba3d1c85b880e87fb792
Tony Arcieri
2020-12-17T02:33:50
elliptic-curve: bump `pkcs8` crate dependency to v0.3 (#405)
diff --git a/Cargo.lock b/Cargo.lock index 58632b4..20600ba 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -93,9 +93,9 @@ dependencies = [ [[package]] name = "const-oid" -version = "0.3.2" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4fa30214c17255a4c120bd6a199a61b...
4
17
16
76c8f99c381a5b680702a933a1e98b06f672dcf4
Tony Arcieri
2020-12-17T02:04:42
elliptic-curve: ensure PublicKey is not the identity point (#404) Adds an invariant to the `AffinePoint` wrapped by a `PublicKey` which ensures it is not the identity point. This is notable now that we support SEC1 encoding of identity points (#401), as it might be unexpected to end users to receive public keys ...
diff --git a/elliptic-curve/src/ecdh.rs b/elliptic-curve/src/ecdh.rs index 811aee5..c307d68 100644 --- a/elliptic-curve/src/ecdh.rs +++ b/elliptic-curve/src/ecdh.rs @@ -31,7 +31,7 @@ use crate::{ use core::{fmt::Debug, ops::Add}; use ff::PrimeField; use generic_array::ArrayLength; -use group::{Curve as _, Group}; +u...
3
29
13
bb042a4a9630c24aa8b8dc21b81d9b9600099133
Tony Arcieri
2020-12-17T01:43:19
elliptic-curve: remove `SecretKey::secret_value` (#403) After #402, it duplicates `secret_scalar` and can therefore be removed.
diff --git a/elliptic-curve/src/secret_key.rs b/elliptic-curve/src/secret_key.rs index 54f26ee..8517a9d 100644 --- a/elliptic-curve/src/secret_key.rs +++ b/elliptic-curve/src/secret_key.rs @@ -106,24 +106,6 @@ where self.secret_value.clone().into() } - /// Borrow the inner [`NonZeroScalar`] secret va...
1
0
18
3c86a9ee16e925b2cb356893aea41746d63ad17b
Tony Arcieri
2020-12-17T01:36:18
elliptic-curve: have `SecretKey::secret_scalar` return `NonZeroScalar` (#402) The `NonZeroScalar` type upholds an invariant and makes it useful in more places than a `Scalar`.
diff --git a/elliptic-curve/src/secret_key.rs b/elliptic-curve/src/secret_key.rs index d3fa221..54f26ee 100644 --- a/elliptic-curve/src/secret_key.rs +++ b/elliptic-curve/src/secret_key.rs @@ -133,13 +133,13 @@ where /// Please treat it with the care it deserves! #[cfg(feature = "arithmetic")] #[cfg_attr...
1
2
2
509a971b10e831a8229b3f96ef3906179ad5c262
Tony Arcieri
2020-12-17T00:30:52
elliptic-curve: add support for SEC1 identity encoding (#401) Closes #399. The `ToEncodedPoint` trait is infallible. We can either make it fallible (as attempted in #400) or add support for the SEC1 encoding for the identity point. This commit adds SEC1 support for identity, allowing `ToEncodedPoint` to remai...
diff --git a/elliptic-curve/src/ecdh.rs b/elliptic-curve/src/ecdh.rs index e9a7177..811aee5 100644 --- a/elliptic-curve/src/ecdh.rs +++ b/elliptic-curve/src/ecdh.rs @@ -153,7 +153,11 @@ where { /// Create a new shared secret from the given uncompressed curve point fn new(mut encoded_point: EncodedPoint<C>) -...
2
60
19
e9c6862d2feb1d180f1dc40f834d49cb7e2dc67c
Tony Arcieri
2020-12-07T15:23:23
elliptic-curve: constrain `SecretKey::secret_value` exposure (#390) ...to only return `NonZeroScalar<C>` when the `arithmetic` feature is enabled and the curve impl's `ProjectiveArithmetic`. Otherwise the `SecretValue::Secret` type is not intended to be part of the public API.
diff --git a/elliptic-curve/src/secret_key.rs b/elliptic-curve/src/secret_key.rs index f38c6ea..d3fa221 100644 --- a/elliptic-curve/src/secret_key.rs +++ b/elliptic-curve/src/secret_key.rs @@ -33,45 +33,6 @@ use pkcs8::FromPrivateKey; #[cfg(feature = "pem")] use core::str::FromStr; -/// Inner value stored by a [`Se...
1
48
41
7b56fe1c518427506064eb0b216a9bf503b74224
Tony Arcieri
2020-12-07T15:16:06
elliptic-curve: better document PKCS#8 traits (#389)
diff --git a/elliptic-curve/src/public_key.rs b/elliptic-curve/src/public_key.rs index d83ad5c..607acb5 100644 --- a/elliptic-curve/src/public_key.rs +++ b/elliptic-curve/src/public_key.rs @@ -44,8 +44,9 @@ use core::str::FromStr; /// /// To decode an elliptic curve public key from SPKI, enable the `pkcs8` /// featu...
2
6
4
2221f59715a9594e807e0d51b99f04cf0c1454da
Tony Arcieri
2020-12-05T19:02:16
elliptic-curve: use `pkcs8` crate's v0.1 release (#386)
diff --git a/Cargo.lock b/Cargo.lock index c60c0d1..e23b6c0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -93,8 +93,9 @@ dependencies = [ [[package]] name = "const-oid" -version = "0.3.1" -source = "git+https://github.com/RustCrypto/utils.git#aa28abd645c444ed832d4a0adf9bd7189501d076" +version = "0.3.2" +source = "reg...
3
7
8
2425c994969708c5089ef74f4463ff8140fc175c
Tony Arcieri
2020-12-05T18:41:27
elliptic-curve: impl `pkcs8::FromPublicKey` for `PublicKey<C>` (#385) Support for parsing `PublicKey<C>` from DER and PEM encoded documents containing X.509 SubjectPublicKeyInfo. These are one of the common formats for public keys (especially in the OpenSSL ecosystem). Keys in this format begin with: -----...
diff --git a/Cargo.lock b/Cargo.lock index 8356458..c60c0d1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -93,8 +93,8 @@ dependencies = [ [[package]] name = "const-oid" -version = "0.3.0-pre" -source = "git+https://github.com/RustCrypto/utils.git#4183dbfdab9797d2b90e11e19b8750b426d2e179" +version = "0.3.1" +source = ...
4
103
10
5d5754259a6801f5e32373e635be6865ac510e73
Tony Arcieri
2020-12-04T23:00:08
elliptic-curve: minor documentation improvement (#384)
diff --git a/elliptic-curve/src/error.rs b/elliptic-curve/src/error.rs index 5657ae3..15da4f9 100644 --- a/elliptic-curve/src/error.rs +++ b/elliptic-curve/src/error.rs @@ -1,4 +1,4 @@ -//! Error type +//! Error type. use core::fmt::{self, Display}; diff --git a/elliptic-curve/src/lib.rs b/elliptic-curve/src/lib.r...
2
5
3
cd6c0a006ca570c32cdb3a72ffbd6796231a162c
Tony Arcieri
2020-12-04T22:41:04
elliptic-curve: impl FromPkcs8 trait on SecretKey (#383) Added in this `pkcs8` PR: https://github.com/RustCrypto/utils/pull/96
diff --git a/Cargo.lock b/Cargo.lock index 5cbf5b9..8356458 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -94,7 +94,7 @@ dependencies = [ [[package]] name = "const-oid" version = "0.3.0-pre" -source = "git+https://github.com/RustCrypto/utils.git#8285d34b124c726a350e6108f9fb284787fd3976" +source = "git+https://github.c...
2
58
79
9fc65e992de4ea0446bbdc863619d21354b87687
Tony Arcieri
2020-12-04T21:03:06
elliptic-curve: PKCS#8 support for `SecretKey` (#381) Adds initial support for parsing PKCS#8-encoded ECC secret keys. This is presently somewhat difficult to test within this crate (which should be addressed regardless) as it relies on generic parameters of a curve implementation, however this has been tested co...
diff --git a/Cargo.lock b/Cargo.lock index dd3e6aa..c206ef0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -93,9 +93,8 @@ dependencies = [ [[package]] name = "const-oid" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fc33f77ab0b4232f30cb9049a156775c5ad814b030e929d234...
7
104
14
fdff330484c9d03f67ba1eda533a24e757f3e204
Tony Arcieri
2020-12-03T03:01:42
elliptic-curve: add explicit Copy impl for PublicKey (#379) The derived impl appears to have the incorrect bounds
diff --git a/elliptic-curve/src/public_key.rs b/elliptic-curve/src/public_key.rs index 6e0e35b..c48ea70 100644 --- a/elliptic-curve/src/public_key.rs +++ b/elliptic-curve/src/public_key.rs @@ -20,7 +20,7 @@ use generic_array::ArrayLength; /// /// These are a thin wrapper around [`AffinePoint`] which simplifies /// e...
1
10
1
ea5106e0cd0f47a5ee11af0d7313f1f1dc0a5a9f
Tony Arcieri
2020-12-03T02:06:04
elliptic-curve: simplify PublicKey trait bounds (#378) Decouples PublicKey from SEC1 encoding-related concerns, which allows the trait bounds for anything which interacts with PublicKeys to be dramatically simplified.
diff --git a/elliptic-curve/src/ecdh.rs b/elliptic-curve/src/ecdh.rs index bf83d99..252d9cd 100644 --- a/elliptic-curve/src/ecdh.rs +++ b/elliptic-curve/src/ecdh.rs @@ -24,9 +24,7 @@ use crate::{ consts::U1, public_key::PublicKey, scalar::NonZeroScalar, - sec1::{ - EncodedPoint, FromEncodedPoin...
3
25
59
71f6f53f0ac67ac6ba9dfb46aff7eb20df28bafe
Tony Arcieri
2020-12-03T01:20:31
elliptic-curve: impl `Copy`, `Eq`, and `PartialEq` for `PublicKey` (#377)
diff --git a/elliptic-curve/src/public_key.rs b/elliptic-curve/src/public_key.rs index 74ad8bc..609ed65 100644 --- a/elliptic-curve/src/public_key.rs +++ b/elliptic-curve/src/public_key.rs @@ -185,3 +185,44 @@ where self.point.to_encoded_point(compress) } } + +impl<C> Copy for PublicKey<C> +where + C:...
1
41
0
77eb39745ac3520f10c8a78e5e69762a06626910
Tony Arcieri
2020-12-03T00:57:12
elliptic-curve: rename PublicKey::from_sec1_bytes (#376) This has better symmetry with SecretKey::from_bytes, and also leaves room to add additional public key encodings (e.g. SubjectPublicKeyInfo)
diff --git a/elliptic-curve/src/public_key.rs b/elliptic-curve/src/public_key.rs index 8ba8841..74ad8bc 100644 --- a/elliptic-curve/src/public_key.rs +++ b/elliptic-curve/src/public_key.rs @@ -44,18 +44,23 @@ where UntaggedPointSize<C>: Add<U1> + ArrayLength<u8>, UncompressedPointSize<C>: ArrayLength<u8>, { ...
1
12
7
ff1371791a77b8163bcf37fcfcaf6ceb595b133c
Tony Arcieri
2020-12-03T00:30:49
elliptic-curve: add SecretKey::secret_value method (#375) Method for exposing the inner (generic) secret value for a SecretKey
diff --git a/elliptic-curve/src/secret_key.rs b/elliptic-curve/src/secret_key.rs index 6c340e2..e05e4d2 100644 --- a/elliptic-curve/src/secret_key.rs +++ b/elliptic-curve/src/secret_key.rs @@ -120,6 +120,17 @@ where self.secret_value.clone().into() } + /// Borrow the inner generic secret value. + ...
1
11
0
ef18c99722c93a68e7386e2efc9c32c4ed41bed4
Tony Arcieri
2020-12-02T23:55:04
elliptic-curve: remove Deref impl from PublicKey; add ::as_affine() (#374) Types with `Deref` impls shouldn't have inherent methods, however `PublicKey` has several. This makes `PublicKey` more than a "smart pointer" type which `Deref` is intended to be used with: it handles encoding and conversions in a way tha...
diff --git a/elliptic-curve/src/public_key.rs b/elliptic-curve/src/public_key.rs index 82a1a87..8ba8841 100644 --- a/elliptic-curve/src/public_key.rs +++ b/elliptic-curve/src/public_key.rs @@ -11,7 +11,7 @@ use crate::{ use core::{ convert::{TryFrom, TryInto}, fmt::Debug, - ops::{Add, Deref}, + ops::Ad...
2
10
20
c85bc2d9543c30c14dc56c7db4efb88add88405e
Tony Arcieri
2020-11-28T03:48:43
cipher: consolidate error types (#373) Consolidates the `block` and `stream` error types into a single toplevel `errors` module, consolidating `InvalidKeyLength` and `InvalidKeyNonceLength` into a single `InvalidLength` type.
diff --git a/cipher/src/block.rs b/cipher/src/block.rs index b0814f9..16205ba 100644 --- a/cipher/src/block.rs +++ b/cipher/src/block.rs @@ -13,10 +13,7 @@ #[cfg_attr(docsrs, doc(cfg(feature = "dev")))] pub mod dev; -mod errors; - -pub use errors::InvalidKeyLength; - +use crate::errors::InvalidLength; use core::co...
5
18
33
894409b94dec80a529be02f5683c16b29117cd83
Tony Arcieri
2020-11-24T15:40:16
cipher: fix `cipher::block` test macros (#372) Have them import the new `BlockEncrypt` and `BlockDecrypt` traits.
diff --git a/cipher/src/block/dev.rs b/cipher/src/block/dev.rs index 62c884a..8c4f2fd 100644 --- a/cipher/src/block/dev.rs +++ b/cipher/src/block/dev.rs @@ -9,7 +9,9 @@ macro_rules! block_cipher_test { ($name:ident, $test_name:expr, $cipher:ty) => { #[test] fn $name() { - use cipher::b...
1
4
2
d1c59a4cd0a4354213dc91635cf674c8018bd403
Tony Arcieri
2020-11-24T14:34:21
cipher: delete legacy macros / re-exports (#371) These were previously retained to avoid breaking backwards compatibility.
diff --git a/cipher/src/block.rs b/cipher/src/block.rs index 2126424..b0814f9 100644 --- a/cipher/src/block.rs +++ b/cipher/src/block.rs @@ -17,9 +17,6 @@ mod errors; pub use errors::InvalidKeyLength; -// TODO(tarcieri): remove these re-exports in favor of the toplevel one -pub use generic_array::{self, typenum::c...
4
0
77
590f5451a342b24c78379c731a0766a377ea4728
Tony Arcieri
2020-11-24T14:28:04
cipher: add encrypt/decrypt-only block cipher traits (#352) Splits `BlockCipher` into `BlockEncrypt` and `BlockDecrypt` traits which can be used in cases where e.g. only the encryption portion of a block cipher is used, as in CTR mode.
diff --git a/Cargo.lock b/Cargo.lock index 76778c8..dd3e6aa 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -85,7 +85,7 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "cipher" -version = "0.2.5" +version = "0.3.0-pre" dependencies = [ "blobby 0.3.0", "generic-ar...
7
49
95
6baa6a221a2ff30f9054f8b176283906eea531f1
Tony Arcieri
2020-11-03T21:54:25
elliptic-curve: remove `subtle` usage on sec1::EncodedPoint (#367) From a practical perspective, `sec1::EncodedPoint` is always used with public values. The previous use of `CtOption` was almost exclusively for error handling, and in every case immediately wrapped in an `Option` or `Result` to avoid end users de...
diff --git a/elliptic-curve/src/public_key.rs b/elliptic-curve/src/public_key.rs index 28b6a6b..82a1a87 100644 --- a/elliptic-curve/src/public_key.rs +++ b/elliptic-curve/src/public_key.rs @@ -9,13 +9,12 @@ use crate::{ AffinePoint, Error, FieldBytes, ProjectiveArithmetic, ProjectivePoint, Scalar, }; use core::{...
2
29
38
78f260ee1d844083094172b0d50c9609ac4002a4
Tony Arcieri
2020-11-03T21:35:42
elliptic-curve: extract toplevel PublicKey; add functionality (#366) This PR refactors the `ecdh::PublicKey` type introduced in #363 into a toplevel `public_key::PublicKey` type which is generally useful anywhere a public key is required. It additionally adds a number of additional impls including `AsRef`, `Dere...
diff --git a/elliptic-curve/src/ecdh.rs b/elliptic-curve/src/ecdh.rs index 0247a86..bf83d99 100644 --- a/elliptic-curve/src/ecdh.rs +++ b/elliptic-curve/src/ecdh.rs @@ -22,86 +22,21 @@ use crate::{ consts::U1, - generic_array::ArrayLength, + public_key::PublicKey, scalar::NonZeroScalar, sec1::{ ...
4
238
83
f1123a7165c1af258c15a0d5b63533dc6bb24d40
Michael Rosenberg
2020-11-03T19:19:56
Made PublicKey a newtype that does point validation upon deserialization (#363)
diff --git a/elliptic-curve/src/ecdh.rs b/elliptic-curve/src/ecdh.rs index fbac645..0247a86 100644 --- a/elliptic-curve/src/ecdh.rs +++ b/elliptic-curve/src/ecdh.rs @@ -24,11 +24,16 @@ use crate::{ consts::U1, generic_array::ArrayLength, scalar::NonZeroScalar, - sec1::{self, FromEncodedPoint, Uncompre...
1
93
21
5f1b3985b914e3d41b649555cfc089668e655985
Tony Arcieri
2020-11-03T18:39:06
elliptic-curve: fix `ecdh` rustdoc (#364) It was using the wrong quote (normal apostrophe instead of backtick).
diff --git a/elliptic-curve/src/ecdh.rs b/elliptic-curve/src/ecdh.rs index 5fd3c87..fbac645 100644 --- a/elliptic-curve/src/ecdh.rs +++ b/elliptic-curve/src/ecdh.rs @@ -7,7 +7,7 @@ //! # Usage //! //! Have each participant generate an [`EphemeralSecret`] value, compute the -//! [`PublicKey'] for that value, exchange...
1
1
1
6c4b6f95da65ef431fcc57858607705fbfd2a09b
Tony Arcieri
2020-11-01T22:16:18
cipher: fix nested macro usage (#360) The new macro names were still invoking the old deprecated ones
diff --git a/cipher/src/stream/dev.rs b/cipher/src/stream/dev.rs index 63c6e76..5e7f3be 100644 --- a/cipher/src/stream/dev.rs +++ b/cipher/src/stream/dev.rs @@ -181,11 +181,11 @@ macro_rules! stream_cipher_sync_bench { vec![77; n] } - $crate::bench_sync!(bench1_10, $cipher, 10); - ...
1
10
10
e7c5b472a4f81171500597b0d93522643e2d87eb
Tony Arcieri
2020-11-01T21:49:49
cipher: fix macro expansion error (#358)
diff --git a/cipher/src/block/dev.rs b/cipher/src/block/dev.rs index 08ed864..b518965 100644 --- a/cipher/src/block/dev.rs +++ b/cipher/src/block/dev.rs @@ -149,7 +149,7 @@ macro_rules! block_cipher_bench { #[deprecated(since = "0.2.2", note = "use `block_cipher_test!` instead")] macro_rules! new_test { ($name:i...
2
7
7
c697a3d67e33b195e2e6e01ea8fb99056b962a56
Tony Arcieri
2020-11-01T21:32:04
cipher: fix legacy macro wrappers (#356) They weren't using `$crate::*`, and therefore the resulting code doesn't compile.
diff --git a/cipher/src/block/dev.rs b/cipher/src/block/dev.rs index d59c589..08ed864 100644 --- a/cipher/src/block/dev.rs +++ b/cipher/src/block/dev.rs @@ -149,7 +149,7 @@ macro_rules! block_cipher_bench { #[deprecated(since = "0.2.2", note = "use `block_cipher_test!` instead")] macro_rules! new_test { ($name:i...
2
7
7
a2c62c52bb8e0606a8dcc1746c91cd23a3f4ff65
Tony Arcieri
2020-11-01T15:47:10
cipher: add BlockCipher::{encrypt_slice, decrypt_slice} (#351) Partially addresses #332. Adds methods which work over an arbitrarily sized slice of blocks to encrypt/decrypt. Provides a default implementation, but can be potentially further optimized by individual implementations.
diff --git a/cipher/src/block.rs b/cipher/src/block.rs index 7289561..551e9d1 100644 --- a/cipher/src/block.rs +++ b/cipher/src/block.rs @@ -20,6 +20,7 @@ pub use errors::InvalidKeyLength; // TODO(tarcieri): remove these re-exports in favor of the toplevel one pub use generic_array::{self, typenum::consts}; +use co...
1
41
0
742e555bad4198fd30b987d6a85f160e0c85bceb
Tony Arcieri
2020-10-16T13:23:56
cipher: fix dev macro imports (#345) They were previously referring to the old `block_cipher` and `stream_cipher` names.
diff --git a/cipher/src/block/dev.rs b/cipher/src/block/dev.rs index 11c570c..4ab57d7 100644 --- a/cipher/src/block/dev.rs +++ b/cipher/src/block/dev.rs @@ -9,10 +9,8 @@ macro_rules! new_test { ($name:ident, $test_name:expr, $cipher:ty) => { #[test] fn $name() { - use block_cipher::dev...
2
13
17
7410ecdbb6126014357e0b87a40daaf3d7bf2828
Tony Arcieri
2020-10-16T12:55:14
cipher: re-export `generic_array` from toplevel (#343) ...along with `typenum::consts` Failure to do this was an oversight: it doesn't really make sense to re-export these twice from both the `block` and `stream` modules. That said, `cipher` v0.2 is already shipped, and it does ease a sed-based migration to ke...
diff --git a/cipher/src/block.rs b/cipher/src/block.rs index 8cf1fb1..7289561 100644 --- a/cipher/src/block.rs +++ b/cipher/src/block.rs @@ -16,6 +16,8 @@ pub mod dev; mod errors; pub use errors::InvalidKeyLength; + +// TODO(tarcieri): remove these re-exports in favor of the toplevel one pub use generic_array::{se...
3
5
0
676c267579cc32adbdd120ab86f28b640e98bba2
Tony Arcieri
2020-10-15T20:24:54
cryptography: fix version
diff --git a/Cargo.lock b/Cargo.lock index 3ba1537..0d1000f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -115,7 +115,7 @@ dependencies = [ [[package]] name = "cryptography" -version = "0.5.0-pre" +version = "0.5.0" dependencies = [ "aead", "cipher", diff --git a/cryptography/Cargo.toml b/cryptography/Cargo.toml...
2
2
2
cdd3492381661b5d3592f98e3e2b936eec09ba00
Tony Arcieri
2020-10-14T17:39:47
stream-cipher: add FromBlockCipherMut trait (#334) Support for initializing a stream cipher from a `BlockCipherMut`. This is a corollary to `FromBlockCipher`, but for cases where `mut` access is needed to the inner block cipher instance (e.g. cryptographic accelerator hardware peripherals). Using chained blank...
diff --git a/stream-cipher/src/lib.rs b/stream-cipher/src/lib.rs index a6bc429..0471d57 100644 --- a/stream-cipher/src/lib.rs +++ b/stream-cipher/src/lib.rs @@ -35,7 +35,7 @@ use generic_array::typenum::Unsigned; use generic_array::{ArrayLength, GenericArray}; #[cfg(feature = "block-cipher")] -use block_cipher::{Bl...
1
39
7
6c23a077d31a13c88ecfd73e816e18d17dc10478
Tony Arcieri
2020-10-14T15:17:48
stream-cipher: remove NewBlockCipher bound on FromBlockCipher (#333) Note: breaking change. As far as I can tell this was an oversight: `FromBlockCipher` never needs to instantiate a new block cipher (isn't that the point?), making this bound needlessly limiting. The rationale for it in the first place appears...
diff --git a/Cargo.lock b/Cargo.lock index 04b13ab..aa76a1c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -124,7 +124,7 @@ dependencies = [ [[package]] name = "cryptography" -version = "0.4.1" +version = "0.5.0-pre" dependencies = [ "aead", "block-cipher 0.8.0", @@ -349,7 +349,7 @@ checksum = "a8f112729512f8e442...
4
7
6
88cec74d1a80266fc94743b736d35c3809a1def1
Tony Arcieri
2020-10-08T21:49:02
elliptic-curve: derive `Clone` on `SecretBytes` (#330)
diff --git a/elliptic-curve/src/secret_key.rs b/elliptic-curve/src/secret_key.rs index 137c9ee..118f1d8 100644 --- a/elliptic-curve/src/secret_key.rs +++ b/elliptic-curve/src/secret_key.rs @@ -168,6 +168,7 @@ where /// Newtype wrapper for [`FieldBytes`] which impls [`Zeroize`]. /// /// This allows it to fulfill the ...
1
1
0
d77bef50155bd084d6e05167eba5dc5743693a77
Tony Arcieri
2020-10-08T20:51:40
elliptic-curve: work around nightly-2020-10-06 breakage (#328) The `elliptic-curve` crate no longer builds on `nightly`. Possible cause: https://github.com/rust-lang/rust/issues/77638 Unfortunately this means rustdoc builds on https://docs.rs fail! This commit works around the issue.
diff --git a/elliptic-curve/src/ecdh.rs b/elliptic-curve/src/ecdh.rs index 48e4d6a..5fd3c87 100644 --- a/elliptic-curve/src/ecdh.rs +++ b/elliptic-curve/src/ecdh.rs @@ -73,7 +73,8 @@ where /// /// The `compress` flag enables point compression. pub fn public_key(&self) -> PublicKey<C> { - (C::Proje...
1
2
1
36181bc02adda7882233c69c3a139e0629af2b31
Tony Arcieri
2020-10-08T18:25:12
elliptic-curve: impl From<SecretBytes> for FieldBytes (#326) This is needed to fulfill the trait bounds for `SecretValue`
diff --git a/elliptic-curve/src/secret_key.rs b/elliptic-curve/src/secret_key.rs index 139d75b..137c9ee 100644 --- a/elliptic-curve/src/secret_key.rs +++ b/elliptic-curve/src/secret_key.rs @@ -26,7 +26,22 @@ use rand_core::{CryptoRng, RngCore}; /// Inner value stored by a [`SecretKey`]. pub trait SecretValue: Curve...
1
22
1
b64d6d25143ab38b25dec384ee455ce8b7b872a7
Tony Arcieri
2020-10-08T17:37:43
elliptic-curve: add SecretBytes newtype (#324) The `SecretValue` trait was supposed to allow curve crates with an `arithmetic` feature to use a `NonZeroScalar` as their secret value, and crates which don't to use `FieldBytes`. Unfortunately `zeroize` has no `generic-array` integration, and therefore `GenericArra...
diff --git a/elliptic-curve/src/secret_key.rs b/elliptic-curve/src/secret_key.rs index 1265b8a..139d75b 100644 --- a/elliptic-curve/src/secret_key.rs +++ b/elliptic-curve/src/secret_key.rs @@ -11,6 +11,7 @@ use crate::{error::Error, Curve, FieldBytes}; use core::{ convert::{TryFrom, TryInto}, fmt::{self, Deb...
1
32
0
3ef2f364f26827851e33308699b25d45253cc9f3
Tony Arcieri
2020-09-25T16:13:08
cryptography: bump `signature` dependency to 1.2.0 (#314)
diff --git a/cryptography/Cargo.toml b/cryptography/Cargo.toml index 0f4453e..dd1b704 100644 --- a/cryptography/Cargo.toml +++ b/cryptography/Cargo.toml @@ -17,7 +17,7 @@ block-cipher = { version = "0.8", optional = true, path = "../block-cipher" } digest = { version = "0.9", optional = true, path = "../digest" } ell...
1
1
1
871d50cbf02bb6adac6bb611d1797f88153a5031
Tony Arcieri
2020-09-24T23:51:01
elliptic-curve: add `sec1::EncodedPoint::to_untagged_bytes()` (#312) Adds a method for returning a `GenericArray` of the encoded point without a leading tag byte.
diff --git a/elliptic-curve/src/sec1.rs b/elliptic-curve/src/sec1.rs index db09dc2..05cec83 100644 --- a/elliptic-curve/src/sec1.rs +++ b/elliptic-curve/src/sec1.rs @@ -161,6 +161,25 @@ where self.as_bytes().to_vec().into_boxed_slice() } + /// Serialize point as raw uncompressed coordinates without t...
1
19
0
797b7d900e457139e01f4a35e5d1ad76eb96e815
Tony Arcieri
2020-09-21T16:02:30
elliptic-curve: fix `sec1::EncodedPoint::decompress` (#309) This method was previously expecting `Decompress` and `ToEncodedPoint` impls on `Scalar`, rather than `AffinePoint`. This updates it to use the correct types.
diff --git a/elliptic-curve/src/sec1.rs b/elliptic-curve/src/sec1.rs index af6b8a5..db09dc2 100644 --- a/elliptic-curve/src/sec1.rs +++ b/elliptic-curve/src/sec1.rs @@ -21,14 +21,14 @@ use alloc::boxed::Box; #[cfg(feature = "arithmetic")] use crate::{ - ff::PrimeField, subtle::Choice, weierstrass::point::Decompr...
1
8
7
1b77dd02368adddcf2fbdbf2672f30e5c1c4dec0
Tony Arcieri
2020-09-21T14:25:10
Revert "build(deps): bump bitvec from 0.18.3 to 0.19.0 (#301)" (#308) This reverts commit b541170e97553891833a4359ea1c27576e0a2b4d. This needs to be upgraded in coordination with the `ff` and `group` crates, so this reverts it back to what the current releases of those crates are presently using.
diff --git a/Cargo.lock b/Cargo.lock index 6c88ce7..8c53fe2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -31,17 +31,6 @@ dependencies = [ "wyz", ] -[[package]] -name = "bitvec" -version = "0.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36d8f44cf786f61f341ff3d14c600c4732664232...
2
3
14
aefa66783a2b96e5d0039adc0e457a20e6462469
Tony Arcieri
2020-09-11T22:49:25
elliptic-curve: minor SecretKey doc fix (#303)
diff --git a/elliptic-curve/src/secret_key.rs b/elliptic-curve/src/secret_key.rs index 5f18959..1265b8a 100644 --- a/elliptic-curve/src/secret_key.rs +++ b/elliptic-curve/src/secret_key.rs @@ -49,7 +49,7 @@ where /// Elliptic curve secret keys. /// -/// This type wraps a serialized scalar value, helping to prevent ...
1
1
1
bba389743c8156036ccd4bbb73755d8bb22fb796
Tony Arcieri
2020-09-11T14:58:57
elliptic-curve: refactor ProjectiveArithmetic trait (#300) Renames the `Arithmetic` trait to `ProjectiveArithmetic` and changes it to have only a single associated type: `ProjectivePoint`. Adds `AffinePoint<C>` and `Scalar<C>` type aliases which are able to look up the corresponding associated type chain (along w...
diff --git a/elliptic-curve/src/ecdh.rs b/elliptic-curve/src/ecdh.rs index b669292..48e4d6a 100644 --- a/elliptic-curve/src/ecdh.rs +++ b/elliptic-curve/src/ecdh.rs @@ -1,7 +1,7 @@ //! Elliptic Curve Diffie-Hellman (Ephemeral) Support. //! //! This module contains a generic ECDH implementation which is usable with -...
7
214
154
a9bd70b727bf4cf069fa3dda5661ed5e1b8286fa
Tony Arcieri
2020-09-10T04:09:43
elliptic-curve: rename and simplify FromFieldBytes (#298)
diff --git a/elliptic-curve/src/lib.rs b/elliptic-curve/src/lib.rs index fdbeaff..89b6a12 100644 --- a/elliptic-curve/src/lib.rs +++ b/elliptic-curve/src/lib.rs @@ -106,7 +106,7 @@ pub trait Arithmetic: Curve { type Scalar: ff::PrimeField + ConstantTimeEq + Default - + FromBytes<Size = Sel...
4
21
24
24ce4e1bda977a7f41af203eb3cbd3fa0e906b93
Tony Arcieri
2020-09-09T16:29:53
elliptic-curve: rename ElementBytes => FieldBytes (#296) Makes it clearer this refers to a field element.
diff --git a/elliptic-curve/src/ecdh.rs b/elliptic-curve/src/ecdh.rs index 64b2932..b669292 100644 --- a/elliptic-curve/src/ecdh.rs +++ b/elliptic-curve/src/ecdh.rs @@ -27,7 +27,7 @@ use crate::{ scalar::NonZeroScalar, sec1::{self, FromEncodedPoint, UncompressedPointSize, UntaggedPointSize}, weierstrass:...
6
23
27
a866a23ab066bc89d000f0931dec9f915d6a8986
Tony Arcieri
2020-09-09T15:14:51
elliptic-curve: remove `Generate` trait (#295) The functionality it previously provided as a trait is now available via methods like `Field::random` and `Group::random`. The other places where it was being used have been converted to inherent methods on concrete types, which is easier to use because there's no n...
diff --git a/elliptic-curve/src/ecdh.rs b/elliptic-curve/src/ecdh.rs index 75ea4ba..64b2932 100644 --- a/elliptic-curve/src/ecdh.rs +++ b/elliptic-curve/src/ecdh.rs @@ -27,7 +27,7 @@ use crate::{ scalar::NonZeroScalar, sec1::{self, FromEncodedPoint, UncompressedPointSize, UntaggedPointSize}, weierstrass:...
5
48
54
548e11779ea85d411daa39214afcd7cc6c72c2b8
Tony Arcieri
2020-09-09T04:15:30
elliptic-curve: rename FieldBits to ScalarBits (#294) This is a property of the scalar field specifically and importantly retains properties of the internal representation.
diff --git a/elliptic-curve/src/lib.rs b/elliptic-curve/src/lib.rs index 420e6c9..2de20f4 100644 --- a/elliptic-curve/src/lib.rs +++ b/elliptic-curve/src/lib.rs @@ -69,18 +69,11 @@ use generic_array::{typenum::Unsigned, ArrayLength, GenericArray}; use rand_core::{CryptoRng, RngCore}; use subtle::{ConditionallySelecta...
2
4
7
0edd4917507811f4f89e07ba282edc11c1b9699b
Tony Arcieri
2020-09-09T00:25:02
elliptic-curve: fix formatting
diff --git a/elliptic-curve/src/lib.rs b/elliptic-curve/src/lib.rs index aa874d4..e1849dd 100644 --- a/elliptic-curve/src/lib.rs +++ b/elliptic-curve/src/lib.rs @@ -82,7 +82,7 @@ pub trait Curve: Clone + Debug + Default + Eq + Ord + Send + Sync { type FieldSize: ArrayLength<u8> + Add + Eq + Ord + Unsigned; } -/...
1
2
2
10505b957056995c15ebbc1acaa3a6da97af59c4
Tony Arcieri
2020-09-09T00:22:13
elliptic-curve: reorder Arithmetic associated types
diff --git a/elliptic-curve/src/lib.rs b/elliptic-curve/src/lib.rs index 2bd5c04..aa874d4 100644 --- a/elliptic-curve/src/lib.rs +++ b/elliptic-curve/src/lib.rs @@ -84,21 +84,21 @@ pub trait Curve: Clone + Debug + Default + Eq + Ord + Send + Sync { /// Elliptic curve with curve arithmetic support pub trait Arithmet...
1
6
6
c83f980eaa82277e522cb656842b964efaad83c0
Tony Arcieri
2020-09-08T19:30:46
elliptic-curve: add `ff` and `group` bounds on Arithmetic trait (#291) Adds the following: - `Arithmetic::ProjectivePoint` associated type with `group::Curve` and `group::Group` bounds - `Arithmetic::Scalar` is now bounded by `ff::PrimeField`
diff --git a/elliptic-curve/src/lib.rs b/elliptic-curve/src/lib.rs index 1f49f12..3bcd5b9 100644 --- a/elliptic-curve/src/lib.rs +++ b/elliptic-curve/src/lib.rs @@ -84,13 +84,17 @@ pub trait Curve: Clone + Debug + Default + Eq + Ord + Send + Sync { /// Elliptic curve with curve arithmetic support pub trait Arithmet...
1
6
2
88d462bd5c94a1b1dbf3f2f5375fdfc406b35293
Tony Arcieri
2020-09-08T18:12:33
elliptic-curve: bump minimum subtle version to 2.3 (#290) This version has the following extremely useful impls: - `From<CtOption> for Option` - `ConstantTimeEq` for `Choice` There is a bunch of code in `RustCrypto/elliptic-curve` that can be cleaned up/simplified assuming these are available.
diff --git a/Cargo.lock b/Cargo.lock index 24ef4d7..fa376a9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -315,15 +315,15 @@ dependencies = [ [[package]] name = "subtle" -version = "2.2.3" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "502d53007c02d7605a05df1c1a73ee4...
2
5
5
ab2598b62c35d8e9350937b2f632c54b84cbcb01
Tony Arcieri
2020-09-03T14:22:48
elliptic-curve: add sec1::Coordinates (#286) Provides an enum-based "view" of a parsed SEC1-encoded elliptic curve point, including the compressed and uncompressed representations.
diff --git a/elliptic-curve/src/sec1.rs b/elliptic-curve/src/sec1.rs index 5445b08..3c58397 100644 --- a/elliptic-curve/src/sec1.rs +++ b/elliptic-curve/src/sec1.rs @@ -91,12 +91,16 @@ where /// tag byte (which would otherwise be `0x04` for an uncompressed point). pub fn from_untagged_bytes(bytes: &GenericArr...
1
103
37
3df75fcbb642248b6509cde13b8753e695b3f19c
Tony Arcieri
2020-09-02T19:16:24
elliptic-curve: ensure C::AffinePoint Mul<Output=Self::AffinePoint> (#284) Ensures that the output of a scalar multiplication with an affine point is also an affine point.
diff --git a/elliptic-curve/src/lib.rs b/elliptic-curve/src/lib.rs index ee518b2..16c8dff 100644 --- a/elliptic-curve/src/lib.rs +++ b/elliptic-curve/src/lib.rs @@ -100,7 +100,9 @@ pub trait Arithmetic: Curve { + Into<ElementBytes<Self>>; /// Affine point type for a given curve - type AffinePoint: Co...
1
3
1
b9f71bd73969649a34d46230900fd3f9ab6b1340
Tony Arcieri
2020-09-02T16:16:42
elliptic-curve: extract point::Compression trait (#283) Move point compression defaults onto their own trait
diff --git a/elliptic-curve/src/point.rs b/elliptic-curve/src/point.rs index 67a810a..5a0ae58 100644 --- a/elliptic-curve/src/point.rs +++ b/elliptic-curve/src/point.rs @@ -1,5 +1,11 @@ //! Traits for elliptic curve points +/// Point compression settings +pub trait Compression { + /// Should point compression be ...
3
8
7
a85525d61e1d882d12a4c00387655dded76fd0c2
Tony Arcieri
2020-09-02T15:24:19
Rename C::ElementSize => FieldSize (#282) This is hopefully a more apt description of this particular size.
diff --git a/elliptic-curve/src/lib.rs b/elliptic-curve/src/lib.rs index 9a1ee19..ee518b2 100644 --- a/elliptic-curve/src/lib.rs +++ b/elliptic-curve/src/lib.rs @@ -71,7 +71,7 @@ use subtle::{ConditionallySelectable, ConstantTimeEq, CtOption}; use rand_core::{CryptoRng, RngCore}; /// Byte array containing a seriali...
4
18
17
abff234bfe0ced9254615dc608ece09619a8db38
Tony Arcieri
2020-09-02T00:51:23
elliptic-curve: import arithmetic helper functions (#281) These are helper functions for performing arithmetic on field element "limbs", e.g. implementing carry chains. The particular versions in this file come from the `k256`, which started as a fork of the `p256` crate, and notably provide 32-bit and 64-bit ve...
diff --git a/elliptic-curve/src/lib.rs b/elliptic-curve/src/lib.rs index 6481496..9a1ee19 100644 --- a/elliptic-curve/src/lib.rs +++ b/elliptic-curve/src/lib.rs @@ -30,6 +30,7 @@ pub mod ops; pub mod point; pub mod scalar; pub mod secret_key; +pub mod util; #[cfg(feature = "ecdh")] #[cfg_attr(docsrs, doc(cfg(fea...
2
56
0
fc56c1b4f649f2126b0f42931d2a7d19cbcdbb0e
Tony Arcieri
2020-08-31T18:45:54
elliptic-curve: remove `digest` crate path directive (#280) This makes it incompatible with `signature` when fetched via git, which does not have such a declaration (and cannot, as it'd break the dev-dependency on `sha2`).
diff --git a/Cargo.lock b/Cargo.lock index ec8c6fc..87917de 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -128,7 +128,7 @@ name = "elliptic-curve" version = "0.5.0" dependencies = [ "const-oid", - "digest 0.9.0", + "digest 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "generic-array 0.14.4", "he...
2
2
2
bc66b11fb22566c3987319024a7eba2dfe37a420
Tony Arcieri
2020-08-31T18:20:04
elliptic-curve: add `digest` feature and FromDigest trait (#279) This is needed in a generic implementation of RFC 6979, but is also potentially useful for things like hash-to-curve.
diff --git a/Cargo.lock b/Cargo.lock index 78ae486..ec8c6fc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -128,6 +128,7 @@ name = "elliptic-curve" version = "0.5.0" dependencies = [ "const-oid", + "digest 0.9.0", "generic-array 0.14.4", "hex-literal", "rand_core", diff --git a/elliptic-curve/Cargo.toml b/ellipt...
3
18
0
7cf898c746bcee5ffcc9bd100a341d0d63f1c27b
Tony Arcieri
2020-08-31T16:43:49
elliptic-curve: impl Deref for NonZeroScalar (#278)
diff --git a/elliptic-curve/src/scalar.rs b/elliptic-curve/src/scalar.rs index 78946fe..18bb9f9 100644 --- a/elliptic-curve/src/scalar.rs +++ b/elliptic-curve/src/scalar.rs @@ -1,6 +1,7 @@ //! Scalar types use crate::{ops::Invert, Arithmetic, Curve, ElementBytes, FromBytes}; +use core::ops::Deref; use subtle::{Cho...
1
12
0
733146a74ec4d0913d4d624bca31fc8a962d5170
Tony Arcieri
2020-08-26T19:51:27
elliptic-curve: conditionally impl Invert for NonZeroScalar (#277) ...if the underlying scalar type it wraps also impls `Invert`
diff --git a/elliptic-curve/src/scalar.rs b/elliptic-curve/src/scalar.rs index 957d7bd..78946fe 100644 --- a/elliptic-curve/src/scalar.rs +++ b/elliptic-curve/src/scalar.rs @@ -1,6 +1,6 @@ //! Scalar types -use crate::{Arithmetic, Curve, ElementBytes, FromBytes}; +use crate::{ops::Invert, Arithmetic, Curve, ElementB...
1
14
1
05d2eaebbb0678616c195bd297e7f43e48049612
Tony Arcieri
2020-08-26T19:37:08
elliptic-curve: add NonZeroScalar::to_bytes (#276) ...and a `From` conversion to `ElementBytes<C>`
diff --git a/elliptic-curve/src/scalar.rs b/elliptic-curve/src/scalar.rs index f9cb569..957d7bd 100644 --- a/elliptic-curve/src/scalar.rs +++ b/elliptic-curve/src/scalar.rs @@ -36,6 +36,11 @@ where let is_zero = scalar.ct_eq(&zero); CtOption::new(Self { scalar }, !is_zero) } + + /// Serialize ...
1
15
1
a43036613f499df4c50d8cead4ccbc3a01aa2f24
Tony Arcieri
2020-08-26T18:50:03
elliptic-curve: add EncodedPoint::decompress (#275) Generic support for decompressing SEC1-encoded points
diff --git a/elliptic-curve/src/sec1.rs b/elliptic-curve/src/sec1.rs index 48e7128..a1e39fb 100644 --- a/elliptic-curve/src/sec1.rs +++ b/elliptic-curve/src/sec1.rs @@ -6,8 +6,10 @@ //! <https://www.secg.org/sec1-v2.pdf> use crate::{ - point::Generator, scalar::NonZeroScalar, weierstrass::Curve, Arithmetic, Elem...
1
33
17
b90b6155df7af202686b2e2765b8b77a23f27287
Tony Arcieri
2020-08-26T18:16:57
elliptic-curve: impl FromBytes on NonZeroScalar (#274) Provides a more direct path from serialized bytes to a NonZeroScalar.
diff --git a/elliptic-curve/src/ecdh.rs b/elliptic-curve/src/ecdh.rs index 3f98672..75ea4ba 100644 --- a/elliptic-curve/src/ecdh.rs +++ b/elliptic-curve/src/ecdh.rs @@ -61,16 +61,15 @@ where { /// Generate a new [`EphemeralSecret`]. pub fn generate(rng: impl CryptoRng + RngCore) -> Self { - Self { - ...
2
29
7
a0cfce36dad42df4e3ee565eecf8309ffda592f1
Tony Arcieri
2020-08-25T17:27:24
elliptic-curve: add back sec1::EncodedPoint::from_secret_key (#271) I'd eventually like to get rid of this method, replacing it with a proper public key (associated) type which supports a ToEncodedPoint conversion. That said, until we have that, keeping it around for now makes upgrading the existing RustCrypto/e...
diff --git a/elliptic-curve/src/sec1.rs b/elliptic-curve/src/sec1.rs index 4df0d9d..48e7128 100644 --- a/elliptic-curve/src/sec1.rs +++ b/elliptic-curve/src/sec1.rs @@ -5,11 +5,13 @@ //! //! <https://www.secg.org/sec1-v2.pdf> -use crate::ElementBytes; -use crate::{weierstrass::Curve, Error}; +use crate::{ + poin...
1
32
3
ce8887651eed81aa1b6d10d464a7c8f5cdcea0bb
Tony Arcieri
2020-08-25T16:46:50
elliptic-curve: expose SEC1 Tag and coordinates (#270) These are helpful when implementing SEC1 point decoding
diff --git a/elliptic-curve/src/sec1.rs b/elliptic-curve/src/sec1.rs index 79afe6a..4df0d9d 100644 --- a/elliptic-curve/src/sec1.rs +++ b/elliptic-curve/src/sec1.rs @@ -151,15 +151,21 @@ where T::from_encoded_point(self) } + /// Get the SEC1 tag for this [`EncodedPoint`] + pub fn tag(&self) -> Tag...
1
21
21
9a04033fa9a44c0dd1710af165d8c0add95fc303
Tony Arcieri
2020-08-25T16:40:30
elliptic-curve: make weierstrass::point::Decode constant time (#269) Replaces boolean flag for y-coordinate even/odd with subtle::Choice
diff --git a/elliptic-curve/src/weierstrass/point.rs b/elliptic-curve/src/weierstrass/point.rs index acb1700..67c3833 100644 --- a/elliptic-curve/src/weierstrass/point.rs +++ b/elliptic-curve/src/weierstrass/point.rs @@ -2,11 +2,11 @@ use super::Curve; use crate::ElementBytes; -use subtle::CtOption; +use subtle::{C...
1
2
2
acfc369c77259c70ebc72601cc83684847ae499d
Tony Arcieri
2020-08-23T16:37:42
elliptic-curve: add weierstrass::point::Decompress trait (#266) Adds a trait for decompressing Weierstrass points from a big endian encoded affine x-coordinate and a flag indicating whether or not the y-coordinate is odd.
diff --git a/elliptic-curve/src/weierstrass.rs b/elliptic-curve/src/weierstrass.rs index bb095ba..c87a54e 100644 --- a/elliptic-curve/src/weierstrass.rs +++ b/elliptic-curve/src/weierstrass.rs @@ -1,5 +1,7 @@ //! Elliptic curves in short Weierstrass form. +pub mod point; + /// Marker trait for elliptic curves in sh...
2
14
0
9a05f8e8fc6c5ac9c31f6baed053f74badd40a52
Tony Arcieri
2020-08-21T23:31:59
elliptic-curve: add `alloc` feature + EncodedPoint::to_bytes() (#265) Support serializing an `EncodedPoint` as a heap-allocated byte slice.
diff --git a/elliptic-curve/Cargo.toml b/elliptic-curve/Cargo.toml index 40f6645..8422122 100644 --- a/elliptic-curve/Cargo.toml +++ b/elliptic-curve/Cargo.toml @@ -26,10 +26,11 @@ hex-literal = "0.2" [features] default = ["rand"] +alloc = [] ecdh = ["rand", "weierstrass", "zeroize"] rand = ["rand_core"] weierst...
4
24
4
f3ab35e5e672152e1f21e43c65b8064923b9905a
Tony Arcieri
2020-08-21T16:55:24
elliptic-curve: refactor `PublicKey` into `sec1::EncodedPoint` (#264) elliptic-curve: refactor `PublicKey` into `sec1::EncodedPoint` Moves the type for SEC1 encoded points to `sec1::EncodedPoint`, which both much more precisely describes what it represents, but also moves it out-of-the-way so we can add a better ...
diff --git a/Cargo.lock b/Cargo.lock index 268eda7..f2928ef 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -129,6 +129,7 @@ version = "0.5.0" dependencies = [ "const-oid", "generic-array 0.14.4", + "hex-literal", "rand_core", "subtle", "zeroize", diff --git a/elliptic-curve/Cargo.toml b/elliptic-curve/Cargo.tom...
8
484
541
545b1269e57dbb110ec69c76386d39abfb86e781
Tony Arcieri
2020-08-10T23:01:55
cryptography: fix rustdoc for `elliptic_curve` re-export (#256) Previously used a hyphen instead of an underscore
diff --git a/cryptography/src/lib.rs b/cryptography/src/lib.rs index e02b506..ad17177 100644 --- a/cryptography/src/lib.rs +++ b/cryptography/src/lib.rs @@ -26,7 +26,7 @@ //! | [`aead`](https://docs.rs/aead) | `aead` | Authenticated Encryption with Associated Data (i.e. high-level symmetric encryption) | //! | [`bloc...
1
1
1
a0f0c0c286405449d977f336c208abcb715bc5af
Artyom Pavlov
2020-08-10T17:46:28
Use SVG logo (#253)
diff --git a/aead/src/lib.rs b/aead/src/lib.rs index 3f7ea4c..dc37133 100644 --- a/aead/src/lib.rs +++ b/aead/src/lib.rs @@ -16,7 +16,10 @@ #![no_std] #![cfg_attr(docsrs, feature(doc_cfg))] #![forbid(unsafe_code)] -#![doc(html_logo_url = "https://raw.githubusercontent.com/RustCrypto/meta/master/logo_small.png")] +#!...
9
32
9
5cf63df92be944bfbde8262f4931c45dadc88469
Tony Arcieri
2020-08-06T19:50:57
elliptic-curve: Elliptic Curve Diffie-Hellman support (#251) Adds an `ecdh` module gated under an `ecdh` Cargo feature containing a generic high-level interface for performing ephemeral Elliptic Curve Diffie-Hellman key exchanges. The API is inspired by the one in `x25519-dalek`.
diff --git a/elliptic-curve/Cargo.toml b/elliptic-curve/Cargo.toml index c6a4f8f..6f98bd9 100644 --- a/elliptic-curve/Cargo.toml +++ b/elliptic-curve/Cargo.toml @@ -23,7 +23,9 @@ subtle = { version = "2.2.2", default-features = false } zeroize = { version = "1", optional = true, default-features = false } [feature...
8
332
48
048fb8f85a9b4cbbb29a2302a9a3fc596526fdcf
Tony Arcieri
2020-08-05T02:14:05
elliptic-curve: add Into<ElementBytes> bound to Arithmetic::Scalar (#250) Supports generic scalar serialization
diff --git a/elliptic-curve/src/lib.rs b/elliptic-curve/src/lib.rs index f01babc..9664ee8 100644 --- a/elliptic-curve/src/lib.rs +++ b/elliptic-curve/src/lib.rs @@ -80,7 +80,8 @@ pub trait Arithmetic: Curve { type Scalar: ConditionallySelectable + ConstantTimeEq + Default - + FromBytes<Siz...
1
2
1
9bab4e821421e384096e86e92278ef20fb8f4621
Tony Arcieri
2020-08-04T23:46:02
elliptic-curve: remove ToBytes trait (#249) We're using Into bounds for this in places right now, which suffice for existing use cases, and makes a bit redundant.
diff --git a/elliptic-curve/src/encoding.rs b/elliptic-curve/src/encoding.rs deleted file mode 100644 index d4f39b4..0000000 --- a/elliptic-curve/src/encoding.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! Traits for decoding/encoding elliptic curve elements (i.e. base and scalar -//! field elements) as bytes. - -use generic_a...
3
20
37
1b3dffb7f194176a97730a72d493e5368ac69359
Tony Arcieri
2020-08-04T21:16:23
elliptic-curve: add back FromPublicKey trait (#248) It seems this was a bit too hastily removed in #247. It's worth keeping around for now as it handles the variable sizes of SEC-1 keys.
diff --git a/elliptic-curve/src/weierstrass/public_key.rs b/elliptic-curve/src/weierstrass/public_key.rs index ef2f514..d06f568 100644 --- a/elliptic-curve/src/weierstrass/public_key.rs +++ b/elliptic-curve/src/weierstrass/public_key.rs @@ -16,6 +16,7 @@ use generic_array::{ typenum::{Unsigned, U1}, ArrayLeng...
1
19
0
4554cdc4fbecd5ef6bdb46fdd7e2012474c596e0
Tony Arcieri
2020-08-04T20:55:24
elliptic-curve: add `encoding` module (#247) Replaces the previous `FromPublicKey` and `FromSecretKey` traits with a more general `FromBytes` and `ToBytes` traits. These match the function signatures presently used in the existing crates, and are useful in cases where e.g. a scalar doesn't necessarily represent ...
diff --git a/elliptic-curve/src/encoding.rs b/elliptic-curve/src/encoding.rs new file mode 100644 index 0000000..d4f39b4 --- /dev/null +++ b/elliptic-curve/src/encoding.rs @@ -0,0 +1,23 @@ +//! Traits for decoding/encoding elliptic curve elements (i.e. base and scalar +//! field elements) as bytes. + +use generic_array...
5
28
33
1dd4bc5ebc1f7c16e4a76fa6264b796579b4685e
Tony Arcieri
2020-08-04T19:56:44
elliptic-curve: rename `ScalarBytes` => `ElementBytes` (#246) This type alias is being used for things that aren't elements of the scalar field, like serialized affine coordinates. This commit renames it into something more general which applies to these cases. It's also more consistent with the `Curve::ElementSi...
diff --git a/elliptic-curve/src/lib.rs b/elliptic-curve/src/lib.rs index 8535f6e..f8ce3fe 100644 --- a/elliptic-curve/src/lib.rs +++ b/elliptic-curve/src/lib.rs @@ -102,4 +102,4 @@ pub trait Generate { } /// Byte array containing a serialized scalar value (i.e. an integer) -pub type ScalarBytes<C> = GenericArray<u8...
3
15
15
72f1909a39571b0fe57f2751c1393680f364ee32
Tony Arcieri
2020-08-04T16:19:34
elliptic-curve: use `const-oid` crate (#245) The previous implementation has been extracted into that crate.
diff --git a/Cargo.lock b/Cargo.lock index 4d86f3c..3660857 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -61,6 +61,12 @@ version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" +[[package]] +name = "const-oid" +...
4
20
68
83c41ca3a5e19a5d8d776ac7f74123de8373e2e8
Tony Arcieri
2020-08-04T03:40:53
elliptic-curve: derive Clone on SecretKey (#244) SecretKey is auto-zeroizing. While cloning it isn't ideal, we have a strategy for automatically cleaning up afterward.
diff --git a/elliptic-curve/src/secret_key.rs b/elliptic-curve/src/secret_key.rs index d431cf2..cb613d8 100644 --- a/elliptic-curve/src/secret_key.rs +++ b/elliptic-curve/src/secret_key.rs @@ -26,6 +26,7 @@ use { /// This type wraps a serialized scalar value, helping to prevent accidental /// exposure and securely er...
1
1
0
920522ae53f03483a27b24bc8e924db9e8aff29c
Tony Arcieri
2020-08-03T22:53:06
elliptic-curve: add weierstrass::PublicKey::compress (#243) Generic point compression support for SEC-1 encoded public keys
diff --git a/elliptic-curve/src/weierstrass/point.rs b/elliptic-curve/src/weierstrass/point.rs index 735ceb7..e0d6c30 100644 --- a/elliptic-curve/src/weierstrass/point.rs +++ b/elliptic-curve/src/weierstrass/point.rs @@ -171,6 +171,16 @@ where pub fn into_bytes(self) -> GenericArray<u8, UncompressedPointSize<C>> {...
2
19
0
efefde4b5088af69407f80c88ecb4d966b9016f7
Tony Arcieri
2020-08-02T18:03:05
elliptic-curve: NonZeroScalar + Generator (replaces MulBase) (#241) Adds a `NonZeroScalar` type generic over curves along with a `Generator` trait which together with the `Mul` trait from `core` can replace the `MulBase` trait. `NonZeroScalar` is able to use the bounds on `Arithmetic::Scalar` and therefore usabl...
diff --git a/elliptic-curve/src/lib.rs b/elliptic-curve/src/lib.rs index c5cf968..c829740 100644 --- a/elliptic-curve/src/lib.rs +++ b/elliptic-curve/src/lib.rs @@ -24,6 +24,8 @@ extern crate std; pub mod error; pub mod oid; pub mod ops; +pub mod point; +pub mod scalar; pub mod secret_key; // TODO(tarcieri): oth...
5
81
21
a65edce5d5ee2f5daec882d68fe00f860674f542
Tony Arcieri
2020-07-31T02:30:35
elliptic-curve: basic OID support (#240) Adds a (very simple, const-and-no_std-friendly) `ObjectIdentifier` type and an `Identifier` trait for attaching an OID to a curve. No validation of the nodes is presently performed (and since it's impl'd as a `const fn`, it'd require a MSRV bump to do so). Also requires th...
diff --git a/elliptic-curve/src/lib.rs b/elliptic-curve/src/lib.rs index 3528d22..c5cf968 100644 --- a/elliptic-curve/src/lib.rs +++ b/elliptic-curve/src/lib.rs @@ -22,6 +22,7 @@ extern crate std; pub mod error; +pub mod oid; pub mod ops; pub mod secret_key; @@ -30,7 +31,7 @@ pub mod secret_key; #[cfg_attr(doc...
2
56
1
2eb31349c6bef08f910a84caa8678f8aa12b13c5
Tony Arcieri
2020-07-31T00:44:31
elliptic-curve: change MulBase trait to be impl'd on point types (#239) This makes the MulBase trait a static method for point types, which takes an associated scalar type as an associated parameter. This allows multiple impls on both AffinePoint and ProjectivePoint.
diff --git a/elliptic-curve/src/lib.rs b/elliptic-curve/src/lib.rs index db4020a..3528d22 100644 --- a/elliptic-curve/src/lib.rs +++ b/elliptic-curve/src/lib.rs @@ -66,13 +66,10 @@ pub trait Curve: Clone + Debug + Default + Eq + Ord + Send + Sync { /// Elliptic curve with curve arithmetic support pub trait Arithmetic...
3
12
12
676f62e2002bd7035b3a6270da298690d7ae0e1e
Tony Arcieri
2020-07-29T19:46:19
signature: add RandomizedDigestSigner (#235) Combination of `DigestSigner` and `RandomizedSigner` which computes a signature over a message digest while incorporating additional entropy.
diff --git a/signature/src/signer.rs b/signature/src/signer.rs index 9ecde40..24054e0 100644 --- a/signature/src/signer.rs +++ b/signature/src/signer.rs @@ -80,3 +80,30 @@ pub trait RandomizedSigner<S: Signature> { /// with external signers, e.g. cloud KMS, HSMs, or other hardware tokens. fn try_sign_with_rng...
1
27
0
409550d3130c6747b87ce7ff9aba470e4b42bc66
Tony Arcieri
2020-07-29T18:43:27
elliptic-curve: re-export `zeroize` (#233) Useful for conditionally zeroizing long-lived secret `Scalar` values
diff --git a/elliptic-curve/src/lib.rs b/elliptic-curve/src/lib.rs index 31ee725..db4020a 100644 --- a/elliptic-curve/src/lib.rs +++ b/elliptic-curve/src/lib.rs @@ -37,6 +37,9 @@ pub use subtle; #[cfg(feature = "rand_core")] pub use rand_core; +#[cfg(feature = "zeroize")] +pub use zeroize; + use core::{fmt::Debug,...
1
3
0
0aea71b0211a99d6d6367445da3c3910957591c3
Tony Arcieri
2020-07-29T18:27:22
signature: remove RNG generic parameter from RandomizedSigner (#231) ...replacing it with `impl CryptoRng + RngCore` parameter. This is a SemVer breaking change, however per our policy around `*-preview` features, it will receive a minor version bump as these features are not part of the SemVer guarantees of this...
diff --git a/signature/src/signer.rs b/signature/src/signer.rs index a2fa588..9ecde40 100644 --- a/signature/src/signer.rs +++ b/signature/src/signer.rs @@ -66,13 +66,9 @@ where /// Sign the given message using the provided external randomness source. #[cfg(feature = "rand-preview")] #[cfg_attr(docsrs, doc(cfg(featu...
1
3
7
129205462a5f04d3e3b6f2e4592b5d7a0d6448f0
Tony Arcieri
2020-07-29T17:18:05
elliptic-curve: replace FixedBaseScalarMul with ops::MulBase (#230) `FixedBaseScalarMul` was a hack around the lack of an associated `Scalar` type on a curve and generic way of converting a `SecretKey` to a `Scalar`. We have both of those things, so this commit replaces it with an `ops::MulBase` trait intended t...
diff --git a/elliptic-curve/src/lib.rs b/elliptic-curve/src/lib.rs index dbb6292..31ee725 100644 --- a/elliptic-curve/src/lib.rs +++ b/elliptic-curve/src/lib.rs @@ -30,10 +30,7 @@ pub mod secret_key; #[cfg_attr(docsrs, doc(cfg(feature = "weierstrass")))] pub mod weierstrass; -pub use self::{ - error::Error, - ...
4
29
30
6616a7c639435b682936ef4e2d338860a4029aa8
Tony Arcieri
2020-07-29T16:44:18
elliptic-curve: add FromPublicKey/FromSecretKey traits (#229) These traits allow converting: - SecretKey => Scalar - PublicKey => AffinePoint ...in a curve-agnostic way.
diff --git a/elliptic-curve/src/lib.rs b/elliptic-curve/src/lib.rs index 141bff3..dbb6292 100644 --- a/elliptic-curve/src/lib.rs +++ b/elliptic-curve/src/lib.rs @@ -30,7 +30,10 @@ pub mod secret_key; #[cfg_attr(docsrs, doc(cfg(feature = "weierstrass")))] pub mod weierstrass; -pub use self::{error::Error, secret_key...
4
35
4
f8a916bbcff07aece243db24f17f663d4077baba
Tony Arcieri
2020-07-28T16:50:22
elliptic-curve: add `Invert` trait (#228) Add a trait for performing scalar/field inversions. The main motivation for this is to allow for things like `BlindedScalar` type which use random blinding for either efficiency reasons (to allow a vartime inversion) and/or as a side-channel defense.
diff --git a/elliptic-curve/src/lib.rs b/elliptic-curve/src/lib.rs index 9918f76..141bff3 100644 --- a/elliptic-curve/src/lib.rs +++ b/elliptic-curve/src/lib.rs @@ -22,6 +22,7 @@ extern crate std; pub mod error; +pub mod ops; pub mod secret_key; // TODO(tarcieri): other curve forms diff --git a/elliptic-curve/s...
2
13
0
23b27c07e84c078edb748d2157cf9328fe9659eb
Tony Arcieri
2020-07-28T01:35:24
elliptic-curve: simplify `FixedBaseScalarMul` trait (#227) Most of the previous bounds are now irrelevant, and it can now also leverage the `Arithmetic` trait for the `AffinePoint` definition.
diff --git a/elliptic-curve/src/weierstrass.rs b/elliptic-curve/src/weierstrass.rs index cc2d15f..362ea17 100644 --- a/elliptic-curve/src/weierstrass.rs +++ b/elliptic-curve/src/weierstrass.rs @@ -8,28 +8,16 @@ pub use self::{ public_key::PublicKey, }; -use crate::{consts::U1, ScalarBytes}; -use core::ops::Add;...
2
9
21
513eb076c77f9272289272bd4abbc017f190af84
Tony Arcieri
2020-07-28T00:02:55
elliptic-curve: impl Generate for SecretKey (#226) This method fits the existing `Generate` trait. This allows bounds to simply specify `where SecretKey<C>: Generate` to write code that needs to handle generic generation of secret keys, as opposed to trying to encode the full bounds for the impl.
diff --git a/elliptic-curve/src/secret_key.rs b/elliptic-curve/src/secret_key.rs index 81c3ffe..31de82f 100644 --- a/elliptic-curve/src/secret_key.rs +++ b/elliptic-curve/src/secret_key.rs @@ -69,13 +69,13 @@ impl<C: Curve> Debug for SecretKey<C> { #[cfg(feature = "rand_core")] #[cfg_attr(docsrs, doc(cfg(feature = ...
1
2
2
7f56eb0dd570bbaf0fc411a061694e0860329e29
Tony Arcieri
2020-07-27T23:33:52
elliptic-curve: fix warnings (#225) Fixes some unused import warnings overlooked in #224
diff --git a/elliptic-curve/src/weierstrass.rs b/elliptic-curve/src/weierstrass.rs index c6fc7b5..cc2d15f 100644 --- a/elliptic-curve/src/weierstrass.rs +++ b/elliptic-curve/src/weierstrass.rs @@ -13,12 +13,6 @@ use core::ops::Add; use generic_array::ArrayLength; use subtle::{ConditionallySelectable, CtOption}; -#[...
1
0
6
c9a57b57b28ed659e5f7c56406a7ecf0674a4e49
Tony Arcieri
2020-07-27T23:26:10
elliptic-curve: add conditional `SecretKey::generate` method (#224) Replaces the `GenerateSecretKey` trait with a conditionally implemented `SecretKey::generate` method, which leverages the new `Curve`, `Arithmetic`, and `Generate` traits.
diff --git a/elliptic-curve/src/secret_key.rs b/elliptic-curve/src/secret_key.rs index ef6db52..81c3ffe 100644 --- a/elliptic-curve/src/secret_key.rs +++ b/elliptic-curve/src/secret_key.rs @@ -14,6 +14,12 @@ use core::{ }; use generic_array::{typenum::Unsigned, GenericArray}; +#[cfg(feature = "rand_core")] +use { +...
2
21
9