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 |
|---|---|---|---|---|---|---|---|
aee72b8b92101091a84a0ef375fabd5729c91868 | Alan Evans | 2021-07-02T12:37:35 | Allow line and block comments. (#512) | diff --git a/hex-literal/src/comments.rs b/hex-literal/src/comments.rs
new file mode 100644
index 0000000..02dd699
--- /dev/null
+++ b/hex-literal/src/comments.rs
@@ -0,0 +1,272 @@
+//! Provides an Iterator<Item=u8> decorator that uses a finite state machine to exclude comments
+//! from a string in linear time and con... | 2 | 289 | 10 |
950e62c8a90daded392dbce68faddcff07efad9a | Tony Arcieri | 2021-06-27T01:16:10 | crypto-bigint: add `rand` feature (#508)
Adds initial support for random number generation, for both `UInt` and
`Limb`.
Also adds a `UInt::random_mod` function which generates a random number
within the range of a provided modulus using rejection sampling. | diff --git a/Cargo.lock b/Cargo.lock
index 7f12303..23be091 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -113,6 +113,7 @@ version = "0.2.1"
dependencies = [
"generic-array",
"hex-literal 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rand_core",
"subtle",
"zeroize",
]
diff --git a/crypto-bi... | 6 | 73 | 0 |
a93ddb637a7f109efb725972af954403691dcea6 | Tony Arcieri | 2021-06-23T16:20:00 | crypto-bigint: make `Limb`'s `Inner` value public (#507)
This is mostly needed for `const fn` use as we can't use traits | diff --git a/crypto-bigint/src/limb.rs b/crypto-bigint/src/limb.rs
index dd88401..84636ad 100644
--- a/crypto-bigint/src/limb.rs
+++ b/crypto-bigint/src/limb.rs
@@ -42,7 +42,7 @@ pub(crate) type Wide = u128;
/// called "limbs".
#[derive(Copy, Clone, Debug, Default)]
#[repr(transparent)]
-pub struct Limb(pub(crate) I... | 1 | 1 | 1 |
ccfb5526e9fe8df56a076d4a22aa5d4b67040d5b | Tony Arcieri | 2021-06-22T16:37:58 | crypto-bigint: add `UInt::new` (#506) | diff --git a/crypto-bigint/src/uint.rs b/crypto-bigint/src/uint.rs
index ae8592e..3597ac8 100644
--- a/crypto-bigint/src/uint.rs
+++ b/crypto-bigint/src/uint.rs
@@ -44,6 +44,11 @@ impl<const LIMBS: usize> UInt<LIMBS> {
limbs: [Limb::MAX; LIMBS],
};
+ /// Const-friendly [`UInt`] constructor.
+ pub ... | 1 | 5 | 0 |
e9556883b8472c2e9e9134406922da4957cc586d | Tony Arcieri | 2021-06-22T16:34:28 | crypto-bigint: add `Limb::is_odd` and `UInt::is_odd` (#505)
Both return a `Choice` | diff --git a/crypto-bigint/src/limb/cmp.rs b/crypto-bigint/src/limb/cmp.rs
index 19d0563..5902c85 100644
--- a/crypto-bigint/src/limb/cmp.rs
+++ b/crypto-bigint/src/limb/cmp.rs
@@ -11,6 +11,12 @@ impl Limb {
self.ct_eq(&Self::ZERO)
}
+ /// Is this limb an odd number?
+ #[inline]
+ pub fn is_odd... | 3 | 118 | 23 |
bbc99fd7694c4bbc0b1816a12d8ce1843e6d494f | Tony Arcieri | 2021-06-22T16:06:23 | crypto-bigint: deprecate `LIMB_BYTES` constant (#504)
Now that we have a `Limb` newtype, we can use the associated constants
`Limb::BYTE_SIZE` and `Limb::BIT_SIZE` instead. | diff --git a/crypto-bigint/src/lib.rs b/crypto-bigint/src/lib.rs
index 66737f2..4a7b1c0 100644
--- a/crypto-bigint/src/lib.rs
+++ b/crypto-bigint/src/lib.rs
@@ -66,8 +66,10 @@ pub use {
/// Number of bytes in a [`Limb`].
#[cfg(target_pointer_width = "32")]
+#[deprecated(since = "0.2.2", note = "use `Limb::BYTE_SIZE... | 6 | 40 | 31 |
d92f3da65c53c2fa263cee9c4c436cafdf7c18da | Tony Arcieri | 2021-06-22T02:57:42 | cpufeatures: whitelist ARMv8 `crypto` feature on iOS (#501)
This commit encodes the assumption that every ARMv8 CPU ever produced by
Apple which is capable of running iOS supports the Cryptography
Extensions for AES, PMULL, and SHA2. | diff --git a/cpufeatures/src/aarch64.rs b/cpufeatures/src/aarch64.rs
index bc4e86e..86af2c9 100644
--- a/cpufeatures/src/aarch64.rs
+++ b/cpufeatures/src/aarch64.rs
@@ -163,6 +163,9 @@ macro_rules! check {
("aes") => {
true
};
+ ("crypto") => {
+ true
+ };
("sha2") => {
tru... | 1 | 3 | 0 |
6abedc851d83731902f353b7358e0a6f6fd070bd | Tony Arcieri | 2021-06-22T01:04:40 | crypto-bigint: add target-specific rustdocs (#500) | diff --git a/crypto-bigint/src/limb/from.rs b/crypto-bigint/src/limb/from.rs
index eae03b0..a655b14 100644
--- a/crypto-bigint/src/limb/from.rs
+++ b/crypto-bigint/src/limb/from.rs
@@ -1,29 +1,30 @@
-//! Limb from conversions
+//! `From`-like conversions for [`Limb`].
use super::{Inner, Limb, Wide};
impl Limb {
-... | 2 | 9 | 5 |
a52c85e6df669d8fce76a11aaef99b3aa0a31e01 | Tony Arcieri | 2021-06-15T15:50:11 | pkcs5+pkcs8: documentation improvements (#497)
- Fixes scrypt RFC number in `pkcs5` (was 8914, should be 7914)
- Notes `pkcs8` uses scrypt as the default PBKDF | diff --git a/pkcs5/src/pbes2/kdf.rs b/pkcs5/src/pbes2/kdf.rs
index 7679a13..c407a12 100644
--- a/pkcs5/src/pbes2/kdf.rs
+++ b/pkcs5/src/pbes2/kdf.rs
@@ -295,7 +295,7 @@ impl Encodable for Pbkdf2Prf {
}
}
-/// scrypt parameters as defined in [RFC 8914 Section 7.1].
+/// scrypt parameters as defined in [RFC 7914 ... | 2 | 6 | 4 |
dd17922cba2798f9a002850acf455cf2d6215483 | Tony Arcieri | 2021-06-07T23:49:46 | crypto-bigint: add/extract `Encoding` trait (#488)
Extracts byte encoding functionality into an `Encoding` trait that acts
on an associated `Encoding::Repr` type.
Breaking change, so it also bumps the version to v0.2.0-pre. | diff --git a/Cargo.lock b/Cargo.lock
index 3fa9ee6..901bc78 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -109,7 +109,7 @@ dependencies = [
[[package]]
name = "crypto-bigint"
-version = "0.1.0"
+version = "0.2.0-pre"
dependencies = [
"generic-array",
"hex-literal 0.3.1 (registry+https://github.com/rust-lang/crat... | 12 | 108 | 85 |
d7210c904a054c0b4b443d6c90e1429b54516a03 | Tony Arcieri | 2021-06-07T22:29:13 | der: have `Decoder::error()` return an `Error` (#487)
...instead of a `Result`.
The original goal was to avoid having to write `Err(...)` but the result
is a bit awkward and clumsy instead. | diff --git a/der/src/asn1/any.rs b/der/src/asn1/any.rs
index 0b90a58..33d9a2c 100644
--- a/der/src/asn1/any.rs
+++ b/der/src/asn1/any.rs
@@ -159,24 +159,24 @@ impl<'a> Decodable<'a> for Any<'a> {
let tag = header.tag;
let mut value = decoder
.bytes(header.length)
- .or_else(|_|... | 3 | 12 | 15 |
3fc828a86a31b2b5016dd64e4f3b38a858f9d070 | Tony Arcieri | 2021-06-07T17:16:27 | spki: add `AlgorithmIdentifier::assert_oids` (#486)
Adds a one-shot helper method for asserting that the algorithm and
parameters OIDs are an expected set of values. | diff --git a/spki/src/algorithm.rs b/spki/src/algorithm.rs
index 5a0c005..65b8b13 100644
--- a/spki/src/algorithm.rs
+++ b/spki/src/algorithm.rs
@@ -49,6 +49,17 @@ impl<'a> AlgorithmIdentifier<'a> {
}
}
+ /// Assert the values of the `algorithm` and `parameters` OIDs.
+ pub fn assert_oids(
+ ... | 1 | 11 | 0 |
182fdee56aa9b274c8cdf808c8e0c2d7e6666a8c | Tony Arcieri | 2021-06-07T17:01:28 | spki: add `assert_*_oid` methods to AlgorithmIdentifier (#485)
Adds methods for asserting that the OIDs in `AlgorithmIdentifier` are an
expected value. | diff --git a/der/src/tag.rs b/der/src/tag.rs
index 8e73a71..7438dd8 100644
--- a/der/src/tag.rs
+++ b/der/src/tag.rs
@@ -85,6 +85,31 @@ pub enum Tag {
}
impl Tag {
+ /// Assert that this [`Tag`] matches the provided expected tag.
+ ///
+ /// On mismatch, returns an [`Error`] with [`ErrorKind::UnexpectedTag... | 2 | 48 | 27 |
99ef0f56020ab16bdea2c23a1a5c4b98e8e9b11f | Tony Arcieri | 2021-06-06T17:16:27 | crypto-bigint: add UInt::into_limbs (#484)
The intended use case is initializing the existing `MODULUS` constants
for the various `Scalar` impls in the elliptic curve crates.
Longer term we should be able to migrate to an entirely `UInt`-based
implementation of scalar (ideally adding reusable `Field` types as
we... | diff --git a/crypto-bigint/src/uint.rs b/crypto-bigint/src/uint.rs
index 11bbf97..c1f8c2a 100644
--- a/crypto-bigint/src/uint.rs
+++ b/crypto-bigint/src/uint.rs
@@ -50,6 +50,12 @@ impl<const LIMBS: usize> UInt<LIMBS> {
&self.limbs
}
+ /// Convert this [`UInt`] into its inner limbs.
+ // TODO(tarci... | 1 | 6 | 0 |
e5e566ca18eb1e4b1b3edf7eb70b2a2d831d5556 | Tony Arcieri | 2021-06-05T23:45:11 | der: add `SequenceIter` (#483)
Adds an iterator over the encoded values in a homogenously typed
`Sequence`. | diff --git a/der/src/asn1.rs b/der/src/asn1.rs
index c4c6118..512b5ee 100644
--- a/der/src/asn1.rs
+++ b/der/src/asn1.rs
@@ -28,7 +28,7 @@ pub use self::{
null::Null,
octet_string::OctetString,
printable_string::PrintableString,
- sequence::Sequence,
+ sequence::{iter::SequenceIter, Sequence},
... | 4 | 59 | 5 |
c1f7fd345e112b2f363a5b8a3ab3d321df4fed7c | Tony Arcieri | 2021-06-05T16:54:31 | der: add ErrorKind::Value encoding helpers (#481)
Adds a `Tag::value_error()` helper method which simplifies returning
errors about invalid values for a given tag. | diff --git a/const-oid/src/error.rs b/const-oid/src/error.rs
index 7106dbc..01ddb72 100644
--- a/const-oid/src/error.rs
+++ b/const-oid/src/error.rs
@@ -2,6 +2,9 @@
use core::fmt;
+/// Result type
+pub type Result<T> = core::result::Result<T, Error>;
+
/// Error type
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
... | 21 | 93 | 125 |
7194cbdfbceb1281156a9399577fcd5617dedc18 | Tony Arcieri | 2021-06-05T16:13:06 | der: fix UIntBytes encoding regression; add tests (#480)
The encoded length was being miscomputed as it omitted the header.
This commit fixes that and adds a regression test. | diff --git a/der/src/asn1/integer/bigint.rs b/der/src/asn1/integer/bigint.rs
index ebd0454..edc1574 100644
--- a/der/src/asn1/integer/bigint.rs
+++ b/der/src/asn1/integer/bigint.rs
@@ -72,7 +72,7 @@ impl<'a> TryFrom<Any<'a>> for UIntBytes<'a> {
impl<'a> Encodable for UIntBytes<'a> {
fn encoded_len(&self) -> Res... | 1 | 23 | 2 |
af39cba8c7a6130e467cfc2dc79b16110c6b0d16 | Tony Arcieri | 2021-06-05T04:29:42 | der: add `Tag::octet` (#479)
Inherent method for encoding `Tag` as a byte | diff --git a/der/src/tag.rs b/der/src/tag.rs
index 49042b6..505cff3 100644
--- a/der/src/tag.rs
+++ b/der/src/tag.rs
@@ -84,6 +84,30 @@ pub enum Tag {
Private(TagNumber),
}
+impl Tag {
+ /// Get the octet encoding for this [`Tag`].
+ pub fn octet(self) -> u8 {
+ match self {
+ Tag::Boole... | 1 | 25 | 18 |
fa026e3850abedd70371107d1f78e8034e49b742 | Tony Arcieri | 2021-06-04T22:38:01 | pkcs8: return Result(s) when encoding; ASN.1 error improvements (#478)
Changes the infallible encoding methods to be fallible.
If we want to provide infallible versions, we should wrap that up in a
single place, rather than force encoders to constantly `expect()`.
Additionally this refactors the error type in o... | diff --git a/pkcs8/src/document/encrypted_private_key.rs b/pkcs8/src/document/encrypted_private_key.rs
index 9870292..4f91141 100644
--- a/pkcs8/src/document/encrypted_private_key.rs
+++ b/pkcs8/src/document/encrypted_private_key.rs
@@ -144,12 +144,12 @@ impl TryFrom<Vec<u8>> for EncryptedPrivateKeyDocument {
fn... | 7 | 55 | 34 |
31bc0d719a5309a8164e865b4291a50f2bcc8035 | Tony Arcieri | 2021-06-04T22:10:46 | der: refactor `tag` module; add tag number helpers (#477)
Performs some internal refactoring of the `tag` module, splitting out
`class` and `number` submodules.
Adds helper methods to `TagNumber` for creating specific classes of tags
with a given number. | diff --git a/der/src/tag.rs b/der/src/tag.rs
index c4aebec..49042b6 100644
--- a/der/src/tag.rs
+++ b/der/src/tag.rs
@@ -1,5 +1,10 @@
//! ASN.1 tags.
+mod class;
+mod number;
+
+pub use self::{class::Class, number::TagNumber};
+
use crate::{Decodable, Decoder, Encodable, Encoder, Error, ErrorKind, Length, Result};
... | 3 | 134 | 106 |
ef0896f939a37336196cd094101c1bd0f4dde0c9 | Tony Arcieri | 2021-06-04T20:10:08 | der: remove `bigint` feature gating on `UIntBytes` (#476)
Now that typenum is only being used as a transitive dependency of
`crypto-bigint` (which is conditionally gated on the `bigint` feature)
it's possible for `UIntBytes` to always be available.
Also factors `bigint` under `asn1::integer::bigint`. | diff --git a/der/src/asn1.rs b/der/src/asn1.rs
index ea4344f..c4c6118 100644
--- a/der/src/asn1.rs
+++ b/der/src/asn1.rs
@@ -1,8 +1,6 @@
//! ASN.1 built-in types.
mod any;
-#[cfg(feature = "bigint")]
-mod bigint;
mod bit_string;
mod boolean;
mod context_specific;
@@ -26,6 +24,7 @@ pub use self::{
context_sp... | 5 | 29 | 28 |
497cb3d67dbb0e10cfa513486632a9a5e813c7a5 | Tony Arcieri | 2021-06-04T19:46:01 | der: use slice patterns to decode unsigned integers (#475)
Flattens out and simplifies the logic | diff --git a/der/src/asn1/integer/int.rs b/der/src/asn1/integer/int.rs
index 7b82414..f8f2895 100644
--- a/der/src/asn1/integer/int.rs
+++ b/der/src/asn1/integer/int.rs
@@ -1,7 +1,5 @@
//! Support for encoding negative integers
-//! Unsigned integer decoders/encoders.
-
use super::is_highest_bit_set;
use crate::{a... | 2 | 7 | 12 |
0ee94c5017d81edd2839c24681abb6598a25a4ce | Tony Arcieri | 2021-06-04T19:33:36 | der: simplify UIntBytes (#474)
Removes the size bounds on `UIntBytes`, and makes it a simple wrapper
over the decoder/encoder functions already implemented in the
`der::asn1::integer::uint` module.
Since the sized (and const generic) `UInt` type can now handle the
previous use cases where a size bound is necessa... | diff --git a/Cargo.lock b/Cargo.lock
index 4608229..d483819 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -142,7 +142,6 @@ dependencies = [
"crypto-bigint",
"der_derive",
"hex-literal 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "typenum",
]
[[package]]
diff --git a/der/Cargo.toml b/der/Car... | 7 | 91 | 184 |
7509b1b6036b7951f6042091a5080e347f213cb6 | Tony Arcieri | 2021-06-04T17:21:40 | der: rename `BigUInt` => `UIntBytes` (#473)
Previously the following names were used:
- `BigUInt`: serialized big integer
- `UInt`: big integer type from the `crypto-bigint` crate
This is a bit confusing because the "Big" prefix didn't really
disambiguate what `BigUInt` was: a serialized big endian integer.
... | diff --git a/der/src/asn1.rs b/der/src/asn1.rs
index 3653602..ea4344f 100644
--- a/der/src/asn1.rs
+++ b/der/src/asn1.rs
@@ -41,4 +41,4 @@ pub use const_oid::ObjectIdentifier;
#[cfg(feature = "bigint")]
#[cfg_attr(docsrs, doc(cfg(feature = "bigint")))]
-pub use self::bigint::BigUInt;
+pub use self::bigint::UIntByte... | 5 | 24 | 24 |
86a84a78be7a52214b3392dc9a78e7453644d01b | Tony Arcieri | 2021-06-04T14:34:22 | der: simplify signed integer decoding logic (#471) | diff --git a/der/src/asn1/integer.rs b/der/src/asn1/integer.rs
index 05679ab..ac7cc9c 100644
--- a/der/src/asn1/integer.rs
+++ b/der/src/asn1/integer.rs
@@ -4,9 +4,8 @@ mod int;
mod uint;
use crate::{asn1::Any, Encodable, Encoder, Error, ErrorKind, Length, Result, Tag, Tagged};
-use core::{convert::TryFrom, mem};
+... | 2 | 3 | 11 |
f82891eebe6652469b43f38b28050c7a70287b98 | Tony Arcieri | 2021-06-04T06:28:14 | der: const generic signed integer decoder with i32/i64/i128 support (#470)
This PR is a corollary to #469, but implements signed integer decoding | diff --git a/der/src/asn1/integer.rs b/der/src/asn1/integer.rs
index a39c4f3..05679ab 100644
--- a/der/src/asn1/integer.rs
+++ b/der/src/asn1/integer.rs
@@ -1,84 +1,63 @@
//! ASN.1 `INTEGER` support.
+mod int;
mod uint;
-// TODO(tarcieri): add support for `i32`, `i64`, etc
+use crate::{asn1::Any, Encodable, Encod... | 4 | 114 | 78 |
9ce3d7a6aa4d61497aabe05e39950d4bd95a449e | Tony Arcieri | 2021-06-04T03:30:08 | der: const generic unsigned integer decoder with u32/u64/u128 support (#469)
This is another take on #325, but using const generics as a way to
provide a common implementation for Rust's unsigned integer primitives.
This commit replaces the existing DER decoder/encoder implementations
for integer primitives with ... | diff --git a/der/src/asn1/any.rs b/der/src/asn1/any.rs
index 4c9297f..0b90a58 100644
--- a/der/src/asn1/any.rs
+++ b/der/src/asn1/any.rs
@@ -170,7 +170,7 @@ impl<'a> Decodable<'a> for Any<'a> {
// The first octet of a BIT STRING encodes the number of unused bits.
// We presently constrain this... | 8 | 135 | 101 |
62c5c7f56789f7e1bd09bcfd51d9d6435089642a | Tony Arcieri | 2021-06-03T20:44:28 | der: refactor context-specific field decoding (#466)
Changes the `der::Decoder::context_specific` helper method to accept a
`TagNumber` as a parameter and attempt to locate a particular
context-specific field within a message.
Skips over lower-numbered unknown fields. If the expected field is
encountered, it ret... | diff --git a/der/src/decoder.rs b/der/src/decoder.rs
index 5abec15..51be832 100644
--- a/der/src/decoder.rs
+++ b/der/src/decoder.rs
@@ -1,7 +1,10 @@
//! DER decoder.
-use crate::{asn1::*, Choice, Decodable, ErrorKind, Length, Result};
-use core::convert::{TryFrom, TryInto};
+use crate::{asn1::*, Choice, Decodable, ... | 3 | 95 | 58 |
d0746a87fe5adf041af44e06051d698525f738fc | Tony Arcieri | 2021-06-03T19:23:05 | der: namespace ASN.1 types in `asn1` module (#465)
ASN.1 types were previously re-exported at the toplevel of the crate,
despite being internally factored into an `asn1` module.
This commit re-exports them from the `der::asn1` module instead, which
makes it easier to browse the supported ASN.1 types and tell them... | diff --git a/der/derive/src/choice.rs b/der/derive/src/choice.rs
index 9c7d67e..fcd9a37 100644
--- a/der/derive/src/choice.rs
+++ b/der/derive/src/choice.rs
@@ -19,7 +19,7 @@ pub(crate) struct DeriveChoice {
/// Tags included in the impl body for `der::Choice`.
choice_body: TokenStream,
- /// Enum match ... | 45 | 229 | 186 |
0f4ccff4307336146ee6e5d6d4edeac46f17d0f2 | Tony Arcieri | 2021-06-03T19:19:49 | cpufeatures: map `aarch64` HWCAPs to target features; add `crypto` (#456)
Closes #395
The HWCAPs provided by Linux are finer-grained than LLVM target
features. This crate is trying to detect the latter, so we need to group
together these finer grained features detected via HWCAPs.
This commit attempts to group... | diff --git a/cpufeatures/Cargo.toml b/cpufeatures/Cargo.toml
index 77fe99b..45ebf95 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"
+libc = "0.2.95"
[target.'cfg(all(target_arch = "aa... | 2 | 26 | 13 |
863f59d2516c5bf398814bb37c5cfeb0f2ead842 | Tony Arcieri | 2021-06-03T17:55:36 | der: add `TagNumber` type, make `Tag` structured (#464)
Adds a `TagNumber` type for representing the lower 5 bits of a Tag,
where bits 8/7 identify the class and bit 6 identifies primitive vs
constructed forms.
Changes `Tag` from being `repr(u8)` to a structured representation with
`Application`, `ContextSpecifi... | diff --git a/der/derive/src/choice.rs b/der/derive/src/choice.rs
index a42dcea..9c7d67e 100644
--- a/der/derive/src/choice.rs
+++ b/der/derive/src/choice.rs
@@ -224,9 +224,6 @@ impl DeriveChoice {
/// ASN.1 `CHOICE` alternative: one of the ASN.1 types comprising the `CHOICE`
/// which maps to an enum variant.
struct... | 5 | 243 | 260 |
4ff54f79d5c478720d5e6297e53208365aabbf07 | Tony Arcieri | 2021-06-02T19:44:12 | crypto-bigint: additional ArrayEncoding::ByteSize bounds (#462)
Matches the previous bounds used by `elliptic_curve::FieldSize` so we
can easily migrate the `elliptic-curve` crate to use this as the basis
of all `ArrayLength` computations. | diff --git a/crypto-bigint/src/array.rs b/crypto-bigint/src/array.rs
index a53a921..5456605 100644
--- a/crypto-bigint/src/array.rs
+++ b/crypto-bigint/src/array.rs
@@ -1,6 +1,7 @@
//! Interop support for `generic-array`
-use generic_array::{ArrayLength, GenericArray};
+use core::ops::Add;
+use generic_array::{typen... | 1 | 3 | 2 |
1eba3bb67acd09963e4943c21419d47685a475ca | Tony Arcieri | 2021-06-02T18:25:43 | crypto-bigint: add `From` conversions between `UInt` and limb arrays (#460)
These will make it much easier to incrementally retrofit `UInt` into the
`elliptic-curve` crate and the respective curve implementations.
From an encapsulation perspective, it's a bit problematic because it's
exposing the internal represe... | diff --git a/crypto-bigint/src/uint.rs b/crypto-bigint/src/uint.rs
index 9018b90..a01059e 100644
--- a/crypto-bigint/src/uint.rs
+++ b/crypto-bigint/src/uint.rs
@@ -42,6 +42,7 @@ impl<const LIMBS: usize> UInt<LIMBS> {
};
/// Borrow the limbs of this [`UInt`].
+ // TODO(tarcieri): eventually phase this ou... | 2 | 16 | 0 |
3e9fa334fbd7d9f667391ea1c52d78c94f16ea2e | Tony Arcieri | 2021-06-02T17:12:52 | crypto-bigint: impl ConstantTimeGreater/ConstantTimeLess for UInt (#459)
Also adds `Ord` and `PartialOrd` impls that use the subtle-based
comparisons internally. | diff --git a/crypto-bigint/src/uint.rs b/crypto-bigint/src/uint.rs
index a599691..9018b90 100644
--- a/crypto-bigint/src/uint.rs
+++ b/crypto-bigint/src/uint.rs
@@ -6,6 +6,7 @@
mod macros;
mod add;
+mod ct;
mod decode;
mod from;
mod mul;
@@ -15,8 +16,8 @@ mod sub;
mod array;
use crate::{Concat, Limb, NumBits... | 2 | 129 | 22 |
6322d22f8662a51665beddbd55fcef1452a07b00 | Tony Arcieri | 2021-05-30T21:01:56 | crypto-bigint: refactor `UInt` tests (#452)
Splits `UInt`-related tests into individual modules for each operation. | diff --git a/crypto-bigint/src/uint.rs b/crypto-bigint/src/uint.rs
index b4dcfed..ba4cc7b 100644
--- a/crypto-bigint/src/uint.rs
+++ b/crypto-bigint/src/uint.rs
@@ -87,18 +87,23 @@ impl<const LIMBS: usize> UInt<LIMBS> {
"number of limbs must be greater than zero"
);
- let lo = Self::from_... | 10 | 383 | 332 |
a0126acf72b05c8736d13450690b9d39f98f8be5 | Tony Arcieri | 2021-05-30T20:20:41 | crypto-bigint: factor `uint` tests into a `tests/` module (#451)
This allows using `std`-dependent features in tests, and also would make
it easier to refactor these tests into separate modules based on given
operations or other functionality. | diff --git a/crypto-bigint/src/uint.rs b/crypto-bigint/src/uint.rs
index 3b7c125..b4dcfed 100644
--- a/crypto-bigint/src/uint.rs
+++ b/crypto-bigint/src/uint.rs
@@ -624,323 +624,3 @@ impl_split! {
(U6144, 6144),
(U8192, 8192)
}
-
-#[cfg(test)]
-mod tests {
- use super::{U128, U64};
- use crate::{Concat... | 2 | 325 | 320 |
56fb7ff5fd2b4131caec25527ddf4d10bb5b375d | Tony Arcieri | 2021-05-30T18:53:13 | crypto-bigint: add From impl for splitting (#450)
Allows splitting by using a `From` conversion to a 2-tuple of a
half-width value. | diff --git a/crypto-bigint/src/uint.rs b/crypto-bigint/src/uint.rs
index e203ee9..3b7c125 100644
--- a/crypto-bigint/src/uint.rs
+++ b/crypto-bigint/src/uint.rs
@@ -553,6 +553,12 @@ macro_rules! impl_split {
(hi_out, lo_out)
}
}
+
+ impl From<$name> for (UIn... | 1 | 6 | 0 |
5855ed2ab405a9aea826a3f07ce06955f42a7acf | Tony Arcieri | 2021-05-30T18:45:42 | crypto-bigint: add `nlimbs!` macro (#449)
Adds a macro which can compute the number of limbs required to store an
n-bit number at compile time.
This is intended as a stop gap until a forthcoming Rust feature like
`const_evaluatable_checked` allows it to be replaced with something such
as a `const fn`.
For now... | diff --git a/crypto-bigint/src/macros.rs b/crypto-bigint/src/macros.rs
index a0acaea..f8b4baa 100644
--- a/crypto-bigint/src/macros.rs
+++ b/crypto-bigint/src/macros.rs
@@ -8,3 +8,33 @@ macro_rules! const_assert {
[$msg][!$bool as usize]
};
}
+
+/// Calculate the number of limbs required to represent the... | 2 | 35 | 25 |
7aa608895160f4aa5f9263192aa52bc3fa727f6b | Tony Arcieri | 2021-05-30T18:03:38 | crypto-bigint: add `Checked` wrapper type (#448)
Adds a wrapper type which always performs checked arithmetic, and
internally stores the result as a `CtOption`.
This enables an ergonomic way to describe arithmetic expressions which
check for overflow in constant time. | diff --git a/crypto-bigint/Cargo.toml b/crypto-bigint/Cargo.toml
index 22ea07c..2f704b4 100644
--- a/crypto-bigint/Cargo.toml
+++ b/crypto-bigint/Cargo.toml
@@ -16,7 +16,7 @@ readme = "README.md"
[dependencies]
generic-array = { version = "0.14", optional = true }
-subtle = { version = "2", default-features = false... | 3 | 96 | 1 |
a76e626a94c791078ef7ffadca9e6e4135ce68c2 | Tony Arcieri | 2021-05-30T17:23:56 | crypto-bigint: add `Wrapping` wrapper type (#447)
Adds a type analogous to `core::num::Wrapping` which always performs
wrapping arithmetic on the inner value.
Initial support is provided for `UInt`, but like the `core`/`std` type
it's designed to be generic and provides some generic implementations as
well, in c... | diff --git a/crypto-bigint/src/lib.rs b/crypto-bigint/src/lib.rs
index 671dbb8..a9b2335 100644
--- a/crypto-bigint/src/lib.rs
+++ b/crypto-bigint/src/lib.rs
@@ -29,11 +29,13 @@ mod uint;
#[cfg(feature = "generic-array")]
mod array;
+mod wrapping;
pub use crate::{
limb::Limb,
traits::{Concat, NumBits, N... | 2 | 191 | 0 |
6de9bc8e10c34b71d9ed997642ce798f4003b5b8 | Tony Arcieri | 2021-05-30T16:46:53 | crypto-bigint: add Display, LowerHex, and UpperHex impls to UInt (#446) | diff --git a/crypto-bigint/src/lib.rs b/crypto-bigint/src/lib.rs
index 040cb38..671dbb8 100644
--- a/crypto-bigint/src/lib.rs
+++ b/crypto-bigint/src/lib.rs
@@ -20,9 +20,6 @@
#![forbid(unsafe_code, clippy::unwrap_used)]
#![warn(missing_docs, rust_2018_idioms, unused_qualifications)]
-#[cfg(feature = "std")]
-extern... | 2 | 25 | 3 |
a791f68f940eedd0ce81451a86ca678ea0177422 | Tony Arcieri | 2021-05-30T16:33:29 | crypto-bigint: subtraction support (#445)
Implements `sbb`, `wrapping_sub`, and `checked_sub` functions on `UInt`. | diff --git a/crypto-bigint/src/limb.rs b/crypto-bigint/src/limb.rs
index 3e0bc9f..8316d9f 100644
--- a/crypto-bigint/src/limb.rs
+++ b/crypto-bigint/src/limb.rs
@@ -26,6 +26,24 @@ pub(crate) const fn adc(a: Limb, b: Limb, carry: Limb) -> (Limb, Limb) {
(ret as u64, (ret >> 64) as u64)
}
+/// Computes `a - (b + ... | 2 | 116 | 32 |
58b8f76b42669aebf3f70b73048f88395016ea71 | Tony Arcieri | 2021-05-30T15:46:59 | crypto-bigint: `Concat` and `Split` traits (#444)
Adds the following traits:
- `Concat`: combine hi/lo components into a double-width number
- `Split`: splits a number apart into hi/lo components
For now these are implemented using macros.
This commit revises the list of exported numbers such that all of the... | diff --git a/crypto-bigint/src/array.rs b/crypto-bigint/src/array.rs
index dcdc470..5817d6f 100644
--- a/crypto-bigint/src/array.rs
+++ b/crypto-bigint/src/array.rs
@@ -66,21 +66,17 @@ impl_biguint_array_encoding! {
(U128, typenum::U16),
(U192, typenum::U24),
(U256, typenum::U32),
- (U320, typenum::U4... | 4 | 223 | 43 |
e72de5f8e3858703a5711e9aa523d03c3c827bf9 | Tony Arcieri | 2021-05-29T19:32:51 | crypto-bigint: `mul_wide`/`wrapping_mul`/`checked_mul` for UInt (#443)
Implements schoolbook multiplication of two `UInt` values, with a core
"wide" multiplication operation which is twice the width of the input
value, currently implemented as a 2-tuple and aliased to `Wide`.
Also provides `wrapping_mul` and `che... | diff --git a/crypto-bigint/Cargo.lock b/crypto-bigint/Cargo.lock
new file mode 100644
index 0000000..5f00c93
--- /dev/null
+++ b/crypto-bigint/Cargo.lock
@@ -0,0 +1,44 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "crypto-bigint"
+version = "0.0.0"
... | 6 | 240 | 51 |
529865ad1ae5e2328e7a11f4be3e1d60239f9ebe | Tony Arcieri | 2021-05-29T04:32:11 | crypto-bigint: wrapping add support for UInt (#442) | diff --git a/crypto-bigint/src/uint.rs b/crypto-bigint/src/uint.rs
index 6b0a29a..9637504 100644
--- a/crypto-bigint/src/uint.rs
+++ b/crypto-bigint/src/uint.rs
@@ -27,6 +27,11 @@ impl<const LIMBS: usize> UInt<LIMBS> {
/// The value `1`.
pub const ONE: Self = Self::from_u8(1);
+ /// Maximum value this [`... | 1 | 28 | 17 |
0d3ea45d8dd3b738b85fb35d032b0c106558e5ca | Tony Arcieri | 2021-05-29T03:27:18 | crypto-bigint: add deserialization tests for `generic-array` (#440)
Tests deserialization from `ByteArray` when the `generic-array` crate
feature is enabled. | diff --git a/crypto-bigint/src/array.rs b/crypto-bigint/src/array.rs
index f030bf2..cff7350 100644
--- a/crypto-bigint/src/array.rs
+++ b/crypto-bigint/src/array.rs
@@ -1,5 +1,6 @@
//! Interop support for `generic-array`
+use crate::uint::*;
use generic_array::{ArrayLength, GenericArray};
/// Alias for a byte ar... | 3 | 110 | 36 |
4efd7d000dda42e8395a0bab81e317a7a3e851d7 | Tony Arcieri | 2021-05-26T22:05:15 | pkcs5: support scrypt as a PBKDF (under `pbes2` feature) (#436)
Adds support for deriving PBES2 `EncryptionKey`s from a password using
the `scrypt` crate.
Includes test vectors derived from an OpenSSL-generated encrypted PKCS#8
key already checked in as an example key for the `pkcs8` crate named:
ed25519-encpr... | diff --git a/Cargo.lock b/Cargo.lock
index 4e7dae7..d7a6794 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -232,6 +232,7 @@ dependencies = [
"hex-literal 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"hmac",
"pbkdf2",
+ "scrypt",
"sha2",
"spki",
]
@@ -273,6 +274,27 @@ version = "0.6.2"
source... | 7 | 183 | 67 |
37078005b5245d0173f91a431084d5230510c6a6 | Tony Arcieri | 2021-05-26T20:58:57 | cpufeatures: add iOS support (static ARM64 capabilities only) (#435)
All Apple ARM64 hardware has the same baseline set of statically known
capabilities which can be assumed on all iOS (and macOS) platforms.
This commit adds support for those statically known capabilities on iOS.
Unfortunately it does not appea... | diff --git a/cpufeatures/src/aarch64.rs b/cpufeatures/src/aarch64.rs
index 935d462..e348946 100644
--- a/cpufeatures/src/aarch64.rs
+++ b/cpufeatures/src/aarch64.rs
@@ -135,8 +135,31 @@ pub unsafe fn sysctlbyname(name: &[u8]) -> bool {
value != 0
}
+// iOS `check!` macro.
+//
+// Unfortunately iOS does not prov... | 1 | 24 | 1 |
aa987fce4a7afc58afc91185d8f8bc614e115708 | Tony Arcieri | 2021-05-24T23:36:14 | der: add decoder positions to TryFrom<Any<'a>> decoding (#431)
Adds error context information from the `Decoder` to the errors that
occur in the `Decodable` impl for `Any`.
These show the position offset at the *end* of the erroneous field,
which is inaccurate, but better than 0.
Further improving this likely ... | diff --git a/der/src/asn1/any.rs b/der/src/asn1/any.rs
index 62a3481..7ff7f90 100644
--- a/der/src/asn1/any.rs
+++ b/der/src/asn1/any.rs
@@ -165,21 +165,24 @@ impl<'a> Decodable<'a> for Any<'a> {
let tag = header.tag;
let mut value = decoder
.bytes(header.length)
- .map_err(|_|... | 1 | 7 | 4 |
8840b10d01530b3151678540d32e1967f6747f32 | Tony Arcieri | 2021-05-24T23:18:04 | der: update `ContextSpecific` helper methods for `Any` (#429)
Makes the methods match what are available on `Decoder`. | diff --git a/der/src/asn1/any.rs b/der/src/asn1/any.rs
index ac3a487..62a3481 100644
--- a/der/src/asn1/any.rs
+++ b/der/src/asn1/any.rs
@@ -1,9 +1,9 @@
//! ASN.1 `ANY` type.
use crate::{
- BitString, ByteSlice, Choice, Decodable, Decoder, Encodable, Encoder, Error, ErrorKind,
- GeneralizedTime, Header, Ia5St... | 2 | 70 | 61 |
87d1708e10154dda4f041cd54cef44081efe015e | Tony Arcieri | 2021-05-24T22:19:19 | der: add ContextSpecific field wrapper; fix BitString -> Any (#428)
Adds a `ContextSpecific` field wrapper type which decodes/encodes the
context-specific tag (sans the tag class prefix bits and constructed
bitflag) and inner value as an `Any`.
Additionally fixes a bug (discovered via the PKCS#8 impl) in the
`Fr... | diff --git a/der/src/asn1.rs b/der/src/asn1.rs
index 5d713a2..02d6da0 100644
--- a/der/src/asn1.rs
+++ b/der/src/asn1.rs
@@ -8,6 +8,7 @@ pub(crate) mod big_uint;
pub(crate) mod bit_string;
pub(crate) mod boolean;
pub(crate) mod choice;
+pub(crate) mod context_specific;
pub(crate) mod generalized_time;
pub(crate) m... | 21 | 329 | 273 |
9a3c80610d341c55aec86fbd0587b193bcc06a9d | Tony Arcieri | 2021-05-24T19:18:39 | pkcs8: fix attribute encoding and Debug impl (#427)
Encodes attributes into the `OneAsymmetricKey` message if present, and
includes them in the Debug output if present. | diff --git a/pkcs8/src/one_asymmetric_key.rs b/pkcs8/src/one_asymmetric_key.rs
index d830730..2217f4f 100644
--- a/pkcs8/src/one_asymmetric_key.rs
+++ b/pkcs8/src/one_asymmetric_key.rs
@@ -3,6 +3,7 @@
use der::{Decodable, Encodable, Message};
+use self::pubkey::PublicKeyBitString;
use crate::{AlgorithmIdentifier,... | 1 | 7 | 5 |
b92889a904388ca35916b43e0564d11d16e66166 | Tony Arcieri | 2021-05-24T18:57:17 | pkcs8: add TODO for proper extension handling; fix dups (#426)
The ellipsis `...` in the ASN.1 schema was previously interpreted as
allowing duplicate fields for `attributes` and `public_key`, however it
seems that it should correctly be interpreted as an extension marker
which allows extension fields to exist afte... | diff --git a/pkcs8/src/one_asymmetric_key.rs b/pkcs8/src/one_asymmetric_key.rs
index 2bf76f9..d830730 100644
--- a/pkcs8/src/one_asymmetric_key.rs
+++ b/pkcs8/src/one_asymmetric_key.rs
@@ -87,24 +87,17 @@ impl<'a> TryFrom<der::Any<'a>> for OneAsymmetricKey<'a> {
let algorithm = decoder.decode()?;
... | 1 | 11 | 18 |
2fc43c40aacb0a9b1f98d5945a9642c43a51a016 | Tony Arcieri | 2021-05-24T18:26:09 | pkcs8: expose Attributes (#425)
Exposes raw `Attributes` for the `OneAsymmetricKey` struct.
No attempt is made to parse them as a `SET OF Attribute`. Instead it
exposes an inner `Any` value for the context-specific tag 0.
The main use case for this is likely to be an optional certificate
field, possibly used i... | diff --git a/pkcs8/src/attributes.rs b/pkcs8/src/attributes.rs
index 0ee3d62..b410040 100644
--- a/pkcs8/src/attributes.rs
+++ b/pkcs8/src/attributes.rs
@@ -1,31 +1,70 @@
+//! `OneAsymmetricKey` attributes.
+
use core::convert::TryFrom;
-use der::{Any, Encodable, Encoder, Error, Length, Result, Tag, Tagged};
+use de... | 5 | 137 | 97 |
0fffa449b3f73e738519bd0ffabba945417efaa6 | Tony Arcieri | 2021-05-20T21:40:44 | der: add context-specific methods to `Decoder` (#423)
Adds helper methods to `Decoder` for parsing fields with
context-specific tags:
- `context_specific`
- `context_specific_optional` | diff --git a/der/src/asn1/any.rs b/der/src/asn1/any.rs
index f422bc8..d9c4d6e 100644
--- a/der/src/asn1/any.rs
+++ b/der/src/asn1/any.rs
@@ -67,7 +67,7 @@ impl<'a> Any<'a> {
self.try_into()
}
- /// Attempt to decode an ASN.1 `CONTEXT-SPECIFIC`, creating a new
+ /// Attempt to decode an ASN.1 `CONT... | 2 | 34 | 2 |
1e838a2cb23905473f3716334ddb813420f17038 | Tony Arcieri | 2021-05-20T18:57:41 | der: add helper methods for context-specific fields to Any (#422)
Adds `::context_specific` and `::context_specific_optional` methods to
the `Any` type to simplify decoding fields with context-specific tags. | diff --git a/der/src/asn1/any.rs b/der/src/asn1/any.rs
index b91c29c..f422bc8 100644
--- a/der/src/asn1/any.rs
+++ b/der/src/asn1/any.rs
@@ -67,6 +67,48 @@ impl<'a> Any<'a> {
self.try_into()
}
+ /// Attempt to decode an ASN.1 `CONTEXT-SPECIFIC`, creating a new
+ /// nested [`Decoder`] and calling ... | 2 | 131 | 1 |
0abf15d630ebbc00b8a1077f4f31d92d35b0c1cd | Tony Arcieri | 2021-05-20T18:28:23 | der: add `Class` enum (#421)
Adds an enum for the various ASN.1 tag classes. | diff --git a/der/src/lib.rs b/der/src/lib.rs
index db48c9a..02257fe 100644
--- a/der/src/lib.rs
+++ b/der/src/lib.rs
@@ -375,7 +375,7 @@ pub use crate::{
header::Header,
length::Length,
message::Message,
- tag::{Tag, Tagged},
+ tag::{Class, Tag, Tagged},
};
pub(crate) use crate::byte_slice::Byt... | 2 | 68 | 8 |
8c6849ba5f4227dec5977b2047f21faff58a1036 | Tony Arcieri | 2021-05-20T15:44:34 | der: add Decoder::any_optional() method (#420)
Allows retrieving an OPTIONAL ANY value. | diff --git a/der/src/decoder.rs b/der/src/decoder.rs
index a34585d..2934778 100644
--- a/der/src/decoder.rs
+++ b/der/src/decoder.rs
@@ -90,6 +90,11 @@ impl<'a> Decoder<'a> {
self.decode()
}
+ /// Attempt to decode an `OPTIONAL` ASN.1 `ANY` value.
+ pub fn any_optional(&mut self) -> Result<Option<... | 1 | 5 | 0 |
59a820fc1faf30a74459b87a5f72d5e8bdd5ffbe | Tony Arcieri | 2021-05-19T17:09:03 | crypto-bigint: const-capable hex decoding support for UInt (#415)
Support for decoding `UInt` from hexadecimal strings, including in const
contexts. | diff --git a/crypto-bigint/src/lib.rs b/crypto-bigint/src/lib.rs
index d8d6a24..8e01f26 100644
--- a/crypto-bigint/src/lib.rs
+++ b/crypto-bigint/src/lib.rs
@@ -15,6 +15,9 @@
#[cfg(feature = "std")]
extern crate std;
+#[macro_use]
+mod macros;
+
mod ops;
mod traits;
mod uint;
diff --git a/crypto-bigint/src/macro... | 4 | 187 | 30 |
359fd6c8d210df7547bd636e599e748ba83b163f | Tony Arcieri | 2021-05-15T15:36:52 | cpufeatures: support compiling on non-Linux/macOS aarch64 targets (#408)
ARM CPU feature detection is unfortunately tied to OS APIs, as the
registers containing information about CPU features are not accessible
to unprivileged userspace programs.
However, the previous setup which gated support on Linux/macOS only... | diff --git a/cpufeatures/src/aarch64.rs b/cpufeatures/src/aarch64.rs
index fb2bdfc..935d462 100644
--- a/cpufeatures/src/aarch64.rs
+++ b/cpufeatures/src/aarch64.rs
@@ -134,3 +134,13 @@ pub unsafe fn sysctlbyname(name: &[u8]) -> bool {
assert_eq!(rc, 0, "sysctlbyname returned error code: {}", rc);
value != 0
... | 2 | 13 | 7 |
6da0fd7abb8c6090d74ad3ec2e5fc08e3ffac8aa | Tony Arcieri | 2021-05-13T21:48:32 | cpufeatures: remove `neon` on `aarch64` targets (#406)
The `neon` feature is enabled by default on all `aarch64` targets, so
there is no need for runtime detection on these targets.
Runtime detection might be interesting on 32-bit ARM targets, however
this crate's ARM support is presently `aarch64`-only. | diff --git a/cpufeatures/src/aarch64.rs b/cpufeatures/src/aarch64.rs
index 4b6b18a..fb2bdfc 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", HWCAP_AES), // Enable AES suppor... | 2 | 1 | 5 |
695c899d2fbafc4db7c9450f2369c5d66f73ebdb | Tony Arcieri | 2021-05-13T16:45:37 | cpufeatures: test NEON (#404)
Adds `neon` to the armcaps used in the test | diff --git a/cpufeatures/tests/aarch64.rs b/cpufeatures/tests/aarch64.rs
index 7fa387d..f44514f 100644
--- a/cpufeatures/tests/aarch64.rs
+++ b/cpufeatures/tests/aarch64.rs
@@ -2,16 +2,16 @@
#![cfg(target_arch = "aarch64")]
-cpufeatures::new!(armcaps_aes_sha2_sha3, "aes", "sha2", "sha3");
+cpufeatures::new!(armcap... | 2 | 8 | 8 |
442176ad845d7df7091c9c2ed8d86d89b0cc3cbb | Tony Arcieri | 2021-05-13T16:38:55 | cpufeatures: fix usage on Musl environments; add NEON support (#403)
The `libc` crate doesn't presently define Linux's `HWCAP_*` in
Musl-based environments:
https://github.com/rust-lang/libc/issues/2171
This PR (temporarily) copies the presently supported `HWCAP_*` constants
directly into this crate.
Additi... | diff --git a/cpufeatures/src/aarch64.rs b/cpufeatures/src/aarch64.rs
index 74fa5df..4b6b18a 100644
--- a/cpufeatures/src/aarch64.rs
+++ b/cpufeatures/src/aarch64.rs
@@ -51,15 +51,13 @@ macro_rules! __detect_target_features {
#[cfg(target_os = "linux")]
macro_rules! __expand_check_macro {
($(($name:tt, $hwcap:ide... | 1 | 19 | 5 |
fd95867b114152b75ef12271199976902698e3bd | Tony Arcieri | 2021-05-06T20:26:49 | cpufeatures: fix access to hwcaps on Linux/aarch64 (#399)
As in #398, the `libc` symbol is still being emitted from a macro, in
this case to reference the individual hwcaps.
This commit re-exports them all from the `cpufeatures::aarch64` module
and has the macro reference them that way. | diff --git a/cpufeatures/src/aarch64.rs b/cpufeatures/src/aarch64.rs
index 5f28589..74fa5df 100644
--- a/cpufeatures/src/aarch64.rs
+++ b/cpufeatures/src/aarch64.rs
@@ -4,6 +4,8 @@
//! unprivileged userspace code, so this implementation relies on OS-specific
//! APIs for feature detection.
+// Evaluate the given `$... | 2 | 29 | 15 |
d3210e8d7b48474c1eb59294fc5eaec6dbbcf4f0 | Tony Arcieri | 2021-05-06T19:33:59 | cpufeatures: fix Linux/aarch64 support (#398)
The `__detect_target_features` macro was expanding into code that
directly referenced `libc::getauxval`.
This commit adds a small helper function for querying `AT_HWCAP` using
`getauxval` similar to the `sysctlbyname` helper function used on MacOS,
and then has the m... | diff --git a/cpufeatures/src/aarch64.rs b/cpufeatures/src/aarch64.rs
index 07bdad2..5f28589 100644
--- a/cpufeatures/src/aarch64.rs
+++ b/cpufeatures/src/aarch64.rs
@@ -23,11 +23,17 @@ macro_rules! __unless_target_features {
#[doc(hidden)]
macro_rules! __detect_target_features {
($($tf:tt),+) => {{
- let ... | 1 | 7 | 1 |
96107ccced23958af34d9cfc5394ccdc24509171 | Tony Arcieri | 2021-05-06T18:48:45 | cpufeatures: document supported target features (#396)
Adds a list of the supported target features for each supported
CPU type. | diff --git a/cpufeatures/src/lib.rs b/cpufeatures/src/lib.rs
index 29b9fdd..3511313 100644
--- a/cpufeatures/src/lib.rs
+++ b/cpufeatures/src/lib.rs
@@ -3,20 +3,28 @@
//! macros to `libcore` is implemented.
//!
//! Supported target architectures:
-//! - `aarch64` (Linux and macOS/M4)
-//! - `x86`/`x86_64` (OS indepe... | 1 | 13 | 4 |
90a8546841ef9074e44c3858b8965b7d489c2e13 | Tony Arcieri | 2021-04-28T21:02:49 | block-buffer v0.10.0-pre.4 (#386) | diff --git a/Cargo.lock b/Cargo.lock
index 34b8bc7..f61c9ca 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -55,7 +55,7 @@ dependencies = [
[[package]]
name = "block-buffer"
-version = "0.10.0-pre.3"
+version = "0.10.0-pre.4"
dependencies = [
"block-padding 0.3.0-pre",
"generic-array",
diff --git a/block-buffer/Ca... | 3 | 3 | 3 |
b364717cf378510ef54c9a1fca3fa1093ba4b1eb | Artyom Pavlov | 2021-04-28T20:50:45 | block-buffer: add block_mode_processing methods (#315) | diff --git a/block-buffer/src/buffer.rs b/block-buffer/src/buffer.rs
index 0d0bf96..fd0a080 100644
--- a/block-buffer/src/buffer.rs
+++ b/block-buffer/src/buffer.rs
@@ -3,8 +3,9 @@ use block_padding::Padding;
use crate::{
utils::{to_blocks, to_blocks_mut},
- Block, DigestBuffer, ParBlock,
+ Block, DigestB... | 3 | 164 | 15 |
215f63431d40a9d40610a516d53505ea150df1a3 | Tony Arcieri | 2021-04-28T20:48:05 | block-buffer v0.10.0-pre.3 (#385) | diff --git a/Cargo.lock b/Cargo.lock
index 320b119..34b8bc7 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -55,7 +55,7 @@ dependencies = [
[[package]]
name = "block-buffer"
-version = "0.10.0-pre.2"
+version = "0.10.0-pre.3"
dependencies = [
"block-padding 0.3.0-pre",
"generic-array",
diff --git a/block-buffer/Ca... | 3 | 3 | 3 |
cd22b603acff61f7ecb85e9a0ce7481941689c81 | Tony Arcieri | 2021-04-26T18:42:43 | pkcs5+pkcs8+spki: forbid `clippy::unwrap_used` (#383) | diff --git a/pkcs5/src/lib.rs b/pkcs5/src/lib.rs
index c1e2738..b4218be 100644
--- a/pkcs5/src/lib.rs
+++ b/pkcs5/src/lib.rs
@@ -22,7 +22,7 @@
html_favicon_url = "https://raw.githubusercontent.com/RustCrypto/meta/master/logo.svg",
html_root_url = "https://docs.rs/pkcs5/0.2.0"
)]
-#![forbid(unsafe_code)]
+#![... | 3 | 3 | 3 |
3700f82a7bbca8099ad0a379b3afa586fc06b3f1 | Tony Arcieri | 2021-04-26T18:33:14 | const-oid+der: forbid unwrap (#382)
Uses Clippy to forbid use of `unwrap()` on both `Option` and `Result`.
Also fixes the few lingering uses of unwrap (in one case replacing it
with panic-free code) | diff --git a/const-oid/src/encoder.rs b/const-oid/src/encoder.rs
index a08c902..29b3e09 100644
--- a/const-oid/src/encoder.rs
+++ b/const-oid/src/encoder.rs
@@ -119,11 +119,12 @@ pub(crate) fn write_base128(bytes: &mut [u8], mut n: Arc) -> Result<usize> {
let byte = bytes.get_mut(i).ok_or(Error)?;
*by... | 6 | 21 | 8 |
f6d755e93bf2d3496a205cd3981ec70c81665766 | Tony Arcieri | 2021-04-15T19:51:56 | const-oid: add ObjectIdentifier::MAX_LENGTH constant (#372)
Deprecates the const `ObjectIdentifier::max_len()` function and replaces
it with a proper constant value. | diff --git a/const-oid/src/encoder.rs b/const-oid/src/encoder.rs
index 6ec1a3c..a08c902 100644
--- a/const-oid/src/encoder.rs
+++ b/const-oid/src/encoder.rs
@@ -11,7 +11,7 @@ pub(crate) struct Encoder {
state: State,
/// Bytes of the OID being encoded in-progress
- bytes: [u8; ObjectIdentifier::max_len()... | 3 | 14 | 10 |
576125a858c66fe9337fe92a2456254dd7acd289 | Tony Arcieri | 2021-04-15T19:42:00 | der: add length constants (#371)
Adds the following constants:
- `Length::ZERO`
- `Length::ONE`
- `Length::MAX`
- `GeneralizedTime::LENGTH`
- `UtcTime::LENGTH`
Deprecates the `const fn`s that previously provided the same values. | diff --git a/der/src/asn1/bit_string.rs b/der/src/asn1/bit_string.rs
index 4e4de3e..00a9776 100644
--- a/der/src/asn1/bit_string.rs
+++ b/der/src/asn1/bit_string.rs
@@ -85,11 +85,11 @@ impl<'a> From<BitString<'a>> for &'a [u8] {
impl<'a> Encodable for BitString<'a> {
fn encoded_len(&self) -> Result<Length> {
- ... | 14 | 53 | 37 |
23997c812dd7ed94c9b336394d7c6c569743ea31 | Tony Arcieri | 2021-04-15T18:33:07 | der: make inner integer wrapped by Length fully private (#368)
Removes `pub(crate)` from the inner `u32` which the `Length` type wraps.
This ensures upholding the invariant that the inner length is less than
`Length::max` only needs to happen in the `length` module, and builds on
the work from #367 to ensure that... | diff --git a/der/src/asn1/generalized_time.rs b/der/src/asn1/generalized_time.rs
index c1aa403..b3a197c 100644
--- a/der/src/asn1/generalized_time.rs
+++ b/der/src/asn1/generalized_time.rs
@@ -9,9 +9,6 @@ use core::{convert::TryFrom, time::Duration};
#[cfg(feature = "std")]
use std::time::{SystemTime, UNIX_EPOCH};
... | 3 | 12 | 11 |
0ff5330e1888fb347429720697b070296a156995 | Tony Arcieri | 2021-04-15T18:15:35 | der: fix length overflow on add (#367)
In PR #349, the internal representation of a Length was changed from
`u16` to `u32` to make it easier to support documents larger than 64kB
in the future.
However, this added a `Length::max` invariant which wasn't getting
properly checked when doing addition (it was only ch... | diff --git a/der/src/length.rs b/der/src/length.rs
index 8b6b1ed..ba77f7a 100644
--- a/der/src/length.rs
+++ b/der/src/length.rs
@@ -27,6 +27,7 @@ impl Length {
}
/// Get the maximum length supported by this crate
+ // TODO(tarcieri): support lengths greater than 65535
pub const fn max() -> Self {
... | 1 | 37 | 10 |
9e7cfd8417bca1b4e51433bc951bbaab2de7f675 | Tony Arcieri | 2021-04-01T15:40:29 | der: add PartialOrd + Ord impls to all ASN.1 types (#363)
This permits usage in a `SetOf` context which requires ordering. | diff --git a/der/src/asn1/any.rs b/der/src/asn1/any.rs
index aeaed3c..b91c29c 100644
--- a/der/src/asn1/any.rs
+++ b/der/src/asn1/any.rs
@@ -19,7 +19,7 @@ use crate::ObjectIdentifier;
/// Nevertheless, this crate defines an [`Any`] type as it remains a familiar
/// and useful concept which is still extensively used i... | 14 | 15 | 15 |
05ebffc00694876355e445164237eeea1cb8aac3 | Tony Arcieri | 2021-03-21T22:53:46 | der: impl SetOf for BTreeSet (#352)
When `alloc` is available, `BTreeSet` is an ideal data structure for
DER-encoded ASN.1 `SET OF`, as DER carries the canonicalization
requirement that the elements are ordered, and `BTreeSet` is bounded on
an `Ord` impl and provides ordering as a first-class property. | diff --git a/der/src/asn1/choice.rs b/der/src/asn1/choice.rs
index a4c6e90..0306c60 100644
--- a/der/src/asn1/choice.rs
+++ b/der/src/asn1/choice.rs
@@ -14,6 +14,8 @@ pub trait Choice<'a>: Decodable<'a> + Encodable {
fn can_decode(tag: Tag) -> bool;
}
+/// This blanket impl allows any [`Tagged`] type to functio... | 3 | 123 | 15 |
1007fbc817d6cb74a812cea19e9afc9f041c4b7e | Tony Arcieri | 2021-03-21T20:47:00 | der: add `Length::one` and `Length::for_tlv` (#351)
The latter specifically simplifies calculations for a TLV-encoded value
(i.e. with tag byte and length prefix) given an inner length. | diff --git a/der/src/asn1/any.rs b/der/src/asn1/any.rs
index 8237f4f..aeaed3c 100644
--- a/der/src/asn1/any.rs
+++ b/der/src/asn1/any.rs
@@ -112,14 +112,6 @@ impl<'a> Any<'a> {
pub fn utf8_string(self) -> Result<Utf8String<'a>> {
self.try_into()
}
-
- /// Get the ASN.1 DER [`Header`] for this [`An... | 9 | 74 | 143 |
9c14b8087749943a4f4a6212b828dc71ec45a363 | Tony Arcieri | 2021-03-21T16:30:19 | der: make Length use u32 internally (#349)
The current restriction of `Length` being at most 65535 is actually just
an artifact of its inability to decode/encode lengths which are greater
than that limit, rather than an explicit design decision.
It would still be good to maintain a maximum document length, but
i... | diff --git a/der/src/asn1/any.rs b/der/src/asn1/any.rs
index d7eeaeb..8237f4f 100644
--- a/der/src/asn1/any.rs
+++ b/der/src/asn1/any.rs
@@ -132,8 +132,9 @@ impl<'a> Decodable<'a> for Any<'a> {
fn decode(decoder: &mut Decoder<'a>) -> Result<Any<'a>> {
let header = Header::decode(decoder)?;
let ta... | 6 | 53 | 43 |
581c19ed1d2f4b1313358073e4fccb5d0d0ac6e6 | Tony Arcieri | 2021-03-21T15:45:13 | der: make sequence constructor private (#348)
It doesn't validate that the SEQUENCE is well-formed, so it should only
be used in contexts where that happens as a separate step | diff --git a/der/src/asn1/sequence.rs b/der/src/asn1/sequence.rs
index a1eddf7..d2b72f7 100644
--- a/der/src/asn1/sequence.rs
+++ b/der/src/asn1/sequence.rs
@@ -14,8 +14,7 @@ pub struct Sequence<'a> {
impl<'a> Sequence<'a> {
/// Create a new [`Sequence`] from a slice.
- // TODO(tarcieri): validate `slice` is... | 1 | 1 | 2 |
4a556441274053b621e10ddb3c85bd331f10d0ea | Tony Arcieri | 2021-03-21T15:38:43 | der: remove BigUIntSize (#347)
The same concept can be expressed as `Unsigned + NonZero` | diff --git a/der/src/asn1/big_uint.rs b/der/src/asn1/big_uint.rs
index 0894bd9..2f120cb 100644
--- a/der/src/asn1/big_uint.rs
+++ b/der/src/asn1/big_uint.rs
@@ -4,7 +4,7 @@ use crate::{
Any, ByteSlice, Encodable, Encoder, Error, ErrorKind, Header, Length, Result, Tag, Tagged,
};
use core::{convert::TryFrom, mark... | 3 | 29 | 59 |
8a1a41d35ec49dc08cad5f389f18105795a40f6b | Tony Arcieri | 2021-03-21T15:24:05 | der: add support for SET OF (#346)
Initial support for ASN.1 `SET OF`, adding the following:
- `SetOf` trait which can support multiple backing stores.
The longer term goal is to support e.g. `BTreeSet`
- `SetOfRef` which can decode `SET OF` from a byte slice
(`no_std`-friendly) | diff --git a/der/src/asn1.rs b/der/src/asn1.rs
index e3d70fe..5d713a2 100644
--- a/der/src/asn1.rs
+++ b/der/src/asn1.rs
@@ -18,5 +18,6 @@ pub(crate) mod oid;
pub(crate) mod optional;
pub(crate) mod printable_string;
pub(crate) mod sequence;
+pub(crate) mod set_of;
pub(crate) mod utc_time;
pub(crate) mod utf8_stri... | 5 | 203 | 7 |
b2df86dee305bdedf2835542ecfe80c21649b21d | Tony Arcieri | 2021-03-19T00:29:46 | der: impl Decode/Encoded/Tagged for String (#344)
Mapping to a `Utf8String` | diff --git a/der/src/asn1/utf8_string.rs b/der/src/asn1/utf8_string.rs
index 771e8ff..fd5958e 100644
--- a/der/src/asn1/utf8_string.rs
+++ b/der/src/asn1/utf8_string.rs
@@ -5,6 +5,9 @@ use crate::{
};
use core::{convert::TryFrom, fmt, str};
+#[cfg(feature = "alloc")]
+use alloc::{borrow::ToOwned, string::String};
+... | 2 | 33 | 2 |
3b1858002b8de464cc0dab9da939edaa7f0542bf | Tony Arcieri | 2021-03-18T22:33:18 | spki: remove AlgorithmParameters enum (#343)
Now that an `&'a ObjectIdentifier` can be converted to `Any<'a>`, there
is no longer a need for the workaround this enum provided and it can be
removed.
This better aligns the definition of `AlgorithmIdentifier` with the
ASN.1 schema. | diff --git a/der/src/asn1/any.rs b/der/src/asn1/any.rs
index ff860a9..d7eeaeb 100644
--- a/der/src/asn1/any.rs
+++ b/der/src/asn1/any.rs
@@ -17,8 +17,8 @@ use crate::ObjectIdentifier;
/// Classes in X.680 in 1994, and X.690 no longer refers to it whatsoever.
///
/// Nevertheless, this crate defines an [`Any`] type a... | 5 | 16 | 153 |
7b46523ad80580e00228cc57c56707b81ba81ecc | Tony Arcieri | 2021-03-18T18:59:49 | der: rename ErrorKind::Oid to ::MalformedOid (#342)
...to distinguish it from `UnknownOid` | diff --git a/der/src/error.rs b/der/src/error.rs
index 2581177..d3ab50d 100644
--- a/der/src/error.rs
+++ b/der/src/error.rs
@@ -92,7 +92,7 @@ impl From<Utf8Error> for Error {
#[cfg(feature = "oid")]
impl From<const_oid::Error> for Error {
fn from(_: const_oid::Error) -> Error {
- ErrorKind::Oid.into()
+ ... | 1 | 3 | 4 |
59e375a4a0185cfd236907f37c3981078b3acb73 | Tony Arcieri | 2021-03-18T18:45:32 | der: separate `sequence` and `message` (#341)
Closes #286
Adds a lower-level `SEQUENCE` API to `Encoder` which spawns a nested
encoder and passes it to a closure, similar to the corresponding
`Decoder` API.
Renames the previous "sequence"-related functionality which acts on a
slice of `Encodable` trait object... | diff --git a/der/src/asn1.rs b/der/src/asn1.rs
index 7fc58fe..e3d70fe 100644
--- a/der/src/asn1.rs
+++ b/der/src/asn1.rs
@@ -17,6 +17,6 @@ pub(crate) mod octet_string;
pub(crate) mod oid;
pub(crate) mod optional;
pub(crate) mod printable_string;
-pub mod sequence;
+pub(crate) mod sequence;
pub(crate) mod utc_time;
... | 8 | 76 | 73 |
093afeb376a4be488eaadbf11b68eeb6e32ccd08 | Tony Arcieri | 2021-03-18T16:33:49 | der: remove deprecated method (#340) | diff --git a/der/src/asn1/any.rs b/der/src/asn1/any.rs
index 5ba656e..ff860a9 100644
--- a/der/src/asn1/any.rs
+++ b/der/src/asn1/any.rs
@@ -77,12 +77,6 @@ impl<'a> Any<'a> {
self.try_into()
}
- /// Attempt to decode an ASN.1 `NULL` value.
- #[deprecated(since = "0.2.4", note = "Please use the `is... | 1 | 0 | 6 |
d310b6342ae5831d271087b084af95a7d53700c9 | Tony Arcieri | 2021-03-18T16:16:25 | der: name Decodable::from_bytes => Decodable::from_der (#339)
Use a more specific name to avoid potential conflicts with e.g. inherent
methods (which came up in practice with `ObjectIdentifier::from_der`) | diff --git a/der/src/asn1/any.rs b/der/src/asn1/any.rs
index 4f724fb..5ba656e 100644
--- a/der/src/asn1/any.rs
+++ b/der/src/asn1/any.rs
@@ -159,6 +159,6 @@ impl<'a> TryFrom<&'a [u8]> for Any<'a> {
type Error = Error;
fn try_from(bytes: &'a [u8]) -> Result<Any<'a>> {
- Any::from_bytes(bytes)
+ ... | 19 | 67 | 71 |
4330cc552c6b81cec9e4c79b6555ddea5f81b53f | Tony Arcieri | 2021-03-04T13:20:44 | const-oid: derive Hash and Ord (#323)
Allows keying map-like data structures using ObjectIdentifiers | diff --git a/const-oid/src/lib.rs b/const-oid/src/lib.rs
index 41324e7..4201b77 100644
--- a/const-oid/src/lib.rs
+++ b/const-oid/src/lib.rs
@@ -80,7 +80,7 @@ pub const MAX_LEN: usize = 23;
///
/// OIDs are hierarchical structures consisting of "arcs", i.e. integer
/// identifiers.
-#[derive(Copy, Clone, Eq, Partial... | 1 | 1 | 1 |
b34d9646907405185ac9e039f82f0a355cf7ac8f | Tony Arcieri | 2021-02-28T18:36:36 | der: make From<ObjectIdentifier> conversion for Any infallible (#319)
The `ObjectIdentifier` type has a small maximum length when serialized
as BER/DER, presently defined as `const_oid::MAX_LENGTH`.
This means that unless this were raised significantly such that it were
larger than `der::Length::max()`, infallibl... | diff --git a/der/src/asn1/oid.rs b/der/src/asn1/oid.rs
index 3504852..525be2c 100644
--- a/der/src/asn1/oid.rs
+++ b/der/src/asn1/oid.rs
@@ -12,24 +12,31 @@ impl TryFrom<Any<'_>> for ObjectIdentifier {
}
}
-impl<'a> TryFrom<&'a ObjectIdentifier> for Any<'a> {
- type Error = Error;
+impl<'a> From<&'a ObjectId... | 1 | 22 | 9 |
b6a10496d904bf6f6095a35080b5cd6feb8e822e | Tony Arcieri | 2021-02-28T17:18:08 | const-oid: change internal repr to BER/DER w\ const encoder (#317)
This commit changes the internal representation of `ObjectIdentifier` to
be the BER/DER encoding, rather than the root OID byte plus an array of
decoded arc values (i.e. u32).
The `Arcs` iterator is likewise changed to decode the BER/DER
represen... | diff --git a/const-oid/src/arcs.rs b/const-oid/src/arcs.rs
new file mode 100644
index 0000000..3df0d93
--- /dev/null
+++ b/const-oid/src/arcs.rs
@@ -0,0 +1,126 @@
+//! Arcs are integer values which exist within an OID's hierarchy.
+
+use crate::{Error, ObjectIdentifier, Result};
+use core::convert::TryFrom;
+
+/// Type... | 8 | 482 | 469 |
6a7d957c125b951753b2d425dba67105e88cc15a | Tony Arcieri | 2021-02-27T14:45:13 | const-oid: extract `macros` module (#316)
Avoids duplication of the `const_assert!` macro | diff --git a/const-oid/src/lib.rs b/const-oid/src/lib.rs
index 356b259..879fa23 100644
--- a/const-oid/src/lib.rs
+++ b/const-oid/src/lib.rs
@@ -52,6 +52,9 @@ extern crate alloc;
#[cfg(feature = "std")]
extern crate std;
+#[macro_use]
+mod macros;
+
mod error;
mod parser;
@@ -110,15 +113,6 @@ pub struct ObjectI... | 3 | 15 | 18 |
47b80c33dd1d83d02426152f681ab2c3acd7e40e | Artyom Pavlov | 2021-02-26T12:35:56 | block-buffer: add LazyBlockBuffer and DigestBuffer trait (#249) | diff --git a/block-buffer/src/buffer.rs b/block-buffer/src/buffer.rs
new file mode 100644
index 0000000..0d0bf96
--- /dev/null
+++ b/block-buffer/src/buffer.rs
@@ -0,0 +1,248 @@
+#[cfg(feature = "block-padding")]
+use block_padding::Padding;
+
+use crate::{
+ utils::{to_blocks, to_blocks_mut},
+ Block, DigestBuff... | 4 | 409 | 305 |
def9a205bba6bee7f414598324613e69c85c0c63 | Tony Arcieri | 2021-02-24T19:09:09 | pkcs5: use const `ObjectIdentifier::parse` (#314)
Uses the new const-friendly OID string parser for all OID literals. | diff --git a/der/Cargo.toml b/der/Cargo.toml
index 9c6212c..bb0a6be 100644
--- a/der/Cargo.toml
+++ b/der/Cargo.toml
@@ -15,7 +15,7 @@ keywords = ["asn1", "crypto", "itu", "pkcs"]
readme = "README.md"
[dependencies]
-const-oid = { version = "0.4", optional = true, path = "../const-oid" }
+const-oid = { version = "0... | 4 | 14 | 17 |
0e636a034eb81f40d82932bfd50e9f57aacd9d9f | Tony Arcieri | 2021-02-24T18:47:09 | const-oid: const-friendly string parser (#312)
Adds a new `ObjectIdentifier::parse` function which is declared
`const fn` and capable of parsing OIDs from dot-delimited strings
in const contexts.
This is much more readable/ideal than the current approach used by
`ObjectIdentifier::new`, which accepts a slice of ... | diff --git a/const-oid/src/error.rs b/const-oid/src/error.rs
new file mode 100644
index 0000000..7106dbc
--- /dev/null
+++ b/const-oid/src/error.rs
@@ -0,0 +1,19 @@
+//! Error types
+
+use core::fmt;
+
+/// Error type
+#[derive(Copy, Clone, Debug, Eq, PartialEq)]
+pub struct Error;
+
+impl fmt::Display for Error {
+ ... | 4 | 279 | 53 |
9abcb0265a225813156f91d17088e0ab78f10938 | Tony Arcieri | 2021-02-24T15:55:17 | der: add support for `IA5String` (#310) | diff --git a/der/src/asn1.rs b/der/src/asn1.rs
index f7fb0a1..7fc58fe 100644
--- a/der/src/asn1.rs
+++ b/der/src/asn1.rs
@@ -9,6 +9,7 @@ pub(crate) mod bit_string;
pub(crate) mod boolean;
pub(crate) mod choice;
pub(crate) mod generalized_time;
+pub(crate) mod ia5_string;
pub(crate) mod integer;
pub(crate) mod null... | 11 | 197 | 12 |
bfcd78c4a3d8d6969d38d1a38b2cf42d33cdf739 | Tony Arcieri | 2021-02-24T14:35:44 | pkcs8: add encryption helpers to FromPrivateKey/ToPrivateKey (#308)
Adds the following methods for performing encryption/decryption to the
traits defined in the `pkcs8` crate:
- `FromPrivateKey::from_pkcs8_encrypted_der`
- `FromPrivateKey::from_pkcs8_encrypted_pem`
- `ToPrivateKey::to_pkcs8_encrypted_der`
- `To... | diff --git a/pkcs8/src/private_key_info/encrypted.rs b/pkcs8/src/encrypted_private_key_info.rs
similarity index 100%
rename from pkcs8/src/private_key_info/encrypted.rs
rename to pkcs8/src/encrypted_private_key_info.rs
diff --git a/pkcs8/src/lib.rs b/pkcs8/src/lib.rs
index b82f18c..acf6724 100644
--- a/pkcs8/src/lib.rs... | 4 | 94 | 36 |
b7a10f0daf4e3d3e6f8ec2eead122c04c49fa4bd | Tony Arcieri | 2021-02-23T20:53:19 | pkcs8: remove obsolete docs (#306) | diff --git a/pkcs8/src/private_key_info/encrypted.rs b/pkcs8/src/private_key_info/encrypted.rs
index fe855db..051d0a1 100644
--- a/pkcs8/src/private_key_info/encrypted.rs
+++ b/pkcs8/src/private_key_info/encrypted.rs
@@ -19,16 +19,6 @@ use {crate::pem, zeroize::Zeroizing};
/// ASN.1 structure containing a PKCS#5 [`Enc... | 1 | 0 | 10 |
1a39ed5e2dd90db468ed52c5291b5a7be32c501d | Tony Arcieri | 2021-02-23T20:01:46 | pkcs8: add Error::Crypto variant (#305)
The `Error` enum is `non_exhaustive` so this is non-breaking | diff --git a/pkcs8/src/document/private_key.rs b/pkcs8/src/document/private_key.rs
index 2b3f5cd..7e87a81 100644
--- a/pkcs8/src/document/private_key.rs
+++ b/pkcs8/src/document/private_key.rs
@@ -112,7 +112,7 @@ impl PrivateKeyDocument {
let pbkdf2_iterations = 10_000;
let pbes2_params =
... | 3 | 6 | 2 |
80194eacd0589c7033cfc1fc7dce8aef34566521 | Tony Arcieri | 2021-02-22T22:19:04 | der_derive: add choice::Alternative and duplicate tracking (#300)
Adds a `choice::Alternative` struct which includes information about how
alternatives of an ASN.1 `CHOICE` map to Rust enum variants.
Uses this information to detect when duplicate ASN.1 types are specified
for different variants, and panics in thi... | diff --git a/der/derive/src/choice.rs b/der/derive/src/choice.rs
index d0fde0a..e5cac7b 100644
--- a/der/derive/src/choice.rs
+++ b/der/derive/src/choice.rs
@@ -5,21 +5,27 @@
use crate::{Asn1Attrs, Asn1Type};
use proc_macro2::TokenStream;
use quote::{quote, ToTokens};
-use syn::{DataEnum, Lifetime};
+use syn::{DataE... | 2 | 42 | 6 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.