On 2026-07-14 16:16, Daniel P. Berrangé wrote:
On Fri, Jul 10, 2026 at 05:28:50PM +0200, Harald Freudenberger wrote:
Add a new file crypto/aes-helpers.c with simple functions
to support some AES modes:
- AES cbc: AES_cbc_encrypt() AES_cbc_decrypt()
- AES ctr: AES_ctr_encrypt()
- AES xts: AES_xts_encrypt() AES_xts_decrypt()
and some AES related helpers:
- AES_xor()
- AES_xts_prep_next_tweak()
Add header file include/crypto/aes-helpers.h for these functions

Signed-off-by: Harald Freudenberger <[email protected]>
Reviewed-by: Finn Callies <[email protected]>
---
 crypto/aes-helpers.c         | 106 ++++++++++++++++++++++++++++++++
 crypto/meson.build           |   1 +
include/crypto/aes-helpers.h | 116 +++++++++++++++++++++++++++++++++++
 3 files changed, 223 insertions(+)
 create mode 100644 crypto/aes-helpers.c
 create mode 100644 include/crypto/aes-helpers.h

diff --git a/include/crypto/aes-helpers.h b/include/crypto/aes-helpers.h
new file mode 100644
index 0000000000..c1552b0e8f
--- /dev/null
+++ b/include/crypto/aes-helpers.h
@@ -0,0 +1,116 @@
+/*
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ *
+ * AES helper functions and modes
+ */
+
+#ifndef QEMU_AES_HELPERS_H
+#define QEMU_AES_HELPERS_H
+
+/**
+ * AES_xor:
+ *
+ * Bitwise XOR operation between two AES blocks.
+ *
+ * @src1: first source buffer of AES_BLOCK_SIZE bytes
+ * @src2: second source buffer of AES_BLOCK_SIZE bytes
+ * @dst: destination buffer of AES_BLOCK_SIZE bytes

nit-picking - the list of parameters should normally be at the
start of the docs comment, immediately after the function name,
and then the description follows

Ok, done -> see v13


With that change made:

  Reviewed-by: Daniel P. BerrangĂ© <[email protected]>
  Acked-by: Daniel P. BerrangĂ© <[email protected]>


Thanks for your review.



With regards,
Daniel

Reply via email to