Skip to content

Commit

Permalink
renamed macro for enabling aes neon instruction
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdcvlsc committed Sep 14, 2023
1 parent 4403bb8 commit acdbf11
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions AES.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include <iostream>

#if defined(USE_ARM_NEON_AES)
#if defined(USE_NEON_AES)
#ifndef HARDWARE_ACCELERATION_ARM_NEON_AES
#define HARDWARE_ACCELERATION_ARM_NEON_AES
#endif
Expand All @@ -30,7 +30,7 @@
#endif

#if (defined(_WIN32) || defined(_WIN64) || defined(__x86_64) || defined(__x86_64__) || defined(__amd64) || defined(__amd64__)) && \
!defined(USE_CXX_AES) && !defined(USE_ARM_NEON_AES)
!defined(USE_CXX_AES) && !defined(USE_NEON_AES)
#ifdef _MSC_VER
#include <intrin.h>
#endif
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ To gain a speed-up performance, add the following flag when compiling for **`aar

_e.g. modern android devices_.

**Additional Compiler Flag: `-D USE_ARM_NEON_AES -march=armv8-a+crypto`**
**Additional Compiler Flag: `-D USE_NEON_AES -march=armv8-a+crypto`**

**CMake: `AES_IMPL=neon`**

Expand Down Expand Up @@ -110,7 +110,7 @@ if("${AES_IMPL}" STREQUAL "aesni")
target_compile_options(main PRIVATE -maes)
endif()
elseif("${AES_IMPL}" STREQUAL "neon")
target_compile_definitions(main PUBLIC USE_ARM_NEON_AES)
target_compile_definitions(main PUBLIC USE_NEON_AES)
target_compile_options(main PRIVATE -march=armv8-a+crypto)
elseif("${AES_IMPL}" STREQUAL "portable")
target_compile_definitions(main PUBLIC USE_CXX_AES)
Expand Down Expand Up @@ -146,5 +146,5 @@ The value of `<CHOSEN_AES>` could be `aesni`, `neon` or `portable`, .
3. **comple with [Arm-NEON-AES]**

```
g++ -o sample.exe sample.cpp -D USE_ARM_NEON_AES -march=armv8-a+crypto -O3
g++ -o sample.exe sample.cpp -D USE_NEON_AES -march=armv8-a+crypto -O3
```
2 changes: 1 addition & 1 deletion makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ COMPILATION_MSG="compiling AES-NI version"
DFLAGS:=-D USE_INTEL_AESNI -maes
else ifeq ($(VERSION), neon)
COMPILATION_MSG="compiling AES aarch64 neon version"
DFLAGS:=-D USE_ARM_NEON_AES -march=armv8-a+crypto
DFLAGS:=-D USE_NEON_AES -march=armv8-a+crypto
endif

########################## type ##########################
Expand Down

0 comments on commit acdbf11

Please sign in to comment.