]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
hw/misc/max78000_aes: Comment Internal Key Storage
authorJackson Donaldson <jackson88044@gmail.com>
Mon, 21 Jul 2025 09:07:53 +0000 (10:07 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Mon, 21 Jul 2025 09:07:53 +0000 (10:07 +0100)
Coverity Scan noted an unusual pattern in the
MAX78000 aes device, with duplicated calls to
set_decrypt. This commit adds a comment noting
why the implementation is correct.

Signed-off-by: Jackson Donaldson <jcksn@duck.com>
Message-id: 20250716002622.84685-1-jcksn@duck.com
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
hw/misc/max78000_aes.c

index 0bfb2f02b5b3235b127388bbe3d31f56e957fae6..d883ddd2b614b9e700d183180b4eebe35323a943 100644 (file)
@@ -79,6 +79,12 @@ static void max78000_aes_do_crypto(Max78000AesState *s)
         keydata += 8;
     }
 
+    /*
+     * The MAX78000 AES engine stores an internal key, which it uses only
+     * for decryption. This results in the slighly odd looking pairs of
+     * set_encrypt and set_decrypt calls below; s->internal_key is
+     * being stored for later use in both cases.
+     */
     AES_KEY key;
     if ((s->ctrl & TYPE) == 0) {
         AES_set_encrypt_key(keydata, keylen, &key);