Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
target/arm: Use aesenc_MC
This implements the AESMC instruction.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
  • Loading branch information
rth7680 committed Jul 9, 2023
1 parent 2a8b545 commit 8b103ed
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion target/arm/tcg/crypto_helper.c
Expand Up @@ -124,7 +124,20 @@ void HELPER(crypto_aesmc)(void *vd, void *vm, uint32_t desc)
intptr_t i, opr_sz = simd_oprsz(desc);

for (i = 0; i < opr_sz; i += 16) {
do_crypto_aesmc(vd + i, vm + i, AES_mc_rot);
AESState *ad = (AESState *)(vd + i);
AESState *st = (AESState *)(vm + i);
AESState t;

/* Our uint64_t are in the wrong order for big-endian. */
if (HOST_BIG_ENDIAN) {
t.d[0] = st->d[1];
t.d[1] = st->d[0];
aesenc_MC(&t, &t, false);
ad->d[0] = t.d[1];
ad->d[1] = t.d[0];
} else {
aesenc_MC(ad, st, false);
}
}
clear_tail(vd, opr_sz, simd_maxsz(desc));
}
Expand Down

0 comments on commit 8b103ed

Please sign in to comment.