Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement hw accelerated AES #10902

Merged
merged 1 commit into from
Aug 2, 2022
Merged

Implement hw accelerated AES #10902

merged 1 commit into from
Aug 2, 2022

Conversation

shuffle2
Copy link
Contributor

@shuffle2 shuffle2 commented Jul 27, 2022

Similar to the SHA1 PR, creates a wrapper around the "generic" path and overrides for arch-specific accelerated implementation.
Unlike SHA1 PR, this changes the API, so callers can manage IV and data buffers better, resulting in less data movement and more clarity about when IV is being updated or not.

In testing, VAES.256 instructions did offer decent further speedup on x64, but at the moment, it doesn't seem worth increasing the instruction set support matrix, maybe in the future.

Time for DolphinTool verify -a sha1 on a wii game stored as gcz, in seconds:

cpu master (no sha1 nor aes) sha1+aes
amd zen2 55 9
qc sq1 69 15

It's restricted to -a sha1 to cut out md5, which is not optimized and would therefor cause all timings to be equivalent to md5 time. Since -a sha1 performs sha1 while reading the disc and over the entire file, such runtime is still dominated by sha1. Before this PR, it would have been dominated by aes.

Since (wii) disc reads involve aes + sha1, and verify operation performs some of the hashing in a somewhat parallel way, the perf differences are more meaningful when considering both aes+sha1 improvements together.

// zen3/VAES(VEX.128).
// It seems like VAES(VEX.256) should be faster?
// TODO Choose value at runtime based on some criteria?
constexpr size_t BLOCK_DEPTH = 10;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

btw this is a value that may have a better default, as I've only tested on zen2+3. Maybe someone can try some speed tests when tweaking it on zen1 or some intel archs?

@AdmiralCurtiss
Copy link
Contributor

Please rebase.

@Tilka Tilka merged commit e62ceab into dolphin-emu:master Aug 2, 2022
@theofficialgman
Copy link

@shuffle2 breaks compilation on arm64 linux (testing on bionic with gcc-11)

multiple of these type of error:

dolphin/Source/Core/Common/Crypto/AES.cpp:267:42: error: cannot convert ‘uint32x4_t’ to ‘const uint8x16_t’ in initialization

larger log

[ 33%] Building C object Externals/mGBA/mgba/CMakeFiles/mgba.dir/src/arm/decoder-thumb.c.o
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp: In instantiation of ‘constexpr void Common::AES::ContextNeon<AesMode>::StoreRoundKey(const u32*) [with long unsigned int RoundIdx = 0; Common::AES::Mode AesMode = Common::AES::Mode::Encrypt; u32 = unsigned int]’:
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp:292:21:   required from ‘Common::AES::ContextNeon<AesMode>::ContextNeon(const u8*) [with Common::AES::Mode AesMode = Common::AES::Mode::Encrypt; u8 = unsigned char]’
/usr/include/c++/11/bits/unique_ptr.h:962:30:   required from ‘typename std::_MakeUniq<_Tp>::__single_object std::make_unique(_Args&& ...) [with _Tp = Common::AES::ContextNeon<Common::AES::Mode::Encrypt>; _Args = {const unsigned char*&}; typename std::_MakeUniq<_Tp>::__single_object = std::unique_ptr<Common::AES::ContextNeon<Common::AES::Mode::Encrypt>, std::default_delete<Common::AES::ContextNeon<Common::AES::Mode::Encrypt> > >]’
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp:395:50:   required from ‘std::unique_ptr<Common::AES::Context> Common::AES::CreateContext(const u8*) [with Common::AES::Mode AesMode = Common::AES::Mode::Encrypt; u8 = unsigned char]’
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp:403:38:   required from here
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp:267:22: note: use ‘-flax-vector-conversions’ to permit conversions between vectors with differing element types or numbers of subparts
  267 |     const uint8x16_t rk_block = vld1q_u32(rk);
      |                      ^~~~~~~~
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp:267:42: error: cannot convert ‘uint32x4_t’ to ‘const uint8x16_t’ in initialization
  267 |     const uint8x16_t rk_block = vld1q_u32(rk);
      |                                 ~~~~~~~~~^~~~
      |                                          |
      |                                          uint32x4_t
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp: In instantiation of ‘constexpr void Common::AES::ContextNeon<AesMode>::StoreRoundKey(const u32*) [with long unsigned int RoundIdx = 1; Common::AES::Mode AesMode = Common::AES::Mode::Encrypt; u32 = unsigned int]’:
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp:306:35:   required from ‘Common::AES::ContextNeon<AesMode>::ContextNeon(const u8*) [with Common::AES::Mode AesMode = Common::AES::Mode::Encrypt; u8 = unsigned char]’
/usr/include/c++/11/bits/unique_ptr.h:962:30:   required from ‘typename std::_MakeUniq<_Tp>::__single_object std::make_unique(_Args&& ...) [with _Tp = Common::AES::ContextNeon<Common::AES::Mode::Encrypt>; _Args = {const unsigned char*&}; typename std::_MakeUniq<_Tp>::__single_object = std::unique_ptr<Common::AES::ContextNeon<Common::AES::Mode::Encrypt>, std::default_delete<Common::AES::ContextNeon<Common::AES::Mode::Encrypt> > >]’
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp:395:50:   required from ‘std::unique_ptr<Common::AES::Context> Common::AES::CreateContext(const u8*) [with Common::AES::Mode AesMode = Common::AES::Mode::Encrypt; u8 = unsigned char]’
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp:403:38:   required from here
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp:267:42: error: cannot convert ‘uint32x4_t’ to ‘const uint8x16_t’ in initialization
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp: In instantiation of ‘constexpr void Common::AES::ContextNeon<AesMode>::StoreRoundKey(const u32*) [with long unsigned int RoundIdx = 2; Common::AES::Mode AesMode = Common::AES::Mode::Encrypt; u32 = unsigned int]’:
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp:307:35:   required from ‘Common::AES::ContextNeon<AesMode>::ContextNeon(const u8*) [with Common::AES::Mode AesMode = Common::AES::Mode::Encrypt; u8 = unsigned char]’
/usr/include/c++/11/bits/unique_ptr.h:962:30:   required from ‘typename std::_MakeUniq<_Tp>::__single_object std::make_unique(_Args&& ...) [with _Tp = Common::AES::ContextNeon<Common::AES::Mode::Encrypt>; _Args = {const unsigned char*&}; typename std::_MakeUniq<_Tp>::__single_object = std::unique_ptr<Common::AES::ContextNeon<Common::AES::Mode::Encrypt>, std::default_delete<Common::AES::ContextNeon<Common::AES::Mode::Encrypt> > >]’
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp:395:50:   required from ‘std::unique_ptr<Common::AES::Context> Common::AES::CreateContext(const u8*) [with Common::AES::Mode AesMode = Common::AES::Mode::Encrypt; u8 = unsigned char]’
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp:403:38:   required from here
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp:267:42: error: cannot convert ‘uint32x4_t’ to ‘const uint8x16_t’ in initialization
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp: In instantiation of ‘constexpr void Common::AES::ContextNeon<AesMode>::StoreRoundKey(const u32*) [with long unsigned int RoundIdx = 3; Common::AES::Mode AesMode = Common::AES::Mode::Encrypt; u32 = unsigned int]’:
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp:308:35:   required from ‘Common::AES::ContextNeon<AesMode>::ContextNeon(const u8*) [with Common::AES::Mode AesMode = Common::AES::Mode::Encrypt; u8 = unsigned char]’
/usr/include/c++/11/bits/unique_ptr.h:962:30:   required from ‘typename std::_MakeUniq<_Tp>::__single_object std::make_unique(_Args&& ...) [with _Tp = Common::AES::ContextNeon<Common::AES::Mode::Encrypt>; _Args = {const unsigned char*&}; typename std::_MakeUniq<_Tp>::__single_object = std::unique_ptr<Common::AES::ContextNeon<Common::AES::Mode::Encrypt>, std::default_delete<Common::AES::ContextNeon<Common::AES::Mode::Encrypt> > >]’
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp:395:50:   required from ‘std::unique_ptr<Common::AES::Context> Common::AES::CreateContext(const u8*) [with Common::AES::Mode AesMode = Common::AES::Mode::Encrypt; u8 = unsigned char]’
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp:403:38:   required from here
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp:267:42: error: cannot convert ‘uint32x4_t’ to ‘const uint8x16_t’ in initialization
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp: In instantiation of ‘constexpr void Common::AES::ContextNeon<AesMode>::StoreRoundKey(const u32*) [with long unsigned int RoundIdx = 4; Common::AES::Mode AesMode = Common::AES::Mode::Encrypt; u32 = unsigned int]’:
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp:309:35:   required from ‘Common::AES::ContextNeon<AesMode>::ContextNeon(const u8*) [with Common::AES::Mode AesMode = Common::AES::Mode::Encrypt; u8 = unsigned char]’
/usr/include/c++/11/bits/unique_ptr.h:962:30:   required from ‘typename std::_MakeUniq<_Tp>::__single_object std::make_unique(_Args&& ...) [with _Tp = Common::AES::ContextNeon<Common::AES::Mode::Encrypt>; _Args = {const unsigned char*&}; typename std::_MakeUniq<_Tp>::__single_object = std::unique_ptr<Common::AES::ContextNeon<Common::AES::Mode::Encrypt>, std::default_delete<Common::AES::ContextNeon<Common::AES::Mode::Encrypt> > >]’
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp:395:50:   required from ‘std::unique_ptr<Common::AES::Context> Common::AES::CreateContext(const u8*) [with Common::AES::Mode AesMode = Common::AES::Mode::Encrypt; u8 = unsigned char]’
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp:403:38:   required from here
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp:267:42: error: cannot convert ‘uint32x4_t’ to ‘const uint8x16_t’ in initialization
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp: In instantiation of ‘constexpr void Common::AES::ContextNeon<AesMode>::StoreRoundKey(const u32*) [with long unsigned int RoundIdx = 5; Common::AES::Mode AesMode = Common::AES::Mode::Encrypt; u32 = unsigned int]’:
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp:310:35:   required from ‘Common::AES::ContextNeon<AesMode>::ContextNeon(const u8*) [with Common::AES::Mode AesMode = Common::AES::Mode::Encrypt; u8 = unsigned char]’
/usr/include/c++/11/bits/unique_ptr.h:962:30:   required from ‘typename std::_MakeUniq<_Tp>::__single_object std::make_unique(_Args&& ...) [with _Tp = Common::AES::ContextNeon<Common::AES::Mode::Encrypt>; _Args = {const unsigned char*&}; typename std::_MakeUniq<_Tp>::__single_object = std::unique_ptr<Common::AES::ContextNeon<Common::AES::Mode::Encrypt>, std::default_delete<Common::AES::ContextNeon<Common::AES::Mode::Encrypt> > >]’
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp:395:50:   required from ‘std::unique_ptr<Common::AES::Context> Common::AES::CreateContext(const u8*) [with Common::AES::Mode AesMode = Common::AES::Mode::Encrypt; u8 = unsigned char]’
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp:403:38:   required from here
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp:267:42: error: cannot convert ‘uint32x4_t’ to ‘const uint8x16_t’ in initialization
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp: In instantiation of ‘constexpr void Common::AES::ContextNeon<AesMode>::StoreRoundKey(const u32*) [with long unsigned int RoundIdx = 6; Common::AES::Mode AesMode = Common::AES::Mode::Encrypt; u32 = unsigned int]’:
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp:311:35:   required from ‘Common::AES::ContextNeon<AesMode>::ContextNeon(const u8*) [with Common::AES::Mode AesMode = Common::AES::Mode::Encrypt; u8 = unsigned char]’
/usr/include/c++/11/bits/unique_ptr.h:962:30:   required from ‘typename std::_MakeUniq<_Tp>::__single_object std::make_unique(_Args&& ...) [with _Tp = Common::AES::ContextNeon<Common::AES::Mode::Encrypt>; _Args = {const unsigned char*&}; typename std::_MakeUniq<_Tp>::__single_object = std::unique_ptr<Common::AES::ContextNeon<Common::AES::Mode::Encrypt>, std::default_delete<Common::AES::ContextNeon<Common::AES::Mode::Encrypt> > >]’
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp:395:50:   required from ‘std::unique_ptr<Common::AES::Context> Common::AES::CreateContext(const u8*) [with Common::AES::Mode AesMode = Common::AES::Mode::Encrypt; u8 = unsigned char]’
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp:403:38:   required from here
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp:267:42: error: cannot convert ‘uint32x4_t’ to ‘const uint8x16_t’ in initialization
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp: In instantiation of ‘constexpr void Common::AES::ContextNeon<AesMode>::StoreRoundKey(const u32*) [with long unsigned int RoundIdx = 7; Common::AES::Mode AesMode = Common::AES::Mode::Encrypt; u32 = unsigned int]’:
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp:312:35:   required from ‘Common::AES::ContextNeon<AesMode>::ContextNeon(const u8*) [with Common::AES::Mode AesMode = Common::AES::Mode::Encrypt; u8 = unsigned char]’
/usr/include/c++/11/bits/unique_ptr.h:962:30:   required from ‘typename std::_MakeUniq<_Tp>::__single_object std::make_unique(_Args&& ...) [with _Tp = Common::AES::ContextNeon<Common::AES::Mode::Encrypt>; _Args = {const unsigned char*&}; typename std::_MakeUniq<_Tp>::__single_object = std::unique_ptr<Common::AES::ContextNeon<Common::AES::Mode::Encrypt>, std::default_delete<Common::AES::ContextNeon<Common::AES::Mode::Encrypt> > >]’
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp:395:50:   required from ‘std::unique_ptr<Common::AES::Context> Common::AES::CreateContext(const u8*) [with Common::AES::Mode AesMode = Common::AES::Mode::Encrypt; u8 = unsigned char]’
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp:403:38:   required from here
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp:267:42: error: cannot convert ‘uint32x4_t’ to ‘const uint8x16_t’ in initialization
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp: In instantiation of ‘constexpr void Common::AES::ContextNeon<AesMode>::StoreRoundKey(const u32*) [with long unsigned int RoundIdx = 8; Common::AES::Mode AesMode = Common::AES::Mode::Encrypt; u32 = unsigned int]’:
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp:313:35:   required from ‘Common::AES::ContextNeon<AesMode>::ContextNeon(const u8*) [with Common::AES::Mode AesMode = Common::AES::Mode::Encrypt; u8 = unsigned char]’
/usr/include/c++/11/bits/unique_ptr.h:962:30:   required from ‘typename std::_MakeUniq<_Tp>::__single_object std::make_unique(_Args&& ...) [with _Tp = Common::AES::ContextNeon<Common::AES::Mode::Encrypt>; _Args = {const unsigned char*&}; typename std::_MakeUniq<_Tp>::__single_object = std::unique_ptr<Common::AES::ContextNeon<Common::AES::Mode::Encrypt>, std::default_delete<Common::AES::ContextNeon<Common::AES::Mode::Encrypt> > >]’
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp:395:50:   required from ‘std::unique_ptr<Common::AES::Context> Common::AES::CreateContext(const u8*) [with Common::AES::Mode AesMode = Common::AES::Mode::Encrypt; u8 = unsigned char]’
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp:403:38:   required from here
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp:267:42: error: cannot convert ‘uint32x4_t’ to ‘const uint8x16_t’ in initialization
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp: In instantiation of ‘constexpr void Common::AES::ContextNeon<AesMode>::StoreRoundKey(const u32*) [with long unsigned int RoundIdx = 9; Common::AES::Mode AesMode = Common::AES::Mode::Encrypt; u32 = unsigned int]’:
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp:314:35:   required from ‘Common::AES::ContextNeon<AesMode>::ContextNeon(const u8*) [with Common::AES::Mode AesMode = Common::AES::Mode::Encrypt; u8 = unsigned char]’
/usr/include/c++/11/bits/unique_ptr.h:962:30:   required from ‘typename std::_MakeUniq<_Tp>::__single_object std::make_unique(_Args&& ...) [with _Tp = Common::AES::ContextNeon<Common::AES::Mode::Encrypt>; _Args = {const unsigned char*&}; typename std::_MakeUniq<_Tp>::__single_object = std::unique_ptr<Common::AES::ContextNeon<Common::AES::Mode::Encrypt>, std::default_delete<Common::AES::ContextNeon<Common::AES::Mode::Encrypt> > >]’
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp:395:50:   required from ‘std::unique_ptr<Common::AES::Context> Common::AES::CreateContext(const u8*) [with Common::AES::Mode AesMode = Common::AES::Mode::Encrypt; u8 = unsigned char]’
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp:403:38:   required from here
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp:267:42: error: cannot convert ‘uint32x4_t’ to ‘const uint8x16_t’ in initialization
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp: In instantiation of ‘constexpr void Common::AES::ContextNeon<AesMode>::StoreRoundKey(const u32*) [with long unsigned int RoundIdx = 10; Common::AES::Mode AesMode = Common::AES::Mode::Encrypt; u32 = unsigned int]’:
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp:315:35:   required from ‘Common::AES::ContextNeon<AesMode>::ContextNeon(const u8*) [with Common::AES::Mode AesMode = Common::AES::Mode::Encrypt; u8 = unsigned char]’
/usr/include/c++/11/bits/unique_ptr.h:962:30:   required from ‘typename std::_MakeUniq<_Tp>::__single_object std::make_unique(_Args&& ...) [with _Tp = Common::AES::ContextNeon<Common::AES::Mode::Encrypt>; _Args = {const unsigned char*&}; typename std::_MakeUniq<_Tp>::__single_object = std::unique_ptr<Common::AES::ContextNeon<Common::AES::Mode::Encrypt>, std::default_delete<Common::AES::ContextNeon<Common::AES::Mode::Encrypt> > >]’
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp:395:50:   required from ‘std::unique_ptr<Common::AES::Context> Common::AES::CreateContext(const u8*) [with Common::AES::Mode AesMode = Common::AES::Mode::Encrypt; u8 = unsigned char]’
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp:403:38:   required from here
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp:267:42: error: cannot convert ‘uint32x4_t’ to ‘const uint8x16_t’ in initialization
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp: In instantiation of ‘constexpr void Common::AES::ContextNeon<AesMode>::StoreRoundKey(const u32*) [with long unsigned int RoundIdx = 0; Common::AES::Mode AesMode = Common::AES::Mode::Decrypt; u32 = unsigned int]’:
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp:292:21:   required from ‘Common::AES::ContextNeon<AesMode>::ContextNeon(const u8*) [with Common::AES::Mode AesMode = Common::AES::Mode::Decrypt; u8 = unsigned char]’
/usr/include/c++/11/bits/unique_ptr.h:962:30:   required from ‘typename std::_MakeUniq<_Tp>::__single_object std::make_unique(_Args&& ...) [with _Tp = Common::AES::ContextNeon<Common::AES::Mode::Decrypt>; _Args = {const unsigned char*&}; typename std::_MakeUniq<_Tp>::__single_object = std::unique_ptr<Common::AES::ContextNeon<Common::AES::Mode::Decrypt>, std::default_delete<Common::AES::ContextNeon<Common::AES::Mode::Decrypt> > >]’
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp:395:50:   required from ‘std::unique_ptr<Common::AES::Context> Common::AES::CreateContext(const u8*) [with Common::AES::Mode AesMode = Common::AES::Mode::Decrypt; u8 = unsigned char]’
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp:408:38:   required from here
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp:267:42: error: cannot convert ‘uint32x4_t’ to ‘const uint8x16_t’ in initialization
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp: In instantiation of ‘constexpr void Common::AES::ContextNeon<AesMode>::StoreRoundKey(const u32*) [with long unsigned int RoundIdx = 1; Common::AES::Mode AesMode = Common::AES::Mode::Decrypt; u32 = unsigned int]’:
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp:306:35:   required from ‘Common::AES::ContextNeon<AesMode>::ContextNeon(const u8*) [with Common::AES::Mode AesMode = Common::AES::Mode::Decrypt; u8 = unsigned char]’
/usr/include/c++/11/bits/unique_ptr.h:962:30:   required from ‘typename std::_MakeUniq<_Tp>::__single_object std::make_unique(_Args&& ...) [with _Tp = Common::AES::ContextNeon<Common::AES::Mode::Decrypt>; _Args = {const unsigned char*&}; typename std::_MakeUniq<_Tp>::__single_object = std::unique_ptr<Common::AES::ContextNeon<Common::AES::Mode::Decrypt>, std::default_delete<Common::AES::ContextNeon<Common::AES::Mode::Decrypt> > >]’
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp:395:50:   required from ‘std::unique_ptr<Common::AES::Context> Common::AES::CreateContext(const u8*) [with Common::AES::Mode AesMode = Common::AES::Mode::Decrypt; u8 = unsigned char]’
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp:408:38:   required from here
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp:267:42: error: cannot convert ‘uint32x4_t’ to ‘const uint8x16_t’ in initialization
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp: In instantiation of ‘constexpr void Common::AES::ContextNeon<AesMode>::StoreRoundKey(const u32*) [with long unsigned int RoundIdx = 2; Common::AES::Mode AesMode = Common::AES::Mode::Decrypt; u32 = unsigned int]’:
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp:307:35:   required from ‘Common::AES::ContextNeon<AesMode>::ContextNeon(const u8*) [with Common::AES::Mode AesMode = Common::AES::Mode::Decrypt; u8 = unsigned char]’
/usr/include/c++/11/bits/unique_ptr.h:962:30:   required from ‘typename std::_MakeUniq<_Tp>::__single_object std::make_unique(_Args&& ...) [with _Tp = Common::AES::ContextNeon<Common::AES::Mode::Decrypt>; _Args = {const unsigned char*&}; typename std::_MakeUniq<_Tp>::__single_object = std::unique_ptr<Common::AES::ContextNeon<Common::AES::Mode::Decrypt>, std::default_delete<Common::AES::ContextNeon<Common::AES::Mode::Decrypt> > >]’
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp:395:50:   required from ‘std::unique_ptr<Common::AES::Context> Common::AES::CreateContext(const u8*) [with Common::AES::Mode AesMode = Common::AES::Mode::Decrypt; u8 = unsigned char]’
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp:408:38:   required from here
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp:267:42: error: cannot convert ‘uint32x4_t’ to ‘const uint8x16_t’ in initialization
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp: In instantiation of ‘constexpr void Common::AES::ContextNeon<AesMode>::StoreRoundKey(const u32*) [with long unsigned int RoundIdx = 3; Common::AES::Mode AesMode = Common::AES::Mode::Decrypt; u32 = unsigned int]’:
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp:308:35:   required from ‘Common::AES::ContextNeon<AesMode>::ContextNeon(const u8*) [with Common::AES::Mode AesMode = Common::AES::Mode::Decrypt; u8 = unsigned char]’
/usr/include/c++/11/bits/unique_ptr.h:962:30:   required from ‘typename std::_MakeUniq<_Tp>::__single_object std::make_unique(_Args&& ...) [with _Tp = Common::AES::ContextNeon<Common::AES::Mode::Decrypt>; _Args = {const unsigned char*&}; typename std::_MakeUniq<_Tp>::__single_object = std::unique_ptr<Common::AES::ContextNeon<Common::AES::Mode::Decrypt>, std::default_delete<Common::AES::ContextNeon<Common::AES::Mode::Decrypt> > >]’
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp:395:50:   required from ‘std::unique_ptr<Common::AES::Context> Common::AES::CreateContext(const u8*) [with Common::AES::Mode AesMode = Common::AES::Mode::Decrypt; u8 = unsigned char]’
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp:408:38:   required from here
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp:267:42: error: cannot convert ‘uint32x4_t’ to ‘const uint8x16_t’ in initialization
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp: In instantiation of ‘constexpr void Common::AES::ContextNeon<AesMode>::StoreRoundKey(const u32*) [with long unsigned int RoundIdx = 4; Common::AES::Mode AesMode = Common::AES::Mode::Decrypt; u32 = unsigned int]’:
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp:309:35:   required from ‘Common::AES::ContextNeon<AesMode>::ContextNeon(const u8*) [with Common::AES::Mode AesMode = Common::AES::Mode::Decrypt; u8 = unsigned char]’
/usr/include/c++/11/bits/unique_ptr.h:962:30:   required from ‘typename std::_MakeUniq<_Tp>::__single_object std::make_unique(_Args&& ...) [with _Tp = Common::AES::ContextNeon<Common::AES::Mode::Decrypt>; _Args = {const unsigned char*&}; typename std::_MakeUniq<_Tp>::__single_object = std::unique_ptr<Common::AES::ContextNeon<Common::AES::Mode::Decrypt>, std::default_delete<Common::AES::ContextNeon<Common::AES::Mode::Decrypt> > >]’
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp:395:50:   required from ‘std::unique_ptr<Common::AES::Context> Common::AES::CreateContext(const u8*) [with Common::AES::Mode AesMode = Common::AES::Mode::Decrypt; u8 = unsigned char]’
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp:408:38:   required from here
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp:267:42: error: cannot convert ‘uint32x4_t’ to ‘const uint8x16_t’ in initialization
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp: In instantiation of ‘constexpr void Common::AES::ContextNeon<AesMode>::StoreRoundKey(const u32*) [with long unsigned int RoundIdx = 5; Common::AES::Mode AesMode = Common::AES::Mode::Decrypt; u32 = unsigned int]’:
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp:310:35:   required from ‘Common::AES::ContextNeon<AesMode>::ContextNeon(const u8*) [with Common::AES::Mode AesMode = Common::AES::Mode::Decrypt; u8 = unsigned char]’
/usr/include/c++/11/bits/unique_ptr.h:962:30:   required from ‘typename std::_MakeUniq<_Tp>::__single_object std::make_unique(_Args&& ...) [with _Tp = Common::AES::ContextNeon<Common::AES::Mode::Decrypt>; _Args = {const unsigned char*&}; typename std::_MakeUniq<_Tp>::__single_object = std::unique_ptr<Common::AES::ContextNeon<Common::AES::Mode::Decrypt>, std::default_delete<Common::AES::ContextNeon<Common::AES::Mode::Decrypt> > >]’
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp:395:50:   required from ‘std::unique_ptr<Common::AES::Context> Common::AES::CreateContext(const u8*) [with Common::AES::Mode AesMode = Common::AES::Mode::Decrypt; u8 = unsigned char]’
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp:408:38:   required from here
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp:267:42: error: cannot convert ‘uint32x4_t’ to ‘const uint8x16_t’ in initialization
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp: In instantiation of ‘constexpr void Common::AES::ContextNeon<AesMode>::StoreRoundKey(const u32*) [with long unsigned int RoundIdx = 6; Common::AES::Mode AesMode = Common::AES::Mode::Decrypt; u32 = unsigned int]’:
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp:311:35:   required from ‘Common::AES::ContextNeon<AesMode>::ContextNeon(const u8*) [with Common::AES::Mode AesMode = Common::AES::Mode::Decrypt; u8 = unsigned char]’
/usr/include/c++/11/bits/unique_ptr.h:962:30:   required from ‘typename std::_MakeUniq<_Tp>::__single_object std::make_unique(_Args&& ...) [with _Tp = Common::AES::ContextNeon<Common::AES::Mode::Decrypt>; _Args = {const unsigned char*&}; typename std::_MakeUniq<_Tp>::__single_object = std::unique_ptr<Common::AES::ContextNeon<Common::AES::Mode::Decrypt>, std::default_delete<Common::AES::ContextNeon<Common::AES::Mode::Decrypt> > >]’
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp:395:50:   required from ‘std::unique_ptr<Common::AES::Context> Common::AES::CreateContext(const u8*) [with Common::AES::Mode AesMode = Common::AES::Mode::Decrypt; u8 = unsigned char]’
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp:408:38:   required from here
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp:267:42: error: cannot convert ‘uint32x4_t’ to ‘const uint8x16_t’ in initialization
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp: In instantiation of ‘constexpr void Common::AES::ContextNeon<AesMode>::StoreRoundKey(const u32*) [with long unsigned int RoundIdx = 7; Common::AES::Mode AesMode = Common::AES::Mode::Decrypt; u32 = unsigned int]’:
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp:312:35:   required from ‘Common::AES::ContextNeon<AesMode>::ContextNeon(const u8*) [with Common::AES::Mode AesMode = Common::AES::Mode::Decrypt; u8 = unsigned char]’
/usr/include/c++/11/bits/unique_ptr.h:962:30:   required from ‘typename std::_MakeUniq<_Tp>::__single_object std::make_unique(_Args&& ...) [with _Tp = Common::AES::ContextNeon<Common::AES::Mode::Decrypt>; _Args = {const unsigned char*&}; typename std::_MakeUniq<_Tp>::__single_object = std::unique_ptr<Common::AES::ContextNeon<Common::AES::Mode::Decrypt>, std::default_delete<Common::AES::ContextNeon<Common::AES::Mode::Decrypt> > >]’
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp:395:50:   required from ‘std::unique_ptr<Common::AES::Context> Common::AES::CreateContext(const u8*) [with Common::AES::Mode AesMode = Common::AES::Mode::Decrypt; u8 = unsigned char]’
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp:408:38:   required from here
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp:267:42: error: cannot convert ‘uint32x4_t’ to ‘const uint8x16_t’ in initialization
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp: In instantiation of ‘constexpr void Common::AES::ContextNeon<AesMode>::StoreRoundKey(const u32*) [with long unsigned int RoundIdx = 8; Common::AES::Mode AesMode = Common::AES::Mode::Decrypt; u32 = unsigned int]’:
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp:313:35:   required from ‘Common::AES::ContextNeon<AesMode>::ContextNeon(const u8*) [with Common::AES::Mode AesMode = Common::AES::Mode::Decrypt; u8 = unsigned char]’
/usr/include/c++/11/bits/unique_ptr.h:962:30:   required from ‘typename std::_MakeUniq<_Tp>::__single_object std::make_unique(_Args&& ...) [with _Tp = Common::AES::ContextNeon<Common::AES::Mode::Decrypt>; _Args = {const unsigned char*&}; typename std::_MakeUniq<_Tp>::__single_object = std::unique_ptr<Common::AES::ContextNeon<Common::AES::Mode::Decrypt>, std::default_delete<Common::AES::ContextNeon<Common::AES::Mode::Decrypt> > >]’
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp:395:50:   required from ‘std::unique_ptr<Common::AES::Context> Common::AES::CreateContext(const u8*) [with Common::AES::Mode AesMode = Common::AES::Mode::Decrypt; u8 = unsigned char]’
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp:408:38:   required from here
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp:267:42: error: cannot convert ‘uint32x4_t’ to ‘const uint8x16_t’ in initialization
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp: In instantiation of ‘constexpr void Common::AES::ContextNeon<AesMode>::StoreRoundKey(const u32*) [with long unsigned int RoundIdx = 9; Common::AES::Mode AesMode = Common::AES::Mode::Decrypt; u32 = unsigned int]’:
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp:314:35:   required from ‘Common::AES::ContextNeon<AesMode>::ContextNeon(const u8*) [with Common::AES::Mode AesMode = Common::AES::Mode::Decrypt; u8 = unsigned char]’
/usr/include/c++/11/bits/unique_ptr.h:962:30:   required from ‘typename std::_MakeUniq<_Tp>::__single_object std::make_unique(_Args&& ...) [with _Tp = Common::AES::ContextNeon<Common::AES::Mode::Decrypt>; _Args = {const unsigned char*&}; typename std::_MakeUniq<_Tp>::__single_object = std::unique_ptr<Common::AES::ContextNeon<Common::AES::Mode::Decrypt>, std::default_delete<Common::AES::ContextNeon<Common::AES::Mode::Decrypt> > >]’
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp:395:50:   required from ‘std::unique_ptr<Common::AES::Context> Common::AES::CreateContext(const u8*) [with Common::AES::Mode AesMode = Common::AES::Mode::Decrypt; u8 = unsigned char]’
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp:408:38:   required from here
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp:267:42: error: cannot convert ‘uint32x4_t’ to ‘const uint8x16_t’ in initialization
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp: In instantiation of ‘constexpr void Common::AES::ContextNeon<AesMode>::StoreRoundKey(const u32*) [with long unsigned int RoundIdx = 10; Common::AES::Mode AesMode = Common::AES::Mode::Decrypt; u32 = unsigned int]’:
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp:315:35:   required from ‘Common::AES::ContextNeon<AesMode>::ContextNeon(const u8*) [with Common::AES::Mode AesMode = Common::AES::Mode::Decrypt; u8 = unsigned char]’
/usr/include/c++/11/bits/unique_ptr.h:962:30:   required from ‘typename std::_MakeUniq<_Tp>::__single_object std::make_unique(_Args&& ...) [with _Tp = Common::AES::ContextNeon<Common::AES::Mode::Decrypt>; _Args = {const unsigned char*&}; typename std::_MakeUniq<_Tp>::__single_object = std::unique_ptr<Common::AES::ContextNeon<Common::AES::Mode::Decrypt>, std::default_delete<Common::AES::ContextNeon<Common::AES::Mode::Decrypt> > >]’
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp:395:50:   required from ‘std::unique_ptr<Common::AES::Context> Common::AES::CreateContext(const u8*) [with Common::AES::Mode AesMode = Common::AES::Mode::Decrypt; u8 = unsigned char]’
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp:408:38:   required from here
/home/aztill/dolphin/Source/Core/Common/Crypto/AES.cpp:267:42: error: cannot convert ‘uint32x4_t’ to ‘const uint8x16_t’ in initialization
[ 33%] Building CXX object Source/Core/Common/CMakeFiles/common.dir/Crypto/SHA1.cpp.o
Source/Core/Common/CMakeFiles/common.dir/build.make:173: recipe for target 'Source/Core/Common/CMakeFiles/common.dir/Crypto/AES.cpp.o' failed
make[2]: *** [Source/Core/Common/CMakeFiles/common.dir/Crypto/AES.cpp.o] Error 1

@shuffle2
Copy link
Contributor Author

shuffle2 commented Aug 3, 2022

Lmao this time I really pasted the entire code into godbolt and checked arm64 gcc so I’m not sure why it differs for you. Maybe they changed intrinsic prototypes between versions or something

@theofficialgman
Copy link

theofficialgman commented Aug 3, 2022

@shuffle2
Copy link
Contributor Author

shuffle2 commented Aug 3, 2022

I didn't say I did not understand the error or the code

@shuffle2 shuffle2 deleted the aes branch August 3, 2022 05:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
5 participants