RustCrypto / utils

Utility crates used in RustCrypto
450 stars 130 forks source link

dbl: retire crate and vendor implementation into downstream users? #1077

Open tarcieri opened 6 months ago

tarcieri commented 6 months ago

The dbl crate contains an implementation of doubling / multiply-by-x for the polynomial x^128 + x^7 + x^2 + x + 1 over GF(2^128).

It's used in aes-siv, cmac, pmac, and ocb3. The same polynomial is used by GHASH, although the ghash crate doesn't use it because it's implemented in terms of POLYVAL, which uses the "reverse" polynomial.

The question is does it deserve its own crate, or is it trivial enough to simply be vendored as needed?

It might make more sense if we provided e.g. SIMD implementations which operate in parallel over multiple blocks.

tarcieri commented 2 months ago

Another way to go might be a gf128 crate with support for this polynomial which has more operations than just dbl.

Perhaps it could be useful for implementing MGM, for example?