Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump cipher to 0.5.0-pre.4 #583

Merged
merged 4 commits into from
Mar 27, 2024
Merged

Conversation

@baloo baloo force-pushed the baloo/bump-cipher branch 7 times, most recently from 404fe84 to fdabf6c Compare March 5, 2024 17:09
eax/src/lib.rs Show resolved Hide resolved
@baloo
Copy link
Member Author

baloo commented Mar 5, 2024

@newpavlov I'd love to get some help to bump mgm I'm a bit lost with the parallel enc/dec of blocks.

@newpavlov
Copy link
Member

newpavlov commented Mar 6, 2024

@baloo
The mgm crate is somewhat out of date (it's still on cipher v0.3). I think it will be better to migrate it in a separate PR. I also wanted to implement an online mode of operation for it.

If you encounter difficulties with fixing the mgm CI jobs, you can exclude it from the common workspace.

Cargo.toml Outdated
Comment on lines 15 to 39
[patch.crates-io]

# https://github.com/RustCrypto/block-ciphers/pull/413
aes = { git = "https://github.com/RustCrypto/block-ciphers.git" }

# https://github.com/RustCrypto/block-modes/pull/56
ctr = { git = "https://github.com/RustCrypto/block-modes.git" }

# pending pre-release
universal-hash = { git = "https://github.com/RustCrypto/traits.git" }
# https://github.com/RustCrypto/traits/pull/1531
aead = { git = "https://github.com/RustCrypto/traits.git" }

# https://github.com/RustCrypto/MACs/pull/158
cmac = { git = "https://github.com/RustCrypto/MACs.git" }
pmac = { git = "https://github.com/RustCrypto/MACs.git" }

# https://github.com/RustCrypto/stream-ciphers/pull/345
chacha20 = { git = "https://github.com/RustCrypto/stream-ciphers.git" }

# https://github.com/RustCrypto/universal-hashes/pull/196
ghash = { git = "https://github.com/RustCrypto/universal-hashes.git" }
polyval = { git = "https://github.com/RustCrypto/universal-hashes.git" }
poly1305 = { git = "https://github.com/RustCrypto/universal-hashes.git" }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps we could kick out some releases of these so we have a patch-free baseline to work from

Copy link
Member Author

@baloo baloo Mar 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that'd be lovely!

In order, I think I'd need:

  • First step:
    • traits/aead
    • traits/universal-hash
    • block-ciphers/aes
    • block-ciphers/belt-block
    • block-ciphers/des
    • block-ciphers/kuznyechik
    • block-ciphers/magma
    • stream-ciphers/chacha20
  • second
    • macs/cmac
    • macs/pmac
    • block-modes/ctr
    • universal-hashes/polyval
    • universal-hashes/poly1305
  • third
    • universal-hashes/ghash

Copy link
Member Author

@baloo baloo Mar 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's a lot of releases! I can throw in the first step of those in a couple PRs if you'd like

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure

@baloo baloo force-pushed the baloo/bump-cipher branch 3 times, most recently from 15a6e11 to 85cef52 Compare March 8, 2024 20:39
@baloo
Copy link
Member Author

baloo commented Mar 8, 2024

While we wait for the release of belt-block (which is a blocker for macs and ctr bumps), I got this in a state that I think should be merge-able.

@tarcieri
Copy link
Member

@baloo this needs a rebase now that we've landed ocb3

@baloo baloo marked this pull request as draft March 27, 2024 17:42
@baloo baloo marked this pull request as ready for review March 27, 2024 18:12
let (b0, b1) = two_blocks.split_at_mut(BLOCK_SIZE);
[b0.into(), b1.into()]
[b0.try_into().unwrap(), b1.try_into().unwrap()]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @dignifiedquire I think that is okay with the debug_assert on top.

@@ -371,7 +373,7 @@ where
let mut offset_i = [Block::default(); WIDTH];
offset_i[offset_i.len() - 1] = initial_offset(&self.cipher, nonce, TagSize::to_u32());
let mut checksum_i = Block::default();
for wide_blocks in buffer.chunks_exact_mut(16 * WIDTH) {
for wide_blocks in buffer.chunks_exact_mut(<Block as AssocArraySize>::Size::USIZE * WIDTH) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could use an aliased type in hybrid-array

@tarcieri tarcieri merged commit d812daa into RustCrypto:master Mar 27, 2024
91 checks passed
@baloo baloo deleted the baloo/bump-cipher branch March 27, 2024 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants