From 1779c4be4b486c2877c6c64856dc3bc8ae93a057 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D1=80=D1=82=D1=91=D0=BC=20=D0=9F=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=BE=D0=B2?= Date: Wed, 7 Sep 2022 14:35:44 +0300 Subject: [PATCH 01/12] Add implementations of the AssociatedOid trait --- Cargo.lock | 17 +++++++++-------- digest/CHANGELOG.md | 7 +++++++ digest/Cargo.toml | 3 +++ digest/src/core_api/ct_variable.rs | 15 +++++++++++++++ digest/src/core_api/rt_variable.rs | 13 +++++++++++++ digest/src/core_api/wrapper.rs | 13 +++++++++++++ 6 files changed, 60 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 77f459530..8b503f8a6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -50,9 +50,9 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "0.7.18" +version = "0.7.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" +checksum = "b4f55bd91a0978cbfd91c457a164bab8b4001c833b7f323132c0a4e1922dd44e" dependencies = [ "memchr", ] @@ -168,9 +168,9 @@ dependencies = [ [[package]] name = "block-buffer" -version = "0.10.2" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bf7fe51849ea569fd452f37822f606a5cabb684dc918707a0193fd4664ff324" +checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e" dependencies = [ "generic-array", ] @@ -282,9 +282,9 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc948ebb96241bb40ab73effeb80d9f93afaad49359d159a5e61be51619fe813" +checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320" dependencies = [ "libc", ] @@ -425,7 +425,8 @@ name = "digest" version = "0.10.3" dependencies = [ "blobby", - "block-buffer 0.10.2", + "block-buffer 0.10.3", + "const-oid 0.9.0", "crypto-common 0.1.6", "subtle", ] @@ -436,7 +437,7 @@ version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2fb860ca6fafa5552fb6d0e816a69c8e49f0908bf524e30a90d97c85892d506" dependencies = [ - "block-buffer 0.10.2", + "block-buffer 0.10.3", "crypto-common 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "subtle", ] diff --git a/digest/CHANGELOG.md b/digest/CHANGELOG.md index c9f52c64e..419af14e6 100644 --- a/digest/CHANGELOG.md +++ b/digest/CHANGELOG.md @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## UNRELEASED +### Added +- Feature-gated implementation of the `const_oid::AssociatedOid` trait +for the core wrappers. ([#1098]) + +[#1098]: https://github.com/RustCrypto/traits/pull/1098 + ## 0.10.3 (2022-02-16) ### Fixed - Minimal versions build ([#940]) diff --git a/digest/Cargo.toml b/digest/Cargo.toml index 94ff540e3..9f75ad3f7 100644 --- a/digest/Cargo.toml +++ b/digest/Cargo.toml @@ -18,6 +18,9 @@ crypto-common = { version = "0.1.3", path = "../crypto-common" } block-buffer = { version = "0.10", optional = true } subtle = { version = "=2.4", default-features = false, optional = true } blobby = { version = "0.3", optional = true } +# Enable implementation of the `AssociatedOid` trait for the core wrappers. +# Enabling this feature bumps MSRV to 1.57. +const-oid = { version = "0.9", optional = true } [features] default = ["core-api"] diff --git a/digest/src/core_api/ct_variable.rs b/digest/src/core_api/ct_variable.rs index 40efff65c..d9189c63f 100644 --- a/digest/src/core_api/ct_variable.rs +++ b/digest/src/core_api/ct_variable.rs @@ -5,6 +5,8 @@ use super::{ use crate::HashMarker; #[cfg(feature = "mac")] use crate::MacMarker; +#[cfg(feature = "const-oid")] +use const_oid::{AssociatedOid, ObjectIdentifier}; use core::{fmt, marker::PhantomData}; use crypto_common::{ generic_array::{ArrayLength, GenericArray}, @@ -165,3 +167,16 @@ where write!(f, "{}", OutSize::USIZE) } } + +#[cfg(feature = "const-oid")] +#[cfg_attr(docsrs, doc(cfg(feature = "const-oid")))] +impl AssociatedOid for CtVariableCoreWrapper +where + T: VariableOutputCore + AssociatedOid, + OutSize: ArrayLength + IsLessOrEqual, + LeEq: NonZero, + T::BlockSize: IsLess, + Le: NonZero, +{ + const OID: ObjectIdentifier = T::OID; +} diff --git a/digest/src/core_api/rt_variable.rs b/digest/src/core_api/rt_variable.rs index 3dae748f5..08b3fd71f 100644 --- a/digest/src/core_api/rt_variable.rs +++ b/digest/src/core_api/rt_variable.rs @@ -4,6 +4,8 @@ use crate::MacMarker; use crate::{HashMarker, InvalidBufferSize}; use crate::{InvalidOutputSize, Reset, Update, VariableOutput, VariableOutputReset}; use block_buffer::BlockBuffer; +#[cfg(feature = "const-oid")] +use const_oid::{AssociatedOid, ObjectIdentifier}; use core::fmt; use crypto_common::typenum::{IsLess, Le, NonZero, Unsigned, U256}; @@ -145,6 +147,17 @@ where } } +#[cfg(feature = "const-oid")] +#[cfg_attr(docsrs, doc(cfg(feature = "const-oid")))] +impl AssociatedOid for RtVariableCoreWrapper +where + T: VariableOutputCore + UpdateCore + AssociatedOid, + T::BlockSize: IsLess, + Le: NonZero, +{ + const OID: ObjectIdentifier = T::OID; +} + #[cfg(feature = "std")] #[cfg_attr(docsrs, doc(cfg(feature = "std")))] impl std::io::Write for RtVariableCoreWrapper diff --git a/digest/src/core_api/wrapper.rs b/digest/src/core_api/wrapper.rs index 4ad0f7eea..7a95983b4 100644 --- a/digest/src/core_api/wrapper.rs +++ b/digest/src/core_api/wrapper.rs @@ -14,6 +14,8 @@ use crypto_common::{ #[cfg(feature = "mac")] use crate::MacMarker; +#[cfg(feature = "const-oid")] +use const_oid::{AssociatedOid, ObjectIdentifier}; /// Wrapper around [`BufferKindUser`]. /// @@ -227,6 +229,17 @@ where } } +#[cfg(feature = "const-oid")] +#[cfg_attr(docsrs, doc(cfg(feature = "const-oid")))] +impl AssociatedOid for CoreWrapper +where + T: BufferKindUser + AssociatedOid, + T::BlockSize: IsLess, + Le: NonZero, +{ + const OID: ObjectIdentifier = T::OID; +} + #[cfg(feature = "std")] #[cfg_attr(docsrs, doc(cfg(feature = "std")))] impl std::io::Write for CoreWrapper From b7debee5f0f894c539c59c63df0b5b324145f38d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D1=80=D1=82=D1=91=D0=BC=20=D0=9F=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=BE=D0=B2?= Date: Wed, 7 Sep 2022 14:48:21 +0300 Subject: [PATCH 02/12] re-export const-oid --- digest/src/lib.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/digest/src/lib.rs b/digest/src/lib.rs index c2edb40ee..3882a0c5d 100644 --- a/digest/src/lib.rs +++ b/digest/src/lib.rs @@ -60,6 +60,9 @@ mod mac; #[cfg(feature = "core-api")] #[cfg_attr(docsrs, doc(cfg(feature = "core-api")))] pub use block_buffer; +#[cfg(feature = "const-oid")] +#[cfg_attr(docsrs, doc(cfg(feature = "const-oid")))] +pub use const_oid; pub use crypto_common; pub use crate::digest::{Digest, DynDigest, HashMarker}; From b3fb73036a42f64612ae5d51cb9d819fd6237ac8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D1=80=D1=82=D1=91=D0=BC=20=D0=9F=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=BE=D0=B2?= Date: Fri, 9 Sep 2022 13:31:36 +0300 Subject: [PATCH 03/12] Introduce OID marker for CtVariableCoreWrapper --- digest/Cargo.toml | 1 + digest/src/core_api/ct_variable.rs | 57 ++++++++++++++++++++---------- digest/src/core_api/rt_variable.rs | 13 ------- digest/src/core_api/wrapper.rs | 6 ++-- digest/src/lib.rs | 4 +-- 5 files changed, 45 insertions(+), 36 deletions(-) diff --git a/digest/Cargo.toml b/digest/Cargo.toml index 9f75ad3f7..8032b1d93 100644 --- a/digest/Cargo.toml +++ b/digest/Cargo.toml @@ -27,6 +27,7 @@ default = ["core-api"] core-api = ["block-buffer"] # Enable Core API traits mac = ["subtle"] # Enable MAC traits rand_core = ["crypto-common/rand_core"] # Enable random key generation methods +oid = ["const-oid"] # OID support alloc = [] std = ["alloc", "crypto-common/std"] dev = ["blobby"] diff --git a/digest/src/core_api/ct_variable.rs b/digest/src/core_api/ct_variable.rs index d9189c63f..b5b051d65 100644 --- a/digest/src/core_api/ct_variable.rs +++ b/digest/src/core_api/ct_variable.rs @@ -5,7 +5,7 @@ use super::{ use crate::HashMarker; #[cfg(feature = "mac")] use crate::MacMarker; -#[cfg(feature = "const-oid")] +#[cfg(feature = "oid")] use const_oid::{AssociatedOid, ObjectIdentifier}; use core::{fmt, marker::PhantomData}; use crypto_common::{ @@ -14,10 +14,14 @@ use crypto_common::{ Block, BlockSizeUser, OutputSizeUser, }; +/// Dummy type used with [`CtVariableCoreWrapper`] in cases when +/// resulting hash does not have a known OID. +pub struct NoOid; + /// Wrapper around [`VariableOutputCore`] which selects output size /// at compile time. #[derive(Clone)] -pub struct CtVariableCoreWrapper +pub struct CtVariableCoreWrapper where T: VariableOutputCore, OutSize: ArrayLength + IsLessOrEqual, @@ -26,10 +30,10 @@ where Le: NonZero, { inner: T, - _out: PhantomData, + _out: PhantomData<(OutSize, O)>, } -impl HashMarker for CtVariableCoreWrapper +impl HashMarker for CtVariableCoreWrapper where T: VariableOutputCore + HashMarker, OutSize: ArrayLength + IsLessOrEqual, @@ -40,7 +44,7 @@ where } #[cfg(feature = "mac")] -impl MacMarker for CtVariableCoreWrapper +impl MacMarker for CtVariableCoreWrapper where T: VariableOutputCore + MacMarker, OutSize: ArrayLength + IsLessOrEqual, @@ -50,7 +54,7 @@ where { } -impl BlockSizeUser for CtVariableCoreWrapper +impl BlockSizeUser for CtVariableCoreWrapper where T: VariableOutputCore, OutSize: ArrayLength + IsLessOrEqual, @@ -61,7 +65,7 @@ where type BlockSize = T::BlockSize; } -impl UpdateCore for CtVariableCoreWrapper +impl UpdateCore for CtVariableCoreWrapper where T: VariableOutputCore, OutSize: ArrayLength + IsLessOrEqual, @@ -75,7 +79,7 @@ where } } -impl OutputSizeUser for CtVariableCoreWrapper +impl OutputSizeUser for CtVariableCoreWrapper where T: VariableOutputCore, OutSize: ArrayLength + IsLessOrEqual + 'static, @@ -86,7 +90,7 @@ where type OutputSize = OutSize; } -impl BufferKindUser for CtVariableCoreWrapper +impl BufferKindUser for CtVariableCoreWrapper where T: VariableOutputCore, OutSize: ArrayLength + IsLessOrEqual, @@ -97,7 +101,7 @@ where type BufferKind = T::BufferKind; } -impl FixedOutputCore for CtVariableCoreWrapper +impl FixedOutputCore for CtVariableCoreWrapper where T: VariableOutputCore, OutSize: ArrayLength + IsLessOrEqual + 'static, @@ -122,7 +126,7 @@ where } } -impl Default for CtVariableCoreWrapper +impl Default for CtVariableCoreWrapper where T: VariableOutputCore, OutSize: ArrayLength + IsLessOrEqual, @@ -139,7 +143,7 @@ where } } -impl Reset for CtVariableCoreWrapper +impl Reset for CtVariableCoreWrapper where T: VariableOutputCore, OutSize: ArrayLength + IsLessOrEqual, @@ -153,7 +157,7 @@ where } } -impl AlgorithmName for CtVariableCoreWrapper +impl AlgorithmName for CtVariableCoreWrapper where T: VariableOutputCore + AlgorithmName, OutSize: ArrayLength + IsLessOrEqual, @@ -168,15 +172,32 @@ where } } -#[cfg(feature = "const-oid")] -#[cfg_attr(docsrs, doc(cfg(feature = "const-oid")))] -impl AssociatedOid for CtVariableCoreWrapper +#[cfg(feature = "oid")] +#[cfg_attr(docsrs, doc(cfg(feature = "oid")))] +impl AssociatedOid for CtVariableCoreWrapper where - T: VariableOutputCore + AssociatedOid, + T: VariableOutputCore, + O: AssociatedOid, OutSize: ArrayLength + IsLessOrEqual, LeEq: NonZero, T::BlockSize: IsLess, Le: NonZero, { - const OID: ObjectIdentifier = T::OID; + const OID: ObjectIdentifier = O::OID; +} + +/// Implement dummy type with hidden docs which is used to "carry" hasher +/// OID for [`CtVariableCoreWrapper`]. +#[cfg(feature = "oid")] +#[cfg_attr(docsrs, doc(cfg(feature = "oid")))] +#[macro_export] +macro_rules! impl_oid_carrier { + ($name:ident, $oid:literal) => { + #[doc(hidden)] + struct $name; + + impl AssociatedOid for $name { + const OID: ObjectIdentifier = ObjectIdentifier::new_unwrap($oid); + } + }; } diff --git a/digest/src/core_api/rt_variable.rs b/digest/src/core_api/rt_variable.rs index 08b3fd71f..3dae748f5 100644 --- a/digest/src/core_api/rt_variable.rs +++ b/digest/src/core_api/rt_variable.rs @@ -4,8 +4,6 @@ use crate::MacMarker; use crate::{HashMarker, InvalidBufferSize}; use crate::{InvalidOutputSize, Reset, Update, VariableOutput, VariableOutputReset}; use block_buffer::BlockBuffer; -#[cfg(feature = "const-oid")] -use const_oid::{AssociatedOid, ObjectIdentifier}; use core::fmt; use crypto_common::typenum::{IsLess, Le, NonZero, Unsigned, U256}; @@ -147,17 +145,6 @@ where } } -#[cfg(feature = "const-oid")] -#[cfg_attr(docsrs, doc(cfg(feature = "const-oid")))] -impl AssociatedOid for RtVariableCoreWrapper -where - T: VariableOutputCore + UpdateCore + AssociatedOid, - T::BlockSize: IsLess, - Le: NonZero, -{ - const OID: ObjectIdentifier = T::OID; -} - #[cfg(feature = "std")] #[cfg_attr(docsrs, doc(cfg(feature = "std")))] impl std::io::Write for RtVariableCoreWrapper diff --git a/digest/src/core_api/wrapper.rs b/digest/src/core_api/wrapper.rs index 7a95983b4..ca977381e 100644 --- a/digest/src/core_api/wrapper.rs +++ b/digest/src/core_api/wrapper.rs @@ -14,7 +14,7 @@ use crypto_common::{ #[cfg(feature = "mac")] use crate::MacMarker; -#[cfg(feature = "const-oid")] +#[cfg(feature = "oid")] use const_oid::{AssociatedOid, ObjectIdentifier}; /// Wrapper around [`BufferKindUser`]. @@ -229,8 +229,8 @@ where } } -#[cfg(feature = "const-oid")] -#[cfg_attr(docsrs, doc(cfg(feature = "const-oid")))] +#[cfg(feature = "oid")] +#[cfg_attr(docsrs, doc(cfg(feature = "oid")))] impl AssociatedOid for CoreWrapper where T: BufferKindUser + AssociatedOid, diff --git a/digest/src/lib.rs b/digest/src/lib.rs index 3882a0c5d..3bceca671 100644 --- a/digest/src/lib.rs +++ b/digest/src/lib.rs @@ -60,8 +60,8 @@ mod mac; #[cfg(feature = "core-api")] #[cfg_attr(docsrs, doc(cfg(feature = "core-api")))] pub use block_buffer; -#[cfg(feature = "const-oid")] -#[cfg_attr(docsrs, doc(cfg(feature = "const-oid")))] +#[cfg(feature = "oid")] +#[cfg_attr(docsrs, doc(cfg(feature = "oid")))] pub use const_oid; pub use crypto_common; From 626edc52d844673875e0e23fa756ac4d962a91ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D1=80=D1=82=D1=91=D0=BC=20=D0=9F=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=BE=D0=B2?= Date: Fri, 9 Sep 2022 13:36:04 +0300 Subject: [PATCH 04/12] Make generated OID carrier public --- digest/src/core_api/ct_variable.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/digest/src/core_api/ct_variable.rs b/digest/src/core_api/ct_variable.rs index b5b051d65..03addb092 100644 --- a/digest/src/core_api/ct_variable.rs +++ b/digest/src/core_api/ct_variable.rs @@ -194,7 +194,7 @@ where macro_rules! impl_oid_carrier { ($name:ident, $oid:literal) => { #[doc(hidden)] - struct $name; + pub struct $name; impl AssociatedOid for $name { const OID: ObjectIdentifier = ObjectIdentifier::new_unwrap($oid); From f628a516ee268f2da74d4fa9df40f4f280650154 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D1=80=D1=82=D1=91=D0=BC=20=D0=9F=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=BE=D0=B2?= Date: Fri, 9 Sep 2022 13:41:46 +0300 Subject: [PATCH 05/12] Derive common traits on OID carrier --- digest/src/core_api/ct_variable.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/digest/src/core_api/ct_variable.rs b/digest/src/core_api/ct_variable.rs index 03addb092..8aff07702 100644 --- a/digest/src/core_api/ct_variable.rs +++ b/digest/src/core_api/ct_variable.rs @@ -16,6 +16,7 @@ use crypto_common::{ /// Dummy type used with [`CtVariableCoreWrapper`] in cases when /// resulting hash does not have a known OID. +#[derive(Copy, Clone, Debug, Eq, PartialEq, Hash)] pub struct NoOid; /// Wrapper around [`VariableOutputCore`] which selects output size @@ -194,6 +195,7 @@ where macro_rules! impl_oid_carrier { ($name:ident, $oid:literal) => { #[doc(hidden)] + #[derive(Copy, Clone, Debug, Eq, PartialEq, Hash)] pub struct $name; impl AssociatedOid for $name { From 9ab1fbfa1953637587650c50d241c0c02310a313 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D1=80=D1=82=D1=91=D0=BC=20=D0=9F=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=BE=D0=B2?= Date: Fri, 9 Sep 2022 13:48:54 +0300 Subject: [PATCH 06/12] Ungate impl_oid_carrier --- digest/src/core_api/ct_variable.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/digest/src/core_api/ct_variable.rs b/digest/src/core_api/ct_variable.rs index 8aff07702..7ee1bed0a 100644 --- a/digest/src/core_api/ct_variable.rs +++ b/digest/src/core_api/ct_variable.rs @@ -189,8 +189,6 @@ where /// Implement dummy type with hidden docs which is used to "carry" hasher /// OID for [`CtVariableCoreWrapper`]. -#[cfg(feature = "oid")] -#[cfg_attr(docsrs, doc(cfg(feature = "oid")))] #[macro_export] macro_rules! impl_oid_carrier { ($name:ident, $oid:literal) => { @@ -198,6 +196,7 @@ macro_rules! impl_oid_carrier { #[derive(Copy, Clone, Debug, Eq, PartialEq, Hash)] pub struct $name; + #[cfg(feature = "oid")] impl AssociatedOid for $name { const OID: ObjectIdentifier = ObjectIdentifier::new_unwrap($oid); } From 2198fedaa0584c5fdafbe11273248f395089363d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D1=80=D1=82=D1=91=D0=BC=20=D0=9F=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=BE=D0=B2?= Date: Fri, 9 Sep 2022 13:57:45 +0300 Subject: [PATCH 07/12] Disable --all-features test --- .github/workflows/digest.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/digest.yml b/.github/workflows/digest.yml index 585de6cb7..3fefa5eda 100644 --- a/.github/workflows/digest.yml +++ b/.github/workflows/digest.yml @@ -68,4 +68,5 @@ jobs: - run: cargo test --features dev - run: cargo test --features alloc - run: cargo test --features std - - run: cargo test --all-features + # the `oid` feature bumps MSRV to 1.57 + # - run: cargo test --all-features From b8441dc48bf1b69cf3edf22073fea1d6949ace58 Mon Sep 17 00:00:00 2001 From: Artyom Pavlov Date: Fri, 9 Sep 2022 12:51:11 +0000 Subject: [PATCH 08/12] Update CI --- .github/workflows/digest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/digest.yml b/.github/workflows/digest.yml index 3fefa5eda..a384f0862 100644 --- a/.github/workflows/digest.yml +++ b/.github/workflows/digest.yml @@ -62,7 +62,7 @@ jobs: profile: minimal # Isolate this crate from workspace which is otherwise MSRV 1.56 due to 2021 edition crates - run: rm ../Cargo.toml - - run: cargo check --all-features + # - run: cargo check --all-features - run: cargo test --no-default-features - run: cargo test - run: cargo test --features dev From a9159a192be2b2983dea8adbbd7e4c51c597df35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D1=80=D1=82=D1=91=D0=BC=20=D0=9F=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=BE=D0=B2=20=5BArtyom=20Pavlov=5D?= Date: Fri, 16 Sep 2022 03:35:00 +0300 Subject: [PATCH 09/12] Add MSRV warning in oid feature description --- digest/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/digest/Cargo.toml b/digest/Cargo.toml index 8032b1d93..228fb3215 100644 --- a/digest/Cargo.toml +++ b/digest/Cargo.toml @@ -27,7 +27,7 @@ default = ["core-api"] core-api = ["block-buffer"] # Enable Core API traits mac = ["subtle"] # Enable MAC traits rand_core = ["crypto-common/rand_core"] # Enable random key generation methods -oid = ["const-oid"] # OID support +oid = ["const-oid"] # OID support. WARNING: Bumps MSRV to 1.57 alloc = [] std = ["alloc", "crypto-common/std"] dev = ["blobby"] From 46948c0877f2e67223cbb35c7031cfcd7670b78b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D1=80=D1=82=D1=91=D0=BC=20=D0=9F=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=BE=D0=B2=20=5BArtyom=20Pavlov=5D?= Date: Fri, 16 Sep 2022 03:35:13 +0300 Subject: [PATCH 10/12] Fix CI job --- .github/workflows/digest.yml | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/.github/workflows/digest.yml b/.github/workflows/digest.yml index a384f0862..51ee473b8 100644 --- a/.github/workflows/digest.yml +++ b/.github/workflows/digest.yml @@ -50,8 +50,31 @@ jobs: strategy: matrix: rust: - - 1.41.0 # MSRV + # - 1.41.0 # MSRV - stable + steps: + - uses: actions/checkout@v2 + - uses: RustCrypto/actions/cargo-cache@master + - uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ matrix.rust }} + override: true + profile: minimal + - run: cargo check --all-features + - run: cargo test --no-default-features + - run: cargo test + - run: cargo test --features dev + - run: cargo test --features alloc + - run: cargo test --features std + - run: cargo test --all-features + + # The `oid` feature bumps MSRV to 1.57, so we temporarily split this job. + test-msrv: + runs-on: ubuntu-latest + strategy: + matrix: + rust: + - 1.41.0 # MSRV steps: - uses: actions/checkout@v2 - uses: RustCrypto/actions/cargo-cache@master @@ -62,11 +85,8 @@ jobs: profile: minimal # Isolate this crate from workspace which is otherwise MSRV 1.56 due to 2021 edition crates - run: rm ../Cargo.toml - # - run: cargo check --all-features - run: cargo test --no-default-features - run: cargo test - run: cargo test --features dev - run: cargo test --features alloc - run: cargo test --features std - # the `oid` feature bumps MSRV to 1.57 - # - run: cargo test --all-features From 14add171c75a7da603530e22d088401eb5dc4433 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D1=80=D1=82=D1=91=D0=BC=20=D0=9F=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=BE=D0=B2=20=5BArtyom=20Pavlov=5D?= Date: Fri, 16 Sep 2022 03:39:19 +0300 Subject: [PATCH 11/12] Bump version to v0.10.4 --- Cargo.lock | 28 ++++++++++++++-------------- digest/CHANGELOG.md | 2 +- digest/Cargo.toml | 2 +- digest/src/lib.rs | 3 +-- 4 files changed, 17 insertions(+), 18 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8b503f8a6..c3c02c529 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -308,7 +308,7 @@ dependencies = [ "aead 0.5.1", "cipher 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", "crypto-common 0.1.6", - "digest 0.10.3 (registry+https://github.com/rust-lang/crates.io-index)", + "digest 0.10.3", "elliptic-curve 0.12.3", "password-hash", "signature 1.6.0", @@ -423,22 +423,22 @@ dependencies = [ [[package]] name = "digest" version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2fb860ca6fafa5552fb6d0e816a69c8e49f0908bf524e30a90d97c85892d506" dependencies = [ - "blobby", "block-buffer 0.10.3", - "const-oid 0.9.0", - "crypto-common 0.1.6", + "crypto-common 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "subtle", ] [[package]] name = "digest" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2fb860ca6fafa5552fb6d0e816a69c8e49f0908bf524e30a90d97c85892d506" +version = "0.10.4" dependencies = [ + "blobby", "block-buffer 0.10.3", - "crypto-common 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "const-oid 0.9.0", + "crypto-common 0.1.6", "subtle", ] @@ -484,7 +484,7 @@ dependencies = [ "base64ct", "crypto-bigint 0.4.8", "der 0.6.0", - "digest 0.10.3 (registry+https://github.com/rust-lang/crates.io-index)", + "digest 0.10.3", "ff 0.12.0", "generic-array", "group 0.12.0", @@ -661,7 +661,7 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" dependencies = [ - "digest 0.10.3 (registry+https://github.com/rust-lang/crates.io-index)", + "digest 0.10.3", ] [[package]] @@ -673,7 +673,7 @@ dependencies = [ "aes-gcm", "byteorder", "chacha20poly1305", - "digest 0.10.3 (registry+https://github.com/rust-lang/crates.io-index)", + "digest 0.10.3", "generic-array", "hkdf 0.12.3", "hmac 0.12.1", @@ -1144,7 +1144,7 @@ checksum = "cf9db03534dff993187064c4e0c05a5708d2a9728ace9a8959b77bedf415dac5" dependencies = [ "cfg-if", "cpufeatures", - "digest 0.10.3 (registry+https://github.com/rust-lang/crates.io-index)", + "digest 0.10.3", ] [[package]] @@ -1153,7 +1153,7 @@ version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eaedf34ed289ea47c2b741bb72e5357a209512d67bcd4bda44359e5bf0470f56" dependencies = [ - "digest 0.10.3 (registry+https://github.com/rust-lang/crates.io-index)", + "digest 0.10.3", "keccak", ] @@ -1171,7 +1171,7 @@ dependencies = [ name = "signature" version = "1.6.0" dependencies = [ - "digest 0.10.3 (registry+https://github.com/rust-lang/crates.io-index)", + "digest 0.10.3", "hex-literal", "rand_core 0.6.3", "sha2 0.10.5", diff --git a/digest/CHANGELOG.md b/digest/CHANGELOG.md index 419af14e6..2553f5e74 100644 --- a/digest/CHANGELOG.md +++ b/digest/CHANGELOG.md @@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## UNRELEASED +## 0.10.4 (2022-09-16) ### Added - Feature-gated implementation of the `const_oid::AssociatedOid` trait for the core wrappers. ([#1098]) diff --git a/digest/Cargo.toml b/digest/Cargo.toml index 228fb3215..737f03e65 100644 --- a/digest/Cargo.toml +++ b/digest/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "digest" description = "Traits for cryptographic hash functions" -version = "0.10.3" # Also update html_root_url in lib.rs when bumping this +version = "0.10.4" authors = ["RustCrypto Developers"] license = "MIT OR Apache-2.0" readme = "README.md" diff --git a/digest/src/lib.rs b/digest/src/lib.rs index 3bceca671..fc82e2e3a 100644 --- a/digest/src/lib.rs +++ b/digest/src/lib.rs @@ -27,8 +27,7 @@ #![forbid(unsafe_code)] #![doc( html_logo_url = "https://raw.githubusercontent.com/RustCrypto/media/6ee8e381/logo.svg", - html_favicon_url = "https://raw.githubusercontent.com/RustCrypto/media/6ee8e381/logo.svg", - html_root_url = "https://docs.rs/digest/0.10.3" + html_favicon_url = "https://raw.githubusercontent.com/RustCrypto/media/6ee8e381/logo.svg" )] #![warn(missing_docs, rust_2018_idioms)] From 8889c4c419753a5f94799f2d78cf589438dc4960 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D1=80=D1=82=D1=91=D0=BC=20=D0=9F=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=BE=D0=B2=20=5BArtyom=20Pavlov=5D?= Date: Fri, 16 Sep 2022 03:40:23 +0300 Subject: [PATCH 12/12] Remove redundant comment --- digest/Cargo.toml | 2 -- 1 file changed, 2 deletions(-) diff --git a/digest/Cargo.toml b/digest/Cargo.toml index 737f03e65..253da27ba 100644 --- a/digest/Cargo.toml +++ b/digest/Cargo.toml @@ -18,8 +18,6 @@ crypto-common = { version = "0.1.3", path = "../crypto-common" } block-buffer = { version = "0.10", optional = true } subtle = { version = "=2.4", default-features = false, optional = true } blobby = { version = "0.3", optional = true } -# Enable implementation of the `AssociatedOid` trait for the core wrappers. -# Enabling this feature bumps MSRV to 1.57. const-oid = { version = "0.9", optional = true } [features]