Skip to content

Commit a48981c

Browse files
committed
Chacha20 ARM optimization
1 parent 02c2782 commit a48981c

File tree

9 files changed

+3093
-13
lines changed

9 files changed

+3093
-13
lines changed

.gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -321,3 +321,8 @@ doc/pdf
321321

322322
# XCODE Index
323323
IDE/XCODE/Index
324+
325+
# ARM DS-5
326+
\.settings/
327+
\.cproject
328+
\.project

IDE/LPCXPRESSO/README.md

+10-9
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,16 @@
22

33
To use, install the NXP LPCXpresso IDE and import the projects in a new workspace.
44

5-
1. Run LPCXpresso and choose a workspace location.
6-
2. Right click in the project exporer window and choose Inport.
7-
3. Under General choose "Existing Projects into Workspace".
8-
4. Under "Select root directory" click browse and select the wolfSSL root.
9-
5. Check the "Search for nested projects" box.
10-
5. Make sure "wolfssl" and "wolfssl_example" are checked under "Projects:".
11-
6. Click finish.
12-
7. Download the board and chip LPCOpen package for your platform.
13-
8. Import the projects. For example "lpc_board_nxp_lpcxpresso_1837" and "lpc_chip_18xx" are the ones for the LPC18S37.
5+
1. Change names of `LPCExpresso.project` and `LPCExpresso.cproject` files to `.project` and `.cproject`
6+
2. Run LPCXpresso and choose a workspace location.
7+
3. Right click in the project explorer window and choose Import.
8+
4. Under General choose "Existing Projects into Workspace".
9+
5. Under "Select root directory" click browse and select the wolfSSL root.
10+
6. Check the "Search for nested projects" box.
11+
7. Make sure "wolfssl" and "wolfssl_example" are checked under "Projects:".
12+
8. Click finish.
13+
9. Download the board and chip LPCOpen package for your platform.
14+
10. Import the projects. For example "lpc_board_nxp_lpcxpresso_1837" and "lpc_chip_18xx" are the ones for the LPC18S37.
1415

1516
To setup this example to work with different baords/chips you will need to locate the LPCOpen sources for LPCXpresso on the NXP website and import the board and chip projects. Then you will need to update the "wolfssl_example" project properties to reference these projects (C/C++ General -> Paths and Symbols -> References). See the [LPCOpen v2.xx LPCXpresso quickstart guide for all platforms](https://www.lpcware.com/content/project/lpcopen-platform-nxp-lpc-microcontrollers/lpcopen-v200-quickstart-guides/lpcopen-1) for additional information.
1617

.cproject LPCExpresso.cproject

File renamed without changes.

.project LPCExpresso.project

File renamed without changes.

src/include.am

+4
Original file line numberDiff line numberDiff line change
@@ -340,10 +340,14 @@ src_libwolfssl_la_SOURCES += wolfcrypt/src/rabbit.c
340340
endif
341341

342342
if BUILD_CHACHA
343+
if BUILD_ARMASM
344+
src_libwolfssl_la_SOURCES += wolfcrypt/src/port/arm/armv8-chacha.c
345+
else
343346
src_libwolfssl_la_SOURCES += wolfcrypt/src/chacha.c
344347
if BUILD_INTELASM
345348
src_libwolfssl_la_SOURCES += wolfcrypt/src/chacha_asm.S
346349
endif
350+
endif
347351
if BUILD_POLY1305
348352
src_libwolfssl_la_SOURCES += wolfcrypt/src/chacha20_poly1305.c
349353
endif

wolfcrypt/src/chacha.c

+5
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@
2727
*/
2828

2929

30+
#ifdef WOLFSSL_ARMASM
31+
/* implementation is located in wolfcrypt/src/port/arm/armv8-chacha.c */
32+
33+
#else
3034
#ifdef HAVE_CONFIG_H
3135
#include <config.h>
3236
#endif
@@ -316,3 +320,4 @@ int wc_Chacha_Process(ChaCha* ctx, byte* output, const byte* input,
316320

317321
#endif /* HAVE_CHACHA*/
318322

323+
#endif /* WOLFSSL_ARMASM */

wolfcrypt/src/include.am

+3
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ EXTRA_DIST += wolfcrypt/src/port/ti/ti-aes.c \
4848
wolfcrypt/src/port/ti/ti-ccm.c \
4949
wolfcrypt/src/port/pic32/pic32mz-crypt.c \
5050
wolfcrypt/src/port/nrf51.c \
51+
wolfcrypt/src/port/arm/armv8-aes.c \
52+
wolfcrypt/src/port/arm/armv8-sha256.c \
53+
wolfcrypt/src/port/arm/armv8-chacha.c \
5154
wolfcrypt/src/port/arm/armv8-curve25519.c \
5255
wolfcrypt/src/port/arm/armv7-curve25519.c \
5356
wolfcrypt/src/port/arm/armv8-sha512-asm.c \

0 commit comments

Comments
 (0)