]>
git.proxmox.com Git - mirror_qemu.git/blob - include/crypto/aes-round.h
2 * AES round fragments, generic version
3 * SPDX-License-Identifier: GPL-2.0-or-later
5 * Copyright (C) 2023 Linaro, Ltd.
8 #ifndef CRYPTO_AES_ROUND_H
9 #define CRYPTO_AES_ROUND_H
11 /* Hosts with acceleration will usually need a 16-byte vector type. */
12 typedef uint8_t AESStateVec
__attribute__((vector_size(16)));
21 #include "host/crypto/aes-round.h"
24 * Perform SubBytes + ShiftRows + AddRoundKey.
27 void aesenc_SB_SR_AK_gen(AESState
*ret
, const AESState
*st
,
29 void aesenc_SB_SR_AK_genrev(AESState
*ret
, const AESState
*st
,
32 static inline void aesenc_SB_SR_AK(AESState
*r
, const AESState
*st
,
33 const AESState
*rk
, bool be
)
36 aesenc_SB_SR_AK_accel(r
, st
, rk
, be
);
37 } else if (HOST_BIG_ENDIAN
== be
) {
38 aesenc_SB_SR_AK_gen(r
, st
, rk
);
40 aesenc_SB_SR_AK_genrev(r
, st
, rk
);
45 * Perform InvSubBytes + InvShiftRows + AddRoundKey.
48 void aesdec_ISB_ISR_AK_gen(AESState
*ret
, const AESState
*st
,
50 void aesdec_ISB_ISR_AK_genrev(AESState
*ret
, const AESState
*st
,
53 static inline void aesdec_ISB_ISR_AK(AESState
*r
, const AESState
*st
,
54 const AESState
*rk
, bool be
)
57 aesdec_ISB_ISR_AK_accel(r
, st
, rk
, be
);
58 } else if (HOST_BIG_ENDIAN
== be
) {
59 aesdec_ISB_ISR_AK_gen(r
, st
, rk
);
61 aesdec_ISB_ISR_AK_genrev(r
, st
, rk
);
65 #endif /* CRYPTO_AES_ROUND_H */