From 58c4d15b7122f889c68d5e831f2e972be4984678 Mon Sep 17 00:00:00 2001 From: robinhundt <24554122+robinhundt@users.noreply.github.com> Date: Tue, 13 Jan 2026 16:13:30 +0100 Subject: [PATCH 1/2] Update criterion, ndarray --- Cargo.lock | 132 +++++++++++++++-------------------------------------- Cargo.toml | 4 +- 2 files changed, 39 insertions(+), 97 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0a9d363..8bbc1d5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -22,6 +22,15 @@ dependencies = [ "memchr", ] +[[package]] +name = "alloca" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5a7d05ea6aea7e9e64d25b9156ba2fee3fdd659e34e41063cd2fc7cd020d7f4" +dependencies = [ + "cc", +] + [[package]] name = "allocator-api2" version = "0.2.21" @@ -64,17 +73,6 @@ version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" -[[package]] -name = "atty" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" -dependencies = [ - "hermit-abi", - "libc", - "winapi", -] - [[package]] name = "autocfg" version = "1.5.0" @@ -128,12 +126,6 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - [[package]] name = "bitflags" version = "2.10.0" @@ -277,18 +269,6 @@ dependencies = [ "inout", ] -[[package]] -name = "clap" -version = "3.2.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ea181bf566f71cb9a5d17a59e1871af638180a18fb0035c92ae62b705207123" -dependencies = [ - "bitflags 1.3.2", - "clap_lex 0.2.4", - "indexmap 1.9.3", - "textwrap", -] - [[package]] name = "clap" version = "4.5.54" @@ -305,19 +285,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fa42cf4d2b7a41bc8f663a7cab4031ebafa1bf3875705bfaf8466dc60ab52c00" dependencies = [ "anstyle", - "clap_lex 0.7.7", + "clap_lex", "strsim", ] -[[package]] -name = "clap_lex" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" -dependencies = [ - "os_str_bytes", -] - [[package]] name = "clap_lex" version = "0.7.7" @@ -361,26 +332,24 @@ dependencies = [ [[package]] name = "criterion" -version = "0.4.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7c76e09c1aae2bc52b3d2f29e13c6572553b30c4aa1b8a49fd70de6412654cb" +checksum = "4d883447757bb0ee46f233e9dc22eb84d93a9508c9b868687b274fc431d886bf" dependencies = [ + "alloca", "anes", - "atty", "cast", "ciborium", - "clap 3.2.25", + "clap", "criterion-plot", - "futures", "itertools", - "lazy_static", "num-traits", "oorandom", + "page_size", "plotters", "rayon", "regex", "serde", - "serde_derive", "serde_json", "tinytemplate", "tokio", @@ -389,9 +358,9 @@ dependencies = [ [[package]] name = "criterion-plot" -version = "0.5.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b50826342786a51a89e2da3a28f1c32b06e387201bc2d19791f622c673706b1" +checksum = "ed943f81ea2faa8dcecbbfa50164acf95d555afec96a27871663b300e387b2e4" dependencies = [ "cast", "itertools", @@ -609,7 +578,7 @@ checksum = "af9efde466c5d532d57efd92f861da3bdb7f61e369128ce8b4c3fe0c9de4fa4d" dependencies = [ "cc", "codespan-reporting", - "indexmap 2.13.0", + "indexmap", "proc-macro2", "quote", "scratch", @@ -622,9 +591,9 @@ version = "1.0.192" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3efb93799095bccd4f763ca07997dc39a69e5e61ab52d2c407d4988d21ce144d" dependencies = [ - "clap 4.5.54", + "clap", "codespan-reporting", - "indexmap 2.13.0", + "indexmap", "proc-macro2", "quote", "syn", @@ -642,7 +611,7 @@ version = "1.0.192" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "31d72ebfcd351ae404fb00ff378dfc9571827a00722c9e735c9181aec320ba0a" dependencies = [ - "indexmap 2.13.0", + "indexmap", "proc-macro2", "quote", "syn", @@ -917,12 +886,6 @@ version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b4b9ebce26001bad2e6366295f64e381c1e9c479109202149b9e15e154973e9" -[[package]] -name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" - [[package]] name = "hashbrown" version = "0.16.1" @@ -934,15 +897,6 @@ dependencies = [ "foldhash", ] -[[package]] -name = "hermit-abi" -version = "0.1.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] - [[package]] name = "hex" version = "0.4.3" @@ -965,16 +919,6 @@ dependencies = [ "typenum", ] -[[package]] -name = "indexmap" -version = "1.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" -dependencies = [ - "autocfg", - "hashbrown 0.12.3", -] - [[package]] name = "indexmap" version = "2.13.0" @@ -982,7 +926,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7714e70437a7dc3ac8eb7e6f8df75fd8eb422675fc7678aff7364301092b1017" dependencies = [ "equivalent", - "hashbrown 0.16.1", + "hashbrown", ] [[package]] @@ -1005,9 +949,9 @@ dependencies = [ [[package]] name = "itertools" -version = "0.10.5" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" dependencies = [ "either", ] @@ -1144,9 +1088,9 @@ dependencies = [ [[package]] name = "ndarray" -version = "0.16.1" +version = "0.17.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "882ed72dce9365842bf196bdeedf5055305f11fc8c03dee7bb0194a6cad34841" +checksum = "520080814a7a6b4a6e9070823bb24b4531daac8c4627e08ba5de8c5ef2f2752d" dependencies = [ "matrixmultiply", "num-complex", @@ -1217,10 +1161,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6790f58c7ff633d8771f42965289203411a5e5c68388703c06e14f24770b41e" [[package]] -name = "os_str_bytes" -version = "6.6.1" +name = "page_size" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2355d85b9a3786f481747ced0e0ff2ba35213a1f9bd406ed906554d7af805a1" +checksum = "30d5b2194ed13191c1999ae0704b7839fb18384fa22e49b57eeaa97d79ce40da" +dependencies = [ + "libc", + "winapi", +] [[package]] name = "parking_lot" @@ -1346,7 +1294,7 @@ checksum = "bee689443a2bd0a16ab0348b52ee43e3b2d1b1f931c8aa5c9f8de4c86fbe8c40" dependencies = [ "bit-set", "bit-vec", - "bitflags 2.10.0", + "bitflags", "num-traits", "rand 0.9.2", "rand_chacha 0.9.0", @@ -1501,7 +1449,7 @@ version = "0.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" dependencies = [ - "bitflags 2.10.0", + "bitflags", ] [[package]] @@ -1562,7 +1510,7 @@ version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "146c9e247ccc180c1f61615433868c99f3de3ae256a30a43b49f67c2d9171f34" dependencies = [ - "bitflags 2.10.0", + "bitflags", "errno", "libc", "linux-raw-sys", @@ -1756,7 +1704,7 @@ dependencies = [ "bytes", "futures-channel", "futures-core", - "hashbrown 0.16.1", + "hashbrown", "intrusive-collections", "once_cell", "s2n-codec", @@ -1978,12 +1926,6 @@ dependencies = [ "winapi-util", ] -[[package]] -name = "textwrap" -version = "0.16.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c13547615a44dc9c452a8a534638acdf07120d4b6847c8178705da06306a3057" - [[package]] name = "thiserror" version = "2.0.17" diff --git a/Cargo.toml b/Cargo.toml index bde3629..47fa511 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,7 +21,7 @@ bitvec = "1.0.1" blake3 = "1.5.5" bytemuck = { version = "1.21.0", features = ["must_cast"] } cpufeatures = "0.2.17" -criterion = { version = "0.4", features = ["async_tokio", "html_reports"] } +criterion = { version = "0.8", features = ["async_tokio", "html_reports"] } cryprot-codes = { version = "0.2.0", path = "cryprot-codes" } cryprot-core = { version = "0.2.0", path = "cryprot-core" } cryprot-net = { version = "0.2.0", path = "cryprot-net" } @@ -31,7 +31,7 @@ fastdivide = "0.4.2" futures = "0.3.30" hybrid-array = { version = "0.4.1", features = ["bytemuck"] } libc = "0.2.169" -ndarray = "0.16.1" +ndarray = "0.17.2" num-traits = "0.2.19" rand = "0.9.0" rand_core = "0.9.0" From 0162283e80ab2ff9282f62d8f74d2724a512228b Mon Sep 17 00:00:00 2001 From: robinhundt <24554122+robinhundt@users.noreply.github.com> Date: Thu, 15 Jan 2026 15:40:06 +0100 Subject: [PATCH 2/2] update wide --- Cargo.lock | 8 ++++---- Cargo.toml | 2 +- cryprot-core/src/block.rs | 4 ++-- cryprot-core/src/transpose/portable.rs | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8bbc1d5..5dc5be3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1739,9 +1739,9 @@ dependencies = [ [[package]] name = "safe_arch" -version = "0.7.4" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96b02de82ddbe1b636e6170c21be622223aea188ef2e139be0a5b219ec215323" +checksum = "1f7caad094bd561859bcd467734a720c3c1f5d1f338995351fefe2190c45efed" dependencies = [ "bytemuck", ] @@ -2227,9 +2227,9 @@ dependencies = [ [[package]] name = "wide" -version = "0.7.33" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ce5da8ecb62bcd8ec8b7ea19f69a51275e91299be594ea5cc6ef7819e16cd03" +checksum = "ac11b009ebeae802ed758530b6496784ebfee7a87b9abfbcaf3bbe25b814eb25" dependencies = [ "bytemuck", "safe_arch", diff --git a/Cargo.toml b/Cargo.toml index 47fa511..bd6474f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -47,7 +47,7 @@ tokio-serde = "0.9.0" tokio-util = "0.7.11" tracing = "0.1.40" tracing-subscriber = { version = "0.3.18", features = ["env-filter"] } -wide = "0.7.32" +wide = "1.1.1" [profile.profiling] debug = true diff --git a/cryprot-core/src/block.rs b/cryprot-core/src/block.rs index 0789932..f03a97f 100644 --- a/cryprot-core/src/block.rs +++ b/cryprot-core/src/block.rs @@ -83,13 +83,13 @@ impl Block { /// Bytes of the block. #[inline] pub fn as_bytes(&self) -> &[u8; 16] { - self.0.as_array_ref() + self.0.as_array() } /// Mutable bytes of the block. #[inline] pub fn as_mut_bytes(&mut self) -> &mut [u8; 16] { - self.0.as_array_mut() + self.0.as_mut_array() } /// Hash the block with a [`random_oracle`]. diff --git a/cryprot-core/src/transpose/portable.rs b/cryprot-core/src/transpose/portable.rs index 82931a1..50d04ce 100644 --- a/cryprot-core/src/transpose/portable.rs +++ b/cryprot-core/src/transpose/portable.rs @@ -26,7 +26,7 @@ pub fn transpose_bitmatrix(input: &[u8], output: &mut [u8], rows: usize) { // left for i = 0, we write the previous lsb for i in (0..8).rev() { // get msb of each byte - let msbs = v.move_mask().to_le_bytes(); + let msbs = v.to_bitmask().to_le_bytes(); // write msbs to output at transposed position as one i16 let msb_i16 = i16::from_ne_bytes([msbs[0], msbs[1]]); let idx = out(row, col + i, rows) as isize;