From 3fff114b14d819e5308afeff438dc565daf90ba3 Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Wed, 23 Mar 2022 11:24:43 -0700 Subject: [PATCH] crypto: fix aes-128 dec on arm64/cortex-a57 --- .../source/crypto/impl/crypto_aes_impl.arch.arm64.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/libvapours/source/crypto/impl/crypto_aes_impl.arch.arm64.cpp b/libraries/libvapours/source/crypto/impl/crypto_aes_impl.arch.arm64.cpp index af32910e7..35fdf4fa2 100644 --- a/libraries/libvapours/source/crypto/impl/crypto_aes_impl.arch.arm64.cpp +++ b/libraries/libvapours/source/crypto/impl/crypto_aes_impl.arch.arm64.cpp @@ -205,7 +205,7 @@ namespace ams::crypto::impl { AMS_UNUSED(src_size, dst_size); /* Get the key. */ - const u8 *key8 = reinterpret_cast(m_round_keys) + (RoundCount + BlockSize); + const u8 *key8 = reinterpret_cast(m_round_keys) + (RoundCount * BlockSize); /* Read the block. */ uint8x16_t block = vld1q_u8(static_cast(src)); @@ -232,7 +232,7 @@ namespace ams::crypto::impl { } /* Specializations when building specifically for cortex-a57 (or for apple M* processors). */ - #if defined(ATMOSPHERE_CPU_CORTEX_A57) || defined(ATMOSPHERE_OS_MACOS) + #if defined(ATMOSPHERE_CPU_ARM_CORTEX_A57) || defined(ATMOSPHERE_OS_MACOS) namespace {