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

ctr: vendor/unify Ctr32BE and Ctr32LE types #170

Merged
merged 1 commit into from
Oct 14, 2020

Conversation

tarcieri
Copy link
Member

@tarcieri tarcieri commented Sep 17, 2020

Imports and unifies the 32-bit CTR mode implementations previously defined in the aes-gcm and aes-gcm-siv crates, which implement 32-bit big endian and little endian counter modes respectively.

Additionally impls the FromBlockCipher and SyncStreamCipher traits for the Ctr32BE and Ctr32LE wrapper newtypes.

@tarcieri tarcieri mentioned this pull request Sep 17, 2020
@tarcieri
Copy link
Member Author

I think it'd be good to vendor these initially largely as-is, perhaps adding some tests.

Right now they don't have independent tests but were tested vicariously as part of the full aes-gcm and aes-gcm-siv implementations.

After that I think we can do some work on unifying them and impl-ing the stream-cipher traits.

@tarcieri
Copy link
Member Author

tarcieri commented Oct 14, 2020

In trying to use this in aes-gcm I encountered something somewhat annoying: FromBlockCipher (used in this PR) has a NewBlockCipher bound on its associated BlockCipher type, which precludes using it with a borrowed &B where B: BlockCipher.

I tried removing this in RustCrypto/traits#333 in order to see if that's sufficient to allow aes-gcm and aes-gcm-siv to migrate to this implementation. However note that this is PR is targeting a hypothetical new stream-cipher release.

@tarcieri tarcieri changed the title [WIP] ctr: vendor Ctr32BE and Ctr32LE types [WIP] ctr: vendor/unify Ctr32BE and Ctr32LE types Oct 14, 2020
@tarcieri tarcieri force-pushed the vendor-ctr32be-and-ctr32le branch 3 times, most recently from 6069ee1 to 6107e6e Compare October 14, 2020 17:06
@tarcieri tarcieri changed the title [WIP] ctr: vendor/unify Ctr32BE and Ctr32LE types ctr: vendor/unify Ctr32BE and Ctr32LE types Oct 14, 2020
@tarcieri tarcieri marked this pull request as ready for review October 14, 2020 17:06
Imports and unifies the 32-bit CTR mode implementations previously
defined in the `aes-gcm` and `aes-gcm-siv` crates, which implement
32-bit big endian and little endian counter modes respectively.

Additionally makes them generic over any block size, and impls the
`FromBlockCipher` and `SyncStreamCipher` traits for the `Ctr32BE` and
`Ctr32LE` wrapper newtypes.
@tarcieri tarcieri merged commit 0b3a4ec into master Oct 14, 2020
@tarcieri tarcieri deleted the vendor-ctr32be-and-ctr32le branch October 14, 2020 18:02
@tarcieri tarcieri mentioned this pull request Oct 14, 2020
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.

None yet

1 participant