Argyle-Software / kyber

A rust implementation of the Kyber post-quantum KEM
https://docs.rs/pqc_kyber/
Apache License 2.0
163 stars 37 forks source link

Use `aes` crate? #100

Closed tarcieri closed 9 months ago

tarcieri commented 9 months ago

I noticed this crate vendors a portable bitsliced implementation of AES along with an AES-NI implementation which have been translated from the Kyber reference implementation.

Instead of that, I'd like to suggest using the aes crate from @RustCrypto. It includes a portable "fixsliced" implementation of AES, AES-NI support, and also support for the ARMv8 Cryptography Extensions. Additionally it implements runtime CPU feature detection on both x86 and ARM to determine if the hardware implementations are available, falling back to the portable implementations if not.

mberry commented 9 months ago

The 90s-fixslice feature uses the aes crate

That said, all the vendored AES code should be carved out of this repo, the fixslice feature was added on rather than a replacement for codebase stability/dependency reasons. Feature deprecation isn't really there yet in rust.

Somewhat offtopic: enforcing cargo fmt standard style really did a number on all the instantiation in aes256ctr.rs

tarcieri commented 9 months ago

Oh, my bad, I'm not sure how I missed that