diff --git a/Cargo.lock b/Cargo.lock index 9e460eb..354238c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -19,22 +19,24 @@ dependencies = [ [[package]] name = "crypto-common" -version = "0.1.6" +version = "0.2.0-pre.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +checksum = "b7aa2ec04f5120b830272a481e8d9d8ba4dda140d2cda59b0f1110d5eb93c38e" dependencies = [ - "generic-array", - "typenum", + "getrandom", + "hybrid-array", + "rand_core", ] [[package]] -name = "generic-array" -version = "0.14.7" +name = "getrandom" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" dependencies = [ - "typenum", - "version_check", + "cfg-if", + "libc", + "wasi", ] [[package]] @@ -53,6 +55,15 @@ version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0" +[[package]] +name = "hybrid-array" +version = "0.2.0-rc.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcda354500b318c287a6b91c1cfbc42edd53d52d259a80783ceb5e3986fca2b2" +dependencies = [ + "typenum", +] + [[package]] name = "libc" version = "0.2.149" @@ -67,7 +78,7 @@ checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" [[package]] name = "poly1305" -version = "0.8.0" +version = "0.9.0-pre" dependencies = [ "cpufeatures", "hex-literal", @@ -78,7 +89,7 @@ dependencies = [ [[package]] name = "polyval" -version = "0.6.1" +version = "0.7.0-pre" dependencies = [ "cfg-if", "cpufeatures", @@ -88,6 +99,15 @@ dependencies = [ "zeroize", ] +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + [[package]] name = "subtle" version = "2.5.0" @@ -102,19 +122,18 @@ checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "universal-hash" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc1de2c688dc15305988b563c3854064043356019f97a4b46276fe734c4f07ea" +version = "0.6.0-pre" +source = "git+https://github.com/RustCrypto/traits.git?branch=master#60297e6f799d040415c96d85152d3affad255738" dependencies = [ "crypto-common", "subtle", ] [[package]] -name = "version_check" -version = "0.9.4" +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "zeroize" diff --git a/Cargo.toml b/Cargo.toml index 3464997..6c82d8a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,3 +5,6 @@ members = [ "polyval" ] resolver = "2" + +[patch.crates-io] +universal-hash = { git = "https://github.com/RustCrypto/traits.git", branch = "master" } diff --git a/ghash/Cargo.toml b/ghash/Cargo.toml index 4c5d26a..b83d3f5 100644 --- a/ghash/Cargo.toml +++ b/ghash/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ghash" -version = "0.5.0" +version = "0.6.0-pre" authors = ["RustCrypto Developers"] license = "Apache-2.0 OR MIT" description = """ @@ -17,7 +17,7 @@ edition = "2021" [dependencies] opaque-debug = "0.3" -polyval = { version = "0.6", path = "../polyval" } +polyval = { version = "=0.7.0-pre", path = "../polyval" } # optional dependencies zeroize = { version = "1", optional = true, default-features = false } diff --git a/poly1305/Cargo.toml b/poly1305/Cargo.toml index 7345d01..3459fad 100644 --- a/poly1305/Cargo.toml +++ b/poly1305/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "poly1305" -version = "0.8.0" +version = "0.9.0-pre" authors = ["RustCrypto Developers"] license = "Apache-2.0 OR MIT" description = "The Poly1305 universal hash function and message authentication code" @@ -14,7 +14,7 @@ edition = "2021" [dependencies] opaque-debug = "0.3" -universal-hash = { version = "0.5", default-features = false } +universal-hash = { version = "=0.6.0-pre", default-features = false } zeroize = { version = "1", optional = true, default-features = false } [target.'cfg(any(target_arch = "x86_64", target_arch = "x86"))'.dependencies] diff --git a/poly1305/src/backend/avx2.rs b/poly1305/src/backend/avx2.rs index a9b8191..726714c 100644 --- a/poly1305/src/backend/avx2.rs +++ b/poly1305/src/backend/avx2.rs @@ -16,9 +16,9 @@ // length to be known, which is incompatible with the streaming API of UniversalHash. use universal_hash::{ + array::Array, consts::{U16, U4}, crypto_common::{BlockSizeUser, ParBlocksSizeUser}, - generic_array::GenericArray, UhfBackend, }; @@ -160,7 +160,7 @@ impl State { } // Compute tag: p + k mod 2^128 - let mut tag = GenericArray::::default(); + let mut tag = Array::::default(); let tag_int = if let Some(p) = p { self.k + p } else { diff --git a/poly1305/src/lib.rs b/poly1305/src/lib.rs index 62c9781..b3cbbad 100644 --- a/poly1305/src/lib.rs +++ b/poly1305/src/lib.rs @@ -54,9 +54,9 @@ extern crate std; pub use universal_hash; use universal_hash::{ + array::Array, consts::{U16, U32}, crypto_common::{BlockSizeUser, KeySizeUser}, - generic_array::GenericArray, KeyInit, UniversalHash, }; @@ -146,7 +146,7 @@ impl Poly1305 { pub fn compute_unpadded(mut self, data: &[u8]) -> Tag { for chunk in data.chunks(BLOCK_SIZE) { if chunk.len() == BLOCK_SIZE { - let block = GenericArray::from_slice(chunk); + let block = Array::from_slice(chunk); self.state.compute_block(block, false); } else { let mut block = Block::default(); diff --git a/polyval/Cargo.toml b/polyval/Cargo.toml index 9dc0dfb..d04d4d2 100644 --- a/polyval/Cargo.toml +++ b/polyval/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "polyval" -version = "0.6.1" +version = "0.7.0-pre" authors = ["RustCrypto Developers"] license = "Apache-2.0 OR MIT" description = """ @@ -18,7 +18,7 @@ edition = "2021" [dependencies] cfg-if = "1" opaque-debug = "0.3" -universal-hash = { version = "0.5", default-features = false } +universal-hash = { version = "=0.6.0-pre", default-features = false } zeroize = { version = "1", optional = true, default-features = false } [target.'cfg(any(target_arch = "aarch64", target_arch = "x86_64", target_arch = "x86"))'.dependencies]