aboutsummaryrefslogtreecommitdiff
path: root/include/crypto
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2023-06-02 00:57:02 -0700
committerRichard Henderson <richard.henderson@linaro.org>2023-07-08 07:30:17 +0100
commit192fa84986a6e060f353ed491fe635ccd960876e (patch)
treed384b407255dbebe1e3b1c7c35ca28ccfda7f2b5 /include/crypto
parent6b0a96ce3a405ef4676e1fa853f2c649dc25c2b4 (diff)
downloadqemu-192fa84986a6e060f353ed491fe635ccd960876e.zip
qemu-192fa84986a6e060f353ed491fe635ccd960876e.tar.gz
qemu-192fa84986a6e060f353ed491fe635ccd960876e.tar.bz2
crypto: Add aesdec_ISB_ISR_AK
Add a primitive for InvSubBytes + InvShiftRows + AddRoundKey. Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> 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 b85db1a..dcf098b 100644
--- a/include/crypto/aes-round.h
+++ b/include/crypto/aes-round.h
@@ -41,4 +41,25 @@ static inline void aesenc_SB_SR_AK(AESState *r, const AESState *st,
}
}
+/*
+ * Perform InvSubBytes + InvShiftRows + AddRoundKey.
+ */
+
+void aesdec_ISB_ISR_AK_gen(AESState *ret, const AESState *st,
+ const AESState *rk);
+void aesdec_ISB_ISR_AK_genrev(AESState *ret, const AESState *st,
+ const AESState *rk);
+
+static inline void aesdec_ISB_ISR_AK(AESState *r, const AESState *st,
+ const AESState *rk, bool be)
+{
+ if (HAVE_AES_ACCEL) {
+ aesdec_ISB_ISR_AK_accel(r, st, rk, be);
+ } else if (HOST_BIG_ENDIAN == be) {
+ aesdec_ISB_ISR_AK_gen(r, st, rk);
+ } else {
+ aesdec_ISB_ISR_AK_genrev(r, st, rk);
+ }
+}
+
#endif /* CRYPTO_AES_ROUND_H */