mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
crypto: Add aesenc_MC
Add a primitive for MixColumns. Acked-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
parent
192fa84986
commit
04e1f30eed
3 changed files with 81 additions and 0 deletions
|
@ -20,6 +20,24 @@ typedef union {
|
|||
|
||||
#include "host/crypto/aes-round.h"
|
||||
|
||||
/*
|
||||
* Perform MixColumns.
|
||||
*/
|
||||
|
||||
void aesenc_MC_gen(AESState *ret, const AESState *st);
|
||||
void aesenc_MC_genrev(AESState *ret, const AESState *st);
|
||||
|
||||
static inline void aesenc_MC(AESState *r, const AESState *st, bool be)
|
||||
{
|
||||
if (HAVE_AES_ACCEL) {
|
||||
aesenc_MC_accel(r, st, be);
|
||||
} else if (HOST_BIG_ENDIAN == be) {
|
||||
aesenc_MC_gen(r, st);
|
||||
} else {
|
||||
aesenc_MC_genrev(r, st);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Perform SubBytes + ShiftRows + AddRoundKey.
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue