Re: [PATCH v3 1/2] rust: crypto: add AES-128, AES-CMAC, SHA-256, and HMAC bindings
From: Mike Lothian
Date: Wed Sep 02 2026 - 08:58:39 EST
On Mon, 31 Aug 2026, Eric Biggers wrote:
> I'm not currently planning to make the crypto library expose AES
> functions that take raw keys, since computing the AES round keys is
> fairly slow and most users use their AES keys multiple times. So in
> this case I guess keep planning to use the sequence that is already
> supported: aes_prepareenckey() + aes_encrypt() + memzero_explicit().
> For CTR mode, use aes_prepareenckey() + aes_ctr() + memzero_explicit().
I'll drop the rest of the AES from this patch and leave the one
remaining caller, the HDCP 2.2 dKey derivation, a single ECB block on
aes_prepareenckey() + aes_encrypt() + memzero_explicit()
> But if you're using either key multiple times you should call
> aes_prepareenckey() just once and cache the result, as that is what it
> is for.
Thanks for the review.
Mike