Skip to content

Commit

Permalink
Chacha20 ARM optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
julek-wolfssl committed Jun 10, 2019
1 parent 02c2782 commit a48981c
Show file tree
Hide file tree
Showing 9 changed files with 3,093 additions and 13 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -321,3 +321,8 @@ doc/pdf

# XCODE Index
IDE/XCODE/Index

# ARM DS-5
\.settings/
\.cproject
\.project
19 changes: 10 additions & 9 deletions IDE/LPCXPRESSO/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@

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

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

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.

Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 4 additions & 0 deletions src/include.am
Original file line number Diff line number Diff line change
Expand Up @@ -340,10 +340,14 @@ src_libwolfssl_la_SOURCES += wolfcrypt/src/rabbit.c
endif

if BUILD_CHACHA
if BUILD_ARMASM
src_libwolfssl_la_SOURCES += wolfcrypt/src/port/arm/armv8-chacha.c
else
src_libwolfssl_la_SOURCES += wolfcrypt/src/chacha.c
if BUILD_INTELASM
src_libwolfssl_la_SOURCES += wolfcrypt/src/chacha_asm.S
endif
endif
if BUILD_POLY1305
src_libwolfssl_la_SOURCES += wolfcrypt/src/chacha20_poly1305.c
endif
Expand Down
5 changes: 5 additions & 0 deletions wolfcrypt/src/chacha.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
*/


#ifdef WOLFSSL_ARMASM
/* implementation is located in wolfcrypt/src/port/arm/armv8-chacha.c */

#else
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
Expand Down Expand Up @@ -316,3 +320,4 @@ int wc_Chacha_Process(ChaCha* ctx, byte* output, const byte* input,

#endif /* HAVE_CHACHA*/

#endif /* WOLFSSL_ARMASM */
3 changes: 3 additions & 0 deletions wolfcrypt/src/include.am
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ EXTRA_DIST += wolfcrypt/src/port/ti/ti-aes.c \
wolfcrypt/src/port/ti/ti-ccm.c \
wolfcrypt/src/port/pic32/pic32mz-crypt.c \
wolfcrypt/src/port/nrf51.c \
wolfcrypt/src/port/arm/armv8-aes.c \
wolfcrypt/src/port/arm/armv8-sha256.c \
wolfcrypt/src/port/arm/armv8-chacha.c \
wolfcrypt/src/port/arm/armv8-curve25519.c \
wolfcrypt/src/port/arm/armv7-curve25519.c \
wolfcrypt/src/port/arm/armv8-sha512-asm.c \
Expand Down
Loading

0 comments on commit a48981c

Please sign in to comment.