Skip to content
Closed
Show file tree
Hide file tree
Changes from 4 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
4 changes: 2 additions & 2 deletions .github/workflows/universal-hash.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
strategy:
matrix:
rust:
- 1.41.0 # MSRV
- 1.56.0 # MSRV
- stable
target:
- thumbv7em-none-eabi
Expand Down Expand Up @@ -50,7 +50,7 @@ jobs:
strategy:
matrix:
rust:
- 1.41.0 # MSRV
- 1.56.0 # MSRV
- stable
steps:
- uses: actions/checkout@v2
Expand Down
30 changes: 15 additions & 15 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# RustCrypto: Traits

[![Project Chat][chat-image]][chat-link] [![dependency status][deps-image]][deps-link] ![Apache2/MIT licensed][license-image]
[![Project Chat][chat-image]][chat-link]
[![dependency status][deps-image]][deps-link]
![Apache2/MIT licensed][license-image]

Collection of traits which describe functionality of cryptographic primitives.

Expand All @@ -17,7 +19,7 @@ Collection of traits which describe functionality of cryptographic primitives.
| [`kem`] | [Key encapsulation mechanism] | [![crates.io](https://img.shields.io/crates/v/kem.svg)](https://crates.io/crates/kem) | [![Documentation](https://docs.rs/kem/badge.svg)](https://docs.rs/kem) | ![MSRV 1.56][msrv-1.56] |
| [`password-hash`] | [Password hashing] | [![crates.io](https://img.shields.io/crates/v/password-hash.svg)](https://crates.io/crates/password-hash) | [![Documentation](https://docs.rs/password-hash/badge.svg)](https://docs.rs/password-hash) | ![MSRV 1.57][msrv-1.57] |
| [`signature`] | [Digital signature] | [![crates.io](https://img.shields.io/crates/v/signature.svg)](https://crates.io/crates/signature) | [![Documentation](https://docs.rs/signature/badge.svg)](https://docs.rs/signature) | ![MSRV 1.41][msrv-1.41] |
| [`universal‑hash`] | [Universal hash function] | [![crates.io](https://img.shields.io/crates/v/universal-hash.svg)](https://crates.io/crates/universal-hash) | [![Documentation](https://docs.rs/universal-hash/badge.svg)](https://docs.rs/universal-hash) | ![MSRV 1.41][msrv-1.41] |
| [`universal‑hash`] | [Universal hash function] | [![crates.io](https://img.shields.io/crates/v/universal-hash.svg)](https://crates.io/crates/universal-hash) | [![Documentation](https://docs.rs/universal-hash/badge.svg)](https://docs.rs/universal-hash) | ![MSRV 1.56][msrv-1.56] |

### Additional Crates

Expand Down
4 changes: 2 additions & 2 deletions cipher/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "cipher"
description = "Traits for describing block ciphers and stream ciphers"
version = "0.4.3" # Also update html_root_url in lib.rs when bumping this
version = "0.4.4" # Also update html_root_url in lib.rs when bumping this
authors = ["RustCrypto Developers"]
license = "MIT OR Apache-2.0"
readme = "README.md"
Expand All @@ -13,7 +13,7 @@ keywords = ["crypto", "block-cipher", "stream-cipher", "trait"]
categories = ["cryptography", "no-std"]

[dependencies]
crypto-common = { version = "0.1.3", path = "../crypto-common" }
crypto-common = { version = "0.1.4", path = "../crypto-common" }
inout = "0.1"

# optional dependencies
Expand Down
14 changes: 2 additions & 12 deletions cipher/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#![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/cipher/0.4.3"
html_root_url = "https://docs.rs/cipher/0.4.4"
)]
#![warn(missing_docs, rust_2018_idioms)]

Expand Down Expand Up @@ -51,21 +51,11 @@ pub use crypto_common::{
generic_array,
typenum::{self, consts},
AlgorithmName, Block, InnerIvInit, InvalidLength, Iv, IvSizeUser, Key, KeyInit, KeyIvInit,
KeySizeUser,
KeySizeUser, ParBlocks, ParBlocksSizeUser,
};
use generic_array::{ArrayLength, GenericArray};

/// Trait for loading current IV state.
pub trait IvState: IvSizeUser {
/// Returns current IV state.
fn iv_state(&self) -> Iv<Self>;
}

/// Types which process blocks in parallel.
pub trait ParBlocksSizeUser: BlockSizeUser {
/// Number of blocks which can be processed in parallel.
type ParBlocksSize: ArrayLength<Block<Self>>;
}

/// Parallel blocks on which [`ParBlocksSizeUser`] implementors operate.
pub type ParBlocks<T> = GenericArray<Block<T>, <T as ParBlocksSizeUser>::ParBlocksSize>;
2 changes: 1 addition & 1 deletion crypto-common/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "crypto-common"
description = "Common cryptographic traits"
version = "0.1.3" # Also update html_root_url in lib.rs when bumping this
version = "0.1.4" # Also update html_root_url in lib.rs when bumping this
authors = ["RustCrypto Developers"]
license = "MIT OR Apache-2.0"
readme = "README.md"
Expand Down
10 changes: 9 additions & 1 deletion crypto-common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#![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/crypto-common/0.1.3"
html_root_url = "https://docs.rs/crypto-common/0.1.4"
)]
#![forbid(unsafe_code)]
#![warn(missing_docs, rust_2018_idioms)]
Expand All @@ -26,6 +26,8 @@ use rand_core::{CryptoRng, RngCore};

/// Block on which [`BlockSizeUser`] implementors operate.
pub type Block<B> = GenericArray<u8, <B as BlockSizeUser>::BlockSize>;
/// Parallel blocks on which [`ParBlocksSizeUser`] implementors operate.
pub type ParBlocks<T> = GenericArray<Block<T>, <T as ParBlocksSizeUser>::ParBlocksSize>;
/// Output array of [`OutputSizeUser`] implementors.
pub type Output<T> = GenericArray<u8, <T as OutputSizeUser>::OutputSize>;
/// Key used by [`KeySizeUser`] implementors.
Expand All @@ -52,6 +54,12 @@ impl<T: BlockSizeUser> BlockSizeUser for &mut T {
type BlockSize = T::BlockSize;
}

/// Types which can process blocks in parallel.
pub trait ParBlocksSizeUser: BlockSizeUser {
/// Number of blocks which can be processed in parallel.
type ParBlocksSize: ArrayLength<Block<Self>>;
}

/// Types which return data with the given size.
pub trait OutputSizeUser {
/// Size of the output in bytes.
Expand Down
2 changes: 1 addition & 1 deletion crypto/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ elliptic-curve = { version = "0.12.0-pre", optional = true, path = "../elliptic-
mac = { version = "0.11", package = "crypto-mac", optional = true }
password-hash = { version = "0.4", optional = true, path = "../password-hash" }
signature = { version = "1.5", optional = true, default-features = false, path = "../signature" }
universal-hash = { version = "0.4", optional = true, path = "../universal-hash" }
universal-hash = { version = "0.5", optional = true, path = "../universal-hash" }

[features]
std = [
Expand Down
14 changes: 8 additions & 6 deletions universal-hash/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
[package]
name = "universal-hash"
version = "0.4.1" # Also update html_root_url in lib.rs when bumping this
version = "0.5.0" # Also update html_root_url in lib.rs when bumping this
description = "Trait for universal hash functions"
authors = ["RustCrypto Developers"]
license = "MIT OR Apache-2.0"
description = "Trait for universal hash functions"
edition = "2021"
rust-version = "1.56"
readme = "README.md"
documentation = "https://docs.rs/universal-hash"
repository = "https://github.com/RustCrypto/traits"
keywords = ["crypto", "mac"]
categories = ["cryptography", "no-std"]
readme = "README.md"
edition = "2018"

[dependencies]
generic-array = "0.14"
crypto-common = { version = "0.1.4", path = "../crypto-common" }
subtle = { version = "=2.4", default-features = false }

[features]
std = []
std = ["crypto-common/std"]

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
4 changes: 2 additions & 2 deletions universal-hash/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ See [RustCrypto/universal-hashes] for implementations which use this trait.

## Minimum Supported Rust Version

Rust **1.41** or higher.
Rust **1.56** or higher.

Minimum supported Rust version can be changed in the future, but it will be
done with a minor version bump.
Expand Down Expand Up @@ -47,7 +47,7 @@ dual licensed as above, without any additional terms or conditions.
[docs-image]: https://docs.rs/universal-hash/badge.svg
[docs-link]: https://docs.rs/universal-hash/
[license-image]: https://img.shields.io/badge/license-Apache2.0/MIT-blue.svg
[rustc-image]: https://img.shields.io/badge/rustc-1.41+-blue.svg
[rustc-image]: https://img.shields.io/badge/rustc-1.56+-blue.svg
[chat-image]: https://img.shields.io/badge/zulip-join_chat-blue.svg
[chat-link]: https://rustcrypto.zulipchat.com/#narrow/stream/260051-universal-hashes
[build-image]: https://github.com/RustCrypto/traits/workflows/universal-hash/badge.svg?branch=master&event=push
Expand Down
Loading