Skip to content

Commit 6dc0ddc

Browse files
committed
renamed macro for enabling aes neon instruction
1 parent 4403bb8 commit 6dc0ddc

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

AES.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
#include <iostream>
55

6-
#if defined(USE_ARM_NEON_AES)
6+
#if defined(USE_NEON_AES)
77
#ifndef HARDWARE_ACCELERATION_ARM_NEON_AES
88
#define HARDWARE_ACCELERATION_ARM_NEON_AES
99
#endif
@@ -30,7 +30,7 @@
3030
#endif
3131

3232
#if (defined(_WIN32) || defined(_WIN64) || defined(__x86_64) || defined(__x86_64__) || defined(__amd64) || defined(__amd64__)) && \
33-
!defined(USE_CXX_AES) && !defined(USE_ARM_NEON_AES)
33+
!defined(USE_CXX_AES) && !defined(USE_NEON_AES)
3434
#ifdef _MSC_VER
3535
#include <intrin.h>
3636
#endif

README.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,14 @@
22

33
![tests](https://github.com/mrdcvlsc/AES/actions/workflows/tests.yml/badge.svg)
44

5-
This repository contains a **single header file C++ library** that provides AES encryption and decryption functionality. The library _**supports**_ both a **pure C++** implementation and optimized implementations that leverage **hardware acceleration technologies**, such as `AES-NI` for `x86-64` architectures and `ARM NEON` for `ARM` architectures.
5+
This repository contains a **single header file C++** that provides AES encryption and decryption function that _**supports**_ both a **pure C++** implementation and optimized implementations that leverage **hardware acceleration technologies** such as; `AES-NI` for `x86-64` architectures and `ARM NEON` for `ARM` architectures.
66

7-
**Please note** that this library **focuses solely** on the **encryption** and **decryption** of **AES blocks** and _**does not include padding functions or encryption modes**_. You may need to incorporate additional functions or libraries to handle padding and implement specific encryption modes, such as CBC or CTR.
7+
> [!IMPORTANT]
8+
> This library **focuses solely** on the **encryption** and **decryption** of **AES blocks** and _**does not include padding functions or block cipher encryption modes**_.
9+
>
10+
> You need to code additional functions or incorporate libraries to handle padding and encryption modes such as CBC or CTR.
11+
>
12+
> Here is a [CLI program for File Encryption](https://github.com/mrdcvlsc/bethela/blob/main/main.cpp) that uses some of the modules that I wrote ([AES](https://github.com/mrdcvlsc/AES), [BytePadding](https://github.com/mrdcvlsc/BytePadding), [BlockCipherModes](https://github.com/mrdcvlsc/BlockCipherModes)) which can be used as an example.
813
914
-----------
1015

@@ -38,7 +43,7 @@ To gain a speed-up performance, add the following flag when compiling for **`aar
3843

3944
_e.g. modern android devices_.
4045

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

4348
**CMake: `AES_IMPL=neon`**
4449

@@ -110,7 +115,7 @@ if("${AES_IMPL}" STREQUAL "aesni")
110115
target_compile_options(main PRIVATE -maes)
111116
endif()
112117
elseif("${AES_IMPL}" STREQUAL "neon")
113-
target_compile_definitions(main PUBLIC USE_ARM_NEON_AES)
118+
target_compile_definitions(main PUBLIC USE_NEON_AES)
114119
target_compile_options(main PRIVATE -march=armv8-a+crypto)
115120
elseif("${AES_IMPL}" STREQUAL "portable")
116121
target_compile_definitions(main PUBLIC USE_CXX_AES)
@@ -146,5 +151,5 @@ The value of `<CHOSEN_AES>` could be `aesni`, `neon` or `portable`, .
146151
3. **comple with [Arm-NEON-AES]**
147152

148153
```
149-
g++ -o sample.exe sample.cpp -D USE_ARM_NEON_AES -march=armv8-a+crypto -O3
154+
g++ -o sample.exe sample.cpp -D USE_NEON_AES -march=armv8-a+crypto -O3
150155
```

makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ COMPILATION_MSG="compiling AES-NI version"
3434
DFLAGS:=-D USE_INTEL_AESNI -maes
3535
else ifeq ($(VERSION), neon)
3636
COMPILATION_MSG="compiling AES aarch64 neon version"
37-
DFLAGS:=-D USE_ARM_NEON_AES -march=armv8-a+crypto
37+
DFLAGS:=-D USE_NEON_AES -march=armv8-a+crypto
3838
endif
3939

4040
########################## type ##########################

0 commit comments

Comments
 (0)