Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/digest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,4 @@ jobs:
- run: cargo test
- run: cargo test --features dev
- run: cargo test --features alloc
- run: cargo test --features std
- run: cargo test --all-features
1 change: 0 additions & 1 deletion crypto/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ universal-hash = { version = "0.6.0-rc.0", path = "../universal-hash", optional

[features]
std = [
"digest/std",
"elliptic-curve/std",
"signature/std",
]
Expand Down
3 changes: 3 additions & 0 deletions digest/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Removed
- `Mac::new`, `Mac::new_from_slice`, and `Mac::generate_key` methods ([#1173])
- `HashReader` and `HashWriter` are moved to the `digest-io` crate ([#1809])
- Removed `io::Write/Read` implementations in favor of the `digest_io::IoWrapper` type ([#1809])

[#1173]: https://github.com/RustCrypto/traits/pull/1173
[#1334]: https://github.com/RustCrypto/traits/pull/1334
[#1759]: https://github.com/RustCrypto/traits/pull/1759
[#1809]: https://github.com/RustCrypto/traits/pull/1809

## 0.10.7 (2023-05-19)
### Changed
Expand Down
1 change: 0 additions & 1 deletion digest/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ os_rng = ["crypto-common/rand_core", "rand_core"]
oid = ["const-oid"]
zeroize = ["dep:zeroize", "block-buffer?/zeroize"]
alloc = []
std = ["alloc"]
dev = ["blobby"]

[package.metadata.docs.rs]
Expand Down
14 changes: 0 additions & 14 deletions digest/src/core_api/rt_variable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,17 +184,3 @@ where
})
}
}

#[cfg(feature = "std")]
impl<T: VariableOutputCore> std::io::Write for RtVariableCoreWrapper<T> {
#[inline]
fn write(&mut self, buf: &[u8]) -> std::io::Result<usize> {
Update::update(self, buf);
Ok(buf.len())
}

#[inline]
fn flush(&mut self) -> std::io::Result<()> {
Ok(())
}
}
14 changes: 0 additions & 14 deletions digest/src/core_api/wrapper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,20 +220,6 @@ where
}
}

#[cfg(feature = "std")]
impl<T: BufferKindUser + UpdateCore> std::io::Write for CoreWrapper<T> {
#[inline]
fn write(&mut self, buf: &[u8]) -> std::io::Result<usize> {
Update::update(self, buf);
Ok(buf.len())
}

#[inline]
fn flush(&mut self) -> std::io::Result<()> {
Ok(())
}
}

/// A proxy trait to a core type implemented by [`CoreWrapper`]
// TODO: replace with an inherent associated type on stabilization:
// https://github.com/rust-lang/rust/issues/8995
Expand Down
12 changes: 0 additions & 12 deletions digest/src/core_api/xof_reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,6 @@ where
}
}

#[cfg(feature = "std")]
impl<T> std::io::Read for XofReaderCoreWrapper<T>
where
T: XofReaderCore,
{
#[inline]
fn read(&mut self, buf: &mut [u8]) -> std::io::Result<usize> {
XofReader::read(self, buf);
Ok(buf.len())
}
}

impl<T: XofReaderCore> Drop for XofReaderCoreWrapper<T> {
#[inline]
fn drop(&mut self) {
Expand Down
136 changes: 0 additions & 136 deletions digest/src/hashreader.rs

This file was deleted.

121 changes: 0 additions & 121 deletions digest/src/hashwriter.rs

This file was deleted.

21 changes: 6 additions & 15 deletions digest/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,12 @@
//! Usually they should not be used in application-level code.
//!
//! Additionally hash functions implement traits from the standard library:
//! [`Default`], [`Clone`], [`Write`][std::io::Write]. The latter is
//! feature-gated behind `std` feature, which is usually enabled by default
//! by hash implementation crates.
//! [`Default`] and [`Clone`].
//!
//! This crate does not provide any implementations of the `io::Read/Write` traits,
//! see the [`digest-io`] crate for `std::io`-compatibility wrappers.
//!
//! [`digest-io`]: https://docs.rs/digest-io

#![no_std]
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
Expand All @@ -35,9 +38,6 @@
#[macro_use]
extern crate alloc;

#[cfg(feature = "std")]
extern crate std;

#[cfg(feature = "rand_core")]
pub use crypto_common::rand_core;

Expand Down Expand Up @@ -303,12 +303,3 @@ impl fmt::Display for InvalidBufferSize {
}

impl core::error::Error for InvalidBufferSize {}

#[cfg(feature = "std")]
mod hashwriter;
#[cfg(feature = "std")]
pub use hashwriter::HashWriter;
#[cfg(feature = "std")]
mod hashreader;
#[cfg(feature = "std")]
pub use hashreader::HashReader;