Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -3367,7 +3367,7 @@ then
armv7m*)
# QEMU doesn't work with armv7-m
AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_ARMASM_THUMB2"
AM_CPPFLAGS="$AM_CPPFLAGS -march=armv7-r -DWOLFSSL_ARMASM_THUMB2 -fomit-frame-pointer -DWOLFSSL_ARMASM_NO_HW_CRYPTO -DWOLFSSL_ARM_ARCH=7"
AM_CPPFLAGS="$AM_CPPFLAGS -march=armv7-r -DWOLFSSL_ARMASM_THUMB2 -DWOLFSSL_ARMASM_NO_HW_CRYPTO -DWOLFSSL_ARM_ARCH=7"
# Include options.h
AM_CCASFLAGS="$AM_CCASFLAGS -DEXTERNAL_OPTS_OPENVPN"
ENABLED_ARMASM_CRYPTO=no
Expand All @@ -3385,15 +3385,15 @@ then
fi
;;
armv6*)
AM_CPPFLAGS="$AM_CPPFLAGS -march=armv6 -fomit-frame-pointer -DWOLFSSL_ARMASM_NO_HW_CRYPTO -DWOLFSSL_ARM_ARCH=6"
AM_CPPFLAGS="$AM_CPPFLAGS -march=armv6 -DWOLFSSL_ARMASM_NO_HW_CRYPTO -DWOLFSSL_ARM_ARCH=6"
AM_CCASFLAGS="$AM_CCASFLAGS -DEXTERNAL_OPTS_OPENVPN"
ENABLED_ARMASM_CRYPTO=no
ENABLED_ARMASM_NEON=no
ENABLED_ARM_32=yes
AC_MSG_NOTICE([32bit ARMv6 found])
;;
armv4*)
AM_CPPFLAGS="$AM_CPPFLAGS -march=armv4 -fomit-frame-pointer -DWOLFSSL_ARMASM_NO_HW_CRYPTO -DWOLFSSL_ARM_ARCH=4"
AM_CPPFLAGS="$AM_CPPFLAGS -march=armv4 -DWOLFSSL_ARMASM_NO_HW_CRYPTO -DWOLFSSL_ARM_ARCH=4"
AM_CCASFLAGS="$AM_CCASFLAGS -DEXTERNAL_OPTS_OPENVPN"
ENABLED_ARMASM_CRYPTO=no
ENABLED_ARMASM_NEON=no
Expand Down
96 changes: 53 additions & 43 deletions wolfcrypt/src/port/arm/armv8-32-aes-asm_c.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
#define __volatile__
#define WOLFSSL_NO_VAR_ASSIGN_REG
#endif /* __ghs__ */

#ifndef NO_AES
#include <wolfssl/wolfcrypt/aes.h>

Expand Down Expand Up @@ -204,9 +205,9 @@ static const word32* L_AES_ARM32_te = L_AES_ARM32_te_data;
#ifdef HAVE_AES_DECRYPT
void AES_invert_key(unsigned char* ks_p, word32 rounds_p);
#ifndef WOLFSSL_NO_VAR_ASSIGN_REG
void AES_invert_key(unsigned char* ks_p, word32 rounds_p)
WC_OMIT_FRAME_POINTER void AES_invert_key(unsigned char* ks_p, word32 rounds_p)
#else
void AES_invert_key(unsigned char* ks, word32 rounds)
WC_OMIT_FRAME_POINTER void AES_invert_key(unsigned char* ks, word32 rounds)
#endif /* WOLFSSL_NO_VAR_ASSIGN_REG */
{
#ifndef WOLFSSL_NO_VAR_ASSIGN_REG
Expand Down Expand Up @@ -441,11 +442,11 @@ static const word32 L_AES_ARM32_rcon[] = {
void AES_set_encrypt_key(const unsigned char* key_p, word32 len_p,
unsigned char* ks_p);
#ifndef WOLFSSL_NO_VAR_ASSIGN_REG
void AES_set_encrypt_key(const unsigned char* key_p, word32 len_p,
unsigned char* ks_p)
WC_OMIT_FRAME_POINTER void AES_set_encrypt_key(const unsigned char* key_p,
word32 len_p, unsigned char* ks_p)
#else
void AES_set_encrypt_key(const unsigned char* key, word32 len,
unsigned char* ks)
WC_OMIT_FRAME_POINTER void AES_set_encrypt_key(const unsigned char* key,
word32 len, unsigned char* ks)
#endif /* WOLFSSL_NO_VAR_ASSIGN_REG */
{
#ifndef WOLFSSL_NO_VAR_ASSIGN_REG
Expand Down Expand Up @@ -976,10 +977,11 @@ void AES_set_encrypt_key(const unsigned char* key, word32 len,
void AES_encrypt_block(const word32* te_p, int nr_p, int len_p,
const word32* ks_p);
#ifndef WOLFSSL_NO_VAR_ASSIGN_REG
void AES_encrypt_block(const word32* te_p, int nr_p, int len_p,
const word32* ks_p)
WC_OMIT_FRAME_POINTER void AES_encrypt_block(const word32* te_p, int nr_p,
int len_p, const word32* ks_p)
#else
void AES_encrypt_block(const word32* te, int nr, int len, const word32* ks)
WC_OMIT_FRAME_POINTER void AES_encrypt_block(const word32* te, int nr, int len,
const word32* ks)
#endif /* WOLFSSL_NO_VAR_ASSIGN_REG */
{
#ifndef WOLFSSL_NO_VAR_ASSIGN_REG
Expand Down Expand Up @@ -1643,11 +1645,12 @@ static const word32* L_AES_ARM32_te_ecb = L_AES_ARM32_te_data;
void AES_ECB_encrypt(const unsigned char* in_p, unsigned char* out_p,
unsigned long len_p, const unsigned char* ks_p, int nr_p);
#ifndef WOLFSSL_NO_VAR_ASSIGN_REG
void AES_ECB_encrypt(const unsigned char* in_p, unsigned char* out_p,
unsigned long len_p, const unsigned char* ks_p, int nr_p)
WC_OMIT_FRAME_POINTER void AES_ECB_encrypt(const unsigned char* in_p,
unsigned char* out_p, unsigned long len_p, const unsigned char* ks_p,
int nr_p)
#else
void AES_ECB_encrypt(const unsigned char* in, unsigned char* out,
unsigned long len, const unsigned char* ks, int nr)
WC_OMIT_FRAME_POINTER void AES_ECB_encrypt(const unsigned char* in,
unsigned char* out, unsigned long len, const unsigned char* ks, int nr)
#endif /* WOLFSSL_NO_VAR_ASSIGN_REG */
{
#ifndef WOLFSSL_NO_VAR_ASSIGN_REG
Expand Down Expand Up @@ -1919,12 +1922,13 @@ void AES_CBC_encrypt(const unsigned char* in_p, unsigned char* out_p,
unsigned long len_p, const unsigned char* ks_p, int nr_p,
unsigned char* iv_p);
#ifndef WOLFSSL_NO_VAR_ASSIGN_REG
void AES_CBC_encrypt(const unsigned char* in_p, unsigned char* out_p,
unsigned long len_p, const unsigned char* ks_p, int nr_p,
unsigned char* iv_p)
WC_OMIT_FRAME_POINTER void AES_CBC_encrypt(const unsigned char* in_p,
unsigned char* out_p, unsigned long len_p, const unsigned char* ks_p,
int nr_p, unsigned char* iv_p)
#else
void AES_CBC_encrypt(const unsigned char* in, unsigned char* out,
unsigned long len, const unsigned char* ks, int nr, unsigned char* iv)
WC_OMIT_FRAME_POINTER void AES_CBC_encrypt(const unsigned char* in,
unsigned char* out, unsigned long len, const unsigned char* ks, int nr,
unsigned char* iv)
#endif /* WOLFSSL_NO_VAR_ASSIGN_REG */
{
#ifndef WOLFSSL_NO_VAR_ASSIGN_REG
Expand Down Expand Up @@ -2217,12 +2221,13 @@ void AES_CTR_encrypt(const unsigned char* in_p, unsigned char* out_p,
unsigned long len_p, const unsigned char* ks_p, int nr_p,
unsigned char* ctr_p);
#ifndef WOLFSSL_NO_VAR_ASSIGN_REG
void AES_CTR_encrypt(const unsigned char* in_p, unsigned char* out_p,
unsigned long len_p, const unsigned char* ks_p, int nr_p,
unsigned char* ctr_p)
WC_OMIT_FRAME_POINTER void AES_CTR_encrypt(const unsigned char* in_p,
unsigned char* out_p, unsigned long len_p, const unsigned char* ks_p,
int nr_p, unsigned char* ctr_p)
#else
void AES_CTR_encrypt(const unsigned char* in, unsigned char* out,
unsigned long len, const unsigned char* ks, int nr, unsigned char* ctr)
WC_OMIT_FRAME_POINTER void AES_CTR_encrypt(const unsigned char* in,
unsigned char* out, unsigned long len, const unsigned char* ks, int nr,
unsigned char* ctr)
#endif /* WOLFSSL_NO_VAR_ASSIGN_REG */
{
#ifndef WOLFSSL_NO_VAR_ASSIGN_REG
Expand Down Expand Up @@ -2516,9 +2521,11 @@ void AES_CTR_encrypt(const unsigned char* in, unsigned char* out,
defined(HAVE_AES_CBC)
void AES_decrypt_block(const word32* td_p, int nr_p, const byte* td4_p);
#ifndef WOLFSSL_NO_VAR_ASSIGN_REG
void AES_decrypt_block(const word32* td_p, int nr_p, const byte* td4_p)
WC_OMIT_FRAME_POINTER void AES_decrypt_block(const word32* td_p, int nr_p,
const byte* td4_p)
#else
void AES_decrypt_block(const word32* td, int nr, const byte* td4)
WC_OMIT_FRAME_POINTER void AES_decrypt_block(const word32* td, int nr,
const byte* td4)
#endif /* WOLFSSL_NO_VAR_ASSIGN_REG */
{
#ifndef WOLFSSL_NO_VAR_ASSIGN_REG
Expand Down Expand Up @@ -3215,11 +3222,12 @@ static const byte L_AES_ARM32_td4[] = {
void AES_ECB_decrypt(const unsigned char* in_p, unsigned char* out_p,
unsigned long len_p, const unsigned char* ks_p, int nr_p);
#ifndef WOLFSSL_NO_VAR_ASSIGN_REG
void AES_ECB_decrypt(const unsigned char* in_p, unsigned char* out_p,
unsigned long len_p, const unsigned char* ks_p, int nr_p)
WC_OMIT_FRAME_POINTER void AES_ECB_decrypt(const unsigned char* in_p,
unsigned char* out_p, unsigned long len_p, const unsigned char* ks_p,
int nr_p)
#else
void AES_ECB_decrypt(const unsigned char* in, unsigned char* out,
unsigned long len, const unsigned char* ks, int nr)
WC_OMIT_FRAME_POINTER void AES_ECB_decrypt(const unsigned char* in,
unsigned char* out, unsigned long len, const unsigned char* ks, int nr)
#endif /* WOLFSSL_NO_VAR_ASSIGN_REG */
{
#ifndef WOLFSSL_NO_VAR_ASSIGN_REG
Expand Down Expand Up @@ -3491,12 +3499,13 @@ void AES_CBC_decrypt(const unsigned char* in_p, unsigned char* out_p,
unsigned long len_p, const unsigned char* ks_p, int nr_p,
unsigned char* iv_p);
#ifndef WOLFSSL_NO_VAR_ASSIGN_REG
void AES_CBC_decrypt(const unsigned char* in_p, unsigned char* out_p,
unsigned long len_p, const unsigned char* ks_p, int nr_p,
unsigned char* iv_p)
WC_OMIT_FRAME_POINTER void AES_CBC_decrypt(const unsigned char* in_p,
unsigned char* out_p, unsigned long len_p, const unsigned char* ks_p,
int nr_p, unsigned char* iv_p)
#else
void AES_CBC_decrypt(const unsigned char* in, unsigned char* out,
unsigned long len, const unsigned char* ks, int nr, unsigned char* iv)
WC_OMIT_FRAME_POINTER void AES_CBC_decrypt(const unsigned char* in,
unsigned char* out, unsigned long len, const unsigned char* ks, int nr,
unsigned char* iv)
#endif /* WOLFSSL_NO_VAR_ASSIGN_REG */
{
#ifndef WOLFSSL_NO_VAR_ASSIGN_REG
Expand Down Expand Up @@ -4163,11 +4172,11 @@ static const word32 L_GCM_gmult_len_r[] = {
void GCM_gmult_len(unsigned char* x_p, const unsigned char** m_p,
const unsigned char* data_p, unsigned long len_p);
#ifndef WOLFSSL_NO_VAR_ASSIGN_REG
void GCM_gmult_len(unsigned char* x_p, const unsigned char** m_p,
const unsigned char* data_p, unsigned long len_p)
WC_OMIT_FRAME_POINTER void GCM_gmult_len(unsigned char* x_p,
const unsigned char** m_p, const unsigned char* data_p, unsigned long len_p)
#else
void GCM_gmult_len(unsigned char* x, const unsigned char** m,
const unsigned char* data, unsigned long len)
WC_OMIT_FRAME_POINTER void GCM_gmult_len(unsigned char* x,
const unsigned char** m, const unsigned char* data, unsigned long len)
#endif /* WOLFSSL_NO_VAR_ASSIGN_REG */
{
#ifndef WOLFSSL_NO_VAR_ASSIGN_REG
Expand Down Expand Up @@ -4774,12 +4783,13 @@ void AES_GCM_encrypt(const unsigned char* in_p, unsigned char* out_p,
unsigned long len_p, const unsigned char* ks_p, int nr_p,
unsigned char* ctr_p);
#ifndef WOLFSSL_NO_VAR_ASSIGN_REG
void AES_GCM_encrypt(const unsigned char* in_p, unsigned char* out_p,
unsigned long len_p, const unsigned char* ks_p, int nr_p,
unsigned char* ctr_p)
WC_OMIT_FRAME_POINTER void AES_GCM_encrypt(const unsigned char* in_p,
unsigned char* out_p, unsigned long len_p, const unsigned char* ks_p,
int nr_p, unsigned char* ctr_p)
#else
void AES_GCM_encrypt(const unsigned char* in, unsigned char* out,
unsigned long len, const unsigned char* ks, int nr, unsigned char* ctr)
WC_OMIT_FRAME_POINTER void AES_GCM_encrypt(const unsigned char* in,
unsigned char* out, unsigned long len, const unsigned char* ks, int nr,
unsigned char* ctr)
#endif /* WOLFSSL_NO_VAR_ASSIGN_REG */
{
#ifndef WOLFSSL_NO_VAR_ASSIGN_REG
Expand Down
27 changes: 17 additions & 10 deletions wolfcrypt/src/port/arm/armv8-32-chacha-asm_c.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,16 @@
#define __volatile__
#define WOLFSSL_NO_VAR_ASSIGN_REG
#endif /* __ghs__ */

#ifdef HAVE_CHACHA
#include <wolfssl/wolfcrypt/chacha.h>

#ifndef WOLFSSL_NO_VAR_ASSIGN_REG
void wc_chacha_setiv(word32* x_p, const byte* iv_p, word32 counter_p)
WC_OMIT_FRAME_POINTER void wc_chacha_setiv(word32* x_p, const byte* iv_p,
word32 counter_p)
#else
void wc_chacha_setiv(word32* x, const byte* iv, word32 counter)
WC_OMIT_FRAME_POINTER void wc_chacha_setiv(word32* x, const byte* iv,
word32 counter)
#endif /* WOLFSSL_NO_VAR_ASSIGN_REG */
{
#ifndef WOLFSSL_NO_VAR_ASSIGN_REG
Expand Down Expand Up @@ -92,9 +95,11 @@ static const word32 L_chacha_arm32_constants[] = {
};

#ifndef WOLFSSL_NO_VAR_ASSIGN_REG
void wc_chacha_setkey(word32* x_p, const byte* key_p, word32 keySz_p)
WC_OMIT_FRAME_POINTER void wc_chacha_setkey(word32* x_p, const byte* key_p,
word32 keySz_p)
#else
void wc_chacha_setkey(word32* x, const byte* key, word32 keySz)
WC_OMIT_FRAME_POINTER void wc_chacha_setkey(word32* x, const byte* key,
word32 keySz)
#endif /* WOLFSSL_NO_VAR_ASSIGN_REG */
{
#ifndef WOLFSSL_NO_VAR_ASSIGN_REG
Expand Down Expand Up @@ -154,10 +159,11 @@ void wc_chacha_setkey(word32* x, const byte* key, word32 keySz)

#ifdef WOLFSSL_ARMASM_NO_NEON
#ifndef WOLFSSL_NO_VAR_ASSIGN_REG
void wc_chacha_crypt_bytes(ChaCha* ctx_p, byte* c_p, const byte* m_p,
word32 len_p)
WC_OMIT_FRAME_POINTER void wc_chacha_crypt_bytes(ChaCha* ctx_p, byte* c_p,
const byte* m_p, word32 len_p)
#else
void wc_chacha_crypt_bytes(ChaCha* ctx, byte* c, const byte* m, word32 len)
WC_OMIT_FRAME_POINTER void wc_chacha_crypt_bytes(ChaCha* ctx, byte* c,
const byte* m, word32 len)
#endif /* WOLFSSL_NO_VAR_ASSIGN_REG */
{
#ifndef WOLFSSL_NO_VAR_ASSIGN_REG
Expand Down Expand Up @@ -529,10 +535,11 @@ void wc_chacha_crypt_bytes(ChaCha* ctx, byte* c, const byte* m, word32 len)
}

#ifndef WOLFSSL_NO_VAR_ASSIGN_REG
void wc_chacha_use_over(byte* over_p, byte* output_p, const byte* input_p,
word32 len_p)
WC_OMIT_FRAME_POINTER void wc_chacha_use_over(byte* over_p, byte* output_p,
const byte* input_p, word32 len_p)
#else
void wc_chacha_use_over(byte* over, byte* output, const byte* input, word32 len)
WC_OMIT_FRAME_POINTER void wc_chacha_use_over(byte* over, byte* output,
const byte* input, word32 len)
#endif /* WOLFSSL_NO_VAR_ASSIGN_REG */
{
#ifndef WOLFSSL_NO_VAR_ASSIGN_REG
Expand Down
Loading