diff --git a/Cargo.lock b/Cargo.lock index 6d0c47f7..4ad44c57 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -37,9 +37,9 @@ checksum = "89af0b093cc13baa4e51e64e65ec2422f7e73aea0e612e5ad3872986671622f1" [[package]] name = "block-buffer" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96eb4cdd6cf1b31d671e9efe75c5d1ec614776856cefbe109ca373554a6d514f" +checksum = "cdd35008169921d80bc60d3d0ab416eecb028c4cd653352907921d95084790be" dependencies = [ "hybrid-array", "zeroize", @@ -85,15 +85,14 @@ dependencies = [ [[package]] name = "cfg-if" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fd1289c04a9ea8cb22300a459a72a385d7c73d3259e2ed7dcb2af674838cfa9" +checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" [[package]] name = "cipher" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64727038c8c5e2bb503a15b9f5b9df50a1da9a33e83e1f93067d914f2c6604a5" +version = "0.5.1" +source = "git+https://github.com/RustCrypto/traits?branch=block_sizes#8359276d485a3cae7c47f969d267a66245fa669b" dependencies = [ "blobby", "block-buffer", @@ -119,9 +118,8 @@ dependencies = [ [[package]] name = "crypto-common" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "211f05e03c7d03754740fd9e585de910a095d6b99f8bcfffdef8319fa02a8331" +version = "0.2.1" +source = "git+https://github.com/RustCrypto/traits?branch=block_sizes#8359276d485a3cae7c47f969d267a66245fa669b" dependencies = [ "hybrid-array", ] @@ -144,9 +142,9 @@ dependencies = [ [[package]] name = "hex-literal" -version = "1.0.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcaaec4551594c969335c98c903c1397853d4198408ea609190f420500f6be71" +checksum = "e712f64ec3850b98572bffac52e2c6f282b29fe6c5fa6d42334b30be438d95c1" [[package]] name = "hybrid-array" @@ -185,9 +183,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.175" +version = "0.2.182" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a82ae493e598baaea5209805c49bbf2ea7de956d50d7da0da1164f9c6d28543" +checksum = "6800badb6cb2082ffd7b6a67e6125bb39f18782f793520caee8cb8846be06112" [[package]] name = "magma" @@ -261,9 +259,9 @@ dependencies = [ [[package]] name = "typenum" -version = "1.18.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" +checksum = "562d481066bde0658276a35467c4af00bdc6ee726305698a55b86e61d7ad82bb" [[package]] name = "xtea" @@ -274,6 +272,6 @@ dependencies = [ [[package]] name = "zeroize" -version = "1.8.1" +version = "1.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" +checksum = "b97154e67e32c85465826e8bcc1c59429aaaf107c1e4a9e53c8d8ccd5eff88d0" diff --git a/Cargo.toml b/Cargo.toml index 675e575f..2535c2db 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,3 +26,7 @@ members = [ [profile.dev] opt-level = 2 + +[patch.crates-io] +crypto-common = { git = "https://github.com/RustCrypto/traits", branch = "block_sizes" } +cipher = { git = "https://github.com/RustCrypto/traits", branch = "block_sizes" } diff --git a/rc5/src/lib.rs b/rc5/src/lib.rs index 94338abe..94700758 100644 --- a/rc5/src/lib.rs +++ b/rc5/src/lib.rs @@ -23,7 +23,6 @@ use cipher::{ BlockCipherEncBackend, BlockCipherEncClosure, BlockCipherEncrypt, BlockSizeUser, KeyInit, KeySizeUser, ParBlocksSizeUser, array::ArraySize, - common::BlockSizes, consts::{U1, U2, U256}, inout::InOut, typenum::{Diff, IsLess, Le, NonZero, Sum, Unsigned}, @@ -51,7 +50,7 @@ where W: Word, // Block size W::Bytes: Mul, - BlockSize: BlockSizes, + BlockSize: ArraySize, // Rounds range R: Unsigned, R: IsLess, @@ -70,7 +69,7 @@ where W: Word, // Block size W::Bytes: Mul, - BlockSize: BlockSizes, + BlockSize: ArraySize, // Rounds range R: Unsigned, R: IsLess, @@ -156,7 +155,7 @@ where W: Word, // Block size W::Bytes: Mul, - BlockSize: BlockSizes, + BlockSize: ArraySize, // Rounds range R: Unsigned, R: IsLess, @@ -187,7 +186,7 @@ where W: Word, // Block size W::Bytes: Mul, - BlockSize: BlockSizes, + BlockSize: ArraySize, // Rounds range R: Unsigned, R: IsLess, @@ -219,7 +218,7 @@ where W: Word, // Block size W::Bytes: Mul, - BlockSize: BlockSizes, + BlockSize: ArraySize, // Rounds range R: Unsigned, R: IsLess, @@ -238,7 +237,7 @@ where W: Word, // Block size W::Bytes: Mul, - BlockSize: BlockSizes, + BlockSize: ArraySize, // Rounds range R: Unsigned, R: IsLess, @@ -256,7 +255,7 @@ where W: Word, // Block size W::Bytes: Mul, - BlockSize: BlockSizes, + BlockSize: ArraySize, // Rounds range R: Unsigned, R: IsLess, @@ -274,7 +273,7 @@ where W: Word, // Block size W::Bytes: Mul, - BlockSize: BlockSizes, + BlockSize: ArraySize, // Rounds range R: Unsigned, R: IsLess, @@ -303,7 +302,7 @@ where W: Word, // Block size W::Bytes: Mul, - BlockSize: BlockSizes, + BlockSize: ArraySize, // Rounds range R: Unsigned, R: IsLess, @@ -344,7 +343,7 @@ where W: Word, // Block size W::Bytes: Mul, - BlockSize: BlockSizes, + BlockSize: ArraySize, // Rounds range R: Unsigned, R: IsLess, @@ -373,7 +372,7 @@ where W: Word, // Block size W::Bytes: Mul, - BlockSize: BlockSizes, + BlockSize: ArraySize, // Rounds range R: Unsigned, R: IsLess, @@ -414,7 +413,7 @@ where W: Word, // Block size W::Bytes: Mul, - BlockSize: BlockSizes, + BlockSize: ArraySize, // Rounds range R: Unsigned, R: IsLess, @@ -440,7 +439,7 @@ where W: Word, // Block size W::Bytes: Mul, - BlockSize: BlockSizes, + BlockSize: ArraySize, // Rounds range R: Unsigned, R: IsLess, @@ -467,7 +466,7 @@ where W: Word, // Block size W::Bytes: Mul, - BlockSize: BlockSizes, + BlockSize: ArraySize, // Rounds range R: Unsigned, R: IsLess, @@ -484,7 +483,7 @@ where W: Word, // Block size W::Bytes: Mul, - BlockSize: BlockSizes, + BlockSize: ArraySize, // Rounds range R: Unsigned, R: IsLess, diff --git a/rc5/src/primitives.rs b/rc5/src/primitives.rs index 459b62e4..1e2ec575 100644 --- a/rc5/src/primitives.rs +++ b/rc5/src/primitives.rs @@ -2,7 +2,6 @@ use core::ops::{Add, BitXor, Mul}; use cipher::{ array::{Array, ArraySize}, - common::BlockSizes, typenum::{Diff, Prod, Quot, Sum, U1, U2, U4, U8, U16}, }; @@ -20,7 +19,7 @@ pub type KeyAsWordsSize = Quot::Bytes>, U1>, + Add + Default + private::Sealed, - BlockSize: BlockSizes, + BlockSize: ArraySize, { type Bytes: ArraySize + Mul; diff --git a/rc6/src/block_cipher.rs b/rc6/src/block_cipher.rs index a3ad5efd..5013c62d 100644 --- a/rc6/src/block_cipher.rs +++ b/rc6/src/block_cipher.rs @@ -7,7 +7,6 @@ use cipher::{ BlockCipherDecBackend, BlockCipherDecClosure, BlockCipherDecrypt, BlockCipherEncBackend, BlockCipherEncClosure, BlockCipherEncrypt, }, - common::BlockSizes, inout::InOut, typenum::{Diff, IsLess, Le, NonZero, Sum, U1, U2, U4, U8, U12, U16, U20, U24, U256, Unsigned}, }; @@ -19,7 +18,7 @@ where W: Word, // Block size W::Bytes: Mul, - BlockSize: BlockSizes, + BlockSize: ArraySize, // Rounds range R: Unsigned, R: IsLess, @@ -48,7 +47,7 @@ where W: Word, // Block size W::Bytes: Mul, - BlockSize: BlockSizes, + BlockSize: ArraySize, // Rounds range R: Unsigned, R: IsLess, @@ -67,7 +66,7 @@ where W: Word, // Block size W::Bytes: Mul, - BlockSize: BlockSizes, + BlockSize: ArraySize, // Rounds range R: Unsigned, R: IsLess, @@ -85,7 +84,7 @@ where W: Word, // Block size W::Bytes: Mul, - BlockSize: BlockSizes, + BlockSize: ArraySize, // Rounds range R: Unsigned, R: IsLess, @@ -95,7 +94,7 @@ where Sum: Mul, ExpandedKeyTableSize: ArraySize, // Key range - B: BlockSizes, + B: ArraySize, B: IsLess, Le: NonZero, // KeyAsWordsSize @@ -114,7 +113,7 @@ where W: Word, // Block size W::Bytes: Mul, - BlockSize: BlockSizes, + BlockSize: ArraySize, // Rounds range R: Unsigned, R: IsLess, @@ -131,7 +130,7 @@ where W: Word, // Block size W::Bytes: Mul, - BlockSize: BlockSizes, + BlockSize: ArraySize, // Rounds range R: Unsigned, R: IsLess, @@ -149,7 +148,7 @@ where W: Word, // Block size W::Bytes: Mul, - BlockSize: BlockSizes, + BlockSize: ArraySize, // Rounds range R: Unsigned, R: IsLess, @@ -167,7 +166,7 @@ where W: Word, // Block size W::Bytes: Mul, - BlockSize: BlockSizes, + BlockSize: ArraySize, // Rounds range R: Unsigned, R: IsLess, @@ -198,7 +197,7 @@ where W: Word, // Block size W::Bytes: Mul, - BlockSize: BlockSizes, + BlockSize: ArraySize, // Rounds range R: Unsigned, R: IsLess, @@ -208,7 +207,7 @@ where Sum: Mul, ExpandedKeyTableSize: ArraySize, // Key range - B: BlockSizes, + B: ArraySize, B: IsLess, Le: NonZero, // KeyAsWordsSize @@ -227,7 +226,7 @@ where W: Word, // Block size W::Bytes: Mul, - BlockSize: BlockSizes, + BlockSize: ArraySize, // Rounds range R: Unsigned, R: IsLess, @@ -244,7 +243,7 @@ where W: Word, // Block size W::Bytes: Mul, - BlockSize: BlockSizes, + BlockSize: ArraySize, // Rounds range R: Unsigned, R: IsLess, @@ -262,7 +261,7 @@ where W: Word, // Block size W::Bytes: Mul, - BlockSize: BlockSizes, + BlockSize: ArraySize, // Rounds range R: Unsigned, R: IsLess, @@ -280,7 +279,7 @@ where W: Word, // Block size W::Bytes: Mul, - BlockSize: BlockSizes, + BlockSize: ArraySize, // Rounds range R: Unsigned, R: IsLess, @@ -311,7 +310,7 @@ where W: Word, // Block size W::Bytes: Mul, - BlockSize: BlockSizes, + BlockSize: ArraySize, // Rounds range R: Unsigned, R: IsLess, diff --git a/rc6/src/core/backend.rs b/rc6/src/core/backend.rs index c9fe0784..16f8065b 100644 --- a/rc6/src/core/backend.rs +++ b/rc6/src/core/backend.rs @@ -6,7 +6,6 @@ use core::{ use cipher::{ array::{Array, ArraySize}, - common::BlockSizes, inout::InOut, typenum::{Diff, IsLess, Le, NonZero, Sum, U1, U2, U4, U256, Unsigned}, }; @@ -34,7 +33,7 @@ where W: Word, // Block size W::Bytes: Mul, - BlockSize: BlockSizes, + BlockSize: ArraySize, // Rounds range R: Unsigned, R: IsLess, @@ -127,7 +126,7 @@ where W: Word, // Block size W::Bytes: Mul, - BlockSize: BlockSizes, + BlockSize: ArraySize, // Rounds range R: Unsigned, R: IsLess,