Skip to content

Commit 479404a

Browse files
authored
md4: add OID support (#418)
1 parent f9af45f commit 479404a

File tree

4 files changed

+36
-2
lines changed

4 files changed

+36
-2
lines changed

.github/workflows/md4.yml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
strategy:
5050
matrix:
5151
rust:
52-
- 1.41.0 # MSRV
52+
- 1.57.0 # MSRV
5353
- stable
5454
steps:
5555
- uses: actions/checkout@v3
@@ -63,3 +63,22 @@ jobs:
6363
- run: cargo test --no-default-features
6464
- run: cargo test
6565
- run: cargo test --all-features
66+
67+
# TODO: merge with test on MSRV bump to 1.57 or higher
68+
test-msrv-41:
69+
runs-on: ubuntu-latest
70+
strategy:
71+
matrix:
72+
rust:
73+
- 1.41.0 # MSRV
74+
- stable
75+
steps:
76+
- uses: actions/checkout@v3
77+
- uses: RustCrypto/actions/cargo-cache@master
78+
- uses: actions-rs/toolchain@v1
79+
with:
80+
profile: minimal
81+
toolchain: ${{ matrix.rust }}
82+
override: true
83+
- run: cargo test --no-default-features
84+
- run: cargo test

md4/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## 0.10.2 (UNRELEASED)
9+
### Added
10+
- Feature-gated OID support ([#418])
11+
12+
[#418]: https://github.com/RustCrypto/hashes/pull/418
13+
814
## 0.10.1 (2022-02-17)
915
### Fixed
1016
- Minimal versions build ([#363])

md4/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@ categories = ["cryptography", "no-std"]
1515
digest = "0.10.3"
1616

1717
[dev-dependencies]
18-
digest = { version = "0.10.3", features = ["dev"] }
18+
digest = { version = "0.10.4", features = ["dev"] }
1919
hex-literal = "0.2.2"
2020

2121
[features]
2222
default = ["std"]
2323
std = ["digest/std"]
24+
oid = ["digest/oid"] # Enable OID support. WARNING: Bumps MSRV to 1.57

md4/src/lib.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535
pub use digest::{self, Digest};
3636

3737
use core::{convert::TryInto, fmt};
38+
#[cfg(feature = "oid")]
39+
use digest::const_oid::{AssociatedOid, ObjectIdentifier};
3840
use digest::{
3941
block_buffer::Eager,
4042
core_api::{
@@ -122,6 +124,12 @@ impl fmt::Debug for Md4Core {
122124
}
123125
}
124126

127+
#[cfg(feature = "oid")]
128+
#[cfg_attr(docsrs, doc(cfg(feature = "oid")))]
129+
impl AssociatedOid for Md4Core {
130+
const OID: ObjectIdentifier = ObjectIdentifier::new_unwrap("1.2.840.113549.2.4");
131+
}
132+
125133
/// MD4 hasher state.
126134
pub type Md4 = CoreWrapper<Md4Core>;
127135

0 commit comments

Comments
 (0)