aboutsummaryrefslogtreecommitdiff
path: root/include/crypto
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2023-06-02 15:40:04 -0700
committerRichard Henderson <richard.henderson@linaro.org>2023-07-08 07:30:17 +0100
commit28e91474ce558bca55c800e7977bab7c66a44abb (patch)
tree59116b6639ced12a6610720bbed9933da52bcd72 /include/crypto
parent15ff15982a13ddf3e03b38ff46277ed90c1f36f9 (diff)
downloadqemu-28e91474ce558bca55c800e7977bab7c66a44abb.zip
qemu-28e91474ce558bca55c800e7977bab7c66a44abb.tar.gz
qemu-28e91474ce558bca55c800e7977bab7c66a44abb.tar.bz2
crypto: Add aesdec_ISB_ISR_AK_IMC
Add a primitive for InvSubBytes + InvShiftRows + AddRoundKey + InvMixColumns. Acked-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'include/crypto')
-rw-r--r--include/crypto/aes-round.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/include/crypto/aes-round.h b/include/crypto/aes-round.h
index 9996f1c..854fb09 100644
--- a/include/crypto/aes-round.h
+++ b/include/crypto/aes-round.h
@@ -120,6 +120,27 @@ static inline void aesdec_ISB_ISR_AK(AESState *r, const AESState *st,
}
/*
+ * Perform InvSubBytes + InvShiftRows + AddRoundKey + InvMixColumns.
+ */
+
+void aesdec_ISB_ISR_AK_IMC_gen(AESState *ret, const AESState *st,
+ const AESState *rk);
+void aesdec_ISB_ISR_AK_IMC_genrev(AESState *ret, const AESState *st,
+ const AESState *rk);
+
+static inline void aesdec_ISB_ISR_AK_IMC(AESState *r, const AESState *st,
+ const AESState *rk, bool be)
+{
+ if (HAVE_AES_ACCEL) {
+ aesdec_ISB_ISR_AK_IMC_accel(r, st, rk, be);
+ } else if (HOST_BIG_ENDIAN == be) {
+ aesdec_ISB_ISR_AK_IMC_gen(r, st, rk);
+ } else {
+ aesdec_ISB_ISR_AK_IMC_genrev(r, st, rk);
+ }
+}
+
+/*
* Perform InvSubBytes + InvShiftRows + InvMixColumns + AddRoundKey.
*/