Skip to content

Commit

Permalink
Merge pull request #8079 from SparkiDev/arm32_asm_regen
Browse files Browse the repository at this point in the history
ARM32 ASM: regeneration after scripts changes
  • Loading branch information
douzzer authored Oct 16, 2024
2 parents 9665434 + fb8d2fc commit 49ad2d5
Show file tree
Hide file tree
Showing 9 changed files with 587 additions and 408 deletions.
56 changes: 28 additions & 28 deletions wolfcrypt/src/port/arm/armv8-32-aes-asm_c.c
Original file line number Diff line number Diff line change
Expand Up @@ -406,9 +406,9 @@ void AES_invert_key(unsigned char* ks_p, word32 rounds_p)
"str r8, [%[ks]], #4\n\t"
"subs r11, r11, #1\n\t"
"bne L_AES_invert_key_mix_loop_%=\n\t"
: [ks] "+r" (ks), [rounds] "+r" (rounds),
[L_AES_ARM32_te] "+r" (L_AES_ARM32_te_c),
[L_AES_ARM32_td] "+r" (L_AES_ARM32_td_c)
: [ks] "+r" (ks), [rounds] "+r" (rounds),
[L_AES_ARM32_te] "+r" (L_AES_ARM32_te_c),
[L_AES_ARM32_td] "+r" (L_AES_ARM32_td_c)
:
: "memory", "cc", "r12", "lr", "r4", "r5", "r6", "r7", "r8", "r9",
"r10", "r11"
Expand Down Expand Up @@ -933,9 +933,9 @@ void AES_set_encrypt_key(const unsigned char* key_p, word32 len_p,
"bne L_AES_set_encrypt_key_loop_128_%=\n\t"
"\n"
"L_AES_set_encrypt_key_end_%=: \n\t"
: [key] "+r" (key), [len] "+r" (len), [ks] "+r" (ks),
[L_AES_ARM32_te] "+r" (L_AES_ARM32_te_c),
[L_AES_ARM32_rcon] "+r" (L_AES_ARM32_rcon_c)
: [key] "+r" (key), [len] "+r" (len), [ks] "+r" (ks),
[L_AES_ARM32_te] "+r" (L_AES_ARM32_te_c),
[L_AES_ARM32_rcon] "+r" (L_AES_ARM32_rcon_c)
:
: "memory", "cc", "r12", "lr", "r5", "r6", "r7", "r8"
);
Expand Down Expand Up @@ -1588,7 +1588,7 @@ void AES_encrypt_block(const uint32_t* te_p, int nr_p, int len_p,
"eor r5, r5, r9\n\t"
"eor r6, r6, r10\n\t"
"eor r7, r7, r11\n\t"
: [te] "+r" (te), [nr] "+r" (nr), [len] "+r" (len), [ks] "+r" (ks)
: [te] "+r" (te), [nr] "+r" (nr), [len] "+r" (len), [ks] "+r" (ks)
:
: "memory", "cc", "lr"
);
Expand Down Expand Up @@ -1841,8 +1841,8 @@ void AES_ECB_encrypt(const unsigned char* in_p, unsigned char* out_p,
"\n"
"L_AES_ECB_encrypt_end_%=: \n\t"
"pop {%[ks]}\n\t"
: [in] "+r" (in), [out] "+r" (out), [len] "+r" (len), [ks] "+r" (ks),
[nr] "+r" (nr), [L_AES_ARM32_te_ecb] "+r" (L_AES_ARM32_te_ecb_c)
: [in] "+r" (in), [out] "+r" (out), [len] "+r" (len), [ks] "+r" (ks),
[nr] "+r" (nr), [L_AES_ARM32_te_ecb] "+r" (L_AES_ARM32_te_ecb_c)
:
: "memory", "cc", "r12", "lr", "r6", "r7", "r8", "r9", "r10", "r11"
);
Expand Down Expand Up @@ -2114,9 +2114,9 @@ void AES_CBC_encrypt(const unsigned char* in_p, unsigned char* out_p,
"L_AES_CBC_encrypt_end_%=: \n\t"
"pop {%[ks], r9}\n\t"
"stm r9, {r4, r5, r6, r7}\n\t"
: [in] "+r" (in), [out] "+r" (out), [len] "+r" (len), [ks] "+r" (ks),
[nr] "+r" (nr), [iv] "+r" (iv),
[L_AES_ARM32_te_cbc] "+r" (L_AES_ARM32_te_cbc_c)
: [in] "+r" (in), [out] "+r" (out), [len] "+r" (len), [ks] "+r" (ks),
[nr] "+r" (nr), [iv] "+r" (iv),
[L_AES_ARM32_te_cbc] "+r" (L_AES_ARM32_te_cbc_c)
:
: "memory", "cc", "r12", "lr", "r7", "r8", "r9", "r10", "r11"
);
Expand Down Expand Up @@ -2389,9 +2389,9 @@ void AES_CTR_encrypt(const unsigned char* in_p, unsigned char* out_p,
"rev r7, r7\n\t"
#endif /* WOLFSSL_ARM_ARCH && WOLFSSL_ARM_ARCH < 6 */
"stm r8, {r4, r5, r6, r7}\n\t"
: [in] "+r" (in), [out] "+r" (out), [len] "+r" (len), [ks] "+r" (ks),
[nr] "+r" (nr), [ctr] "+r" (ctr),
[L_AES_ARM32_te_ctr] "+r" (L_AES_ARM32_te_ctr_c)
: [in] "+r" (in), [out] "+r" (out), [len] "+r" (len), [ks] "+r" (ks),
[nr] "+r" (nr), [ctr] "+r" (ctr),
[L_AES_ARM32_te_ctr] "+r" (L_AES_ARM32_te_ctr_c)
:
: "memory", "cc", "r12", "lr", "r7", "r8", "r9", "r10", "r11"
);
Expand Down Expand Up @@ -3045,7 +3045,7 @@ void AES_decrypt_block(const uint32_t* td_p, int nr_p, const uint8_t* td4_p)
"eor r5, r5, r9\n\t"
"eor r6, r6, r10\n\t"
"eor r7, r7, r11\n\t"
: [td] "+r" (td), [nr] "+r" (nr), [td4] "+r" (td4)
: [td] "+r" (td), [nr] "+r" (nr), [td4] "+r" (td4)
:
: "memory", "cc", "lr"
);
Expand Down Expand Up @@ -3331,9 +3331,9 @@ void AES_ECB_decrypt(const unsigned char* in_p, unsigned char* out_p,
"bne L_AES_ECB_decrypt_loop_block_128_%=\n\t"
"\n"
"L_AES_ECB_decrypt_end_%=: \n\t"
: [in] "+r" (in), [out] "+r" (out), [len] "+r" (len), [ks] "+r" (ks),
[nr] "+r" (nr), [L_AES_ARM32_td_ecb] "+r" (L_AES_ARM32_td_ecb_c),
[L_AES_ARM32_td4] "+r" (L_AES_ARM32_td4_c)
: [in] "+r" (in), [out] "+r" (out), [len] "+r" (len), [ks] "+r" (ks),
[nr] "+r" (nr), [L_AES_ARM32_td_ecb] "+r" (L_AES_ARM32_td_ecb_c),
[L_AES_ARM32_td4] "+r" (L_AES_ARM32_td4_c)
:
: "memory", "cc", "r12", "lr", "r7", "r8", "r9", "r10", "r11"
);
Expand Down Expand Up @@ -3971,10 +3971,10 @@ void AES_CBC_decrypt(const unsigned char* in_p, unsigned char* out_p,
"\n"
"L_AES_CBC_decrypt_end_%=: \n\t"
"pop {%[ks]-r4}\n\t"
: [in] "+r" (in), [out] "+r" (out), [len] "+r" (len), [ks] "+r" (ks),
[nr] "+r" (nr), [iv] "+r" (iv),
[L_AES_ARM32_td_ecb] "+r" (L_AES_ARM32_td_ecb_c),
[L_AES_ARM32_td4] "+r" (L_AES_ARM32_td4_c)
: [in] "+r" (in), [out] "+r" (out), [len] "+r" (len), [ks] "+r" (ks),
[nr] "+r" (nr), [iv] "+r" (iv),
[L_AES_ARM32_td_ecb] "+r" (L_AES_ARM32_td_ecb_c),
[L_AES_ARM32_td4] "+r" (L_AES_ARM32_td4_c)
:
: "memory", "cc", "r12", "lr", "r8", "r9", "r10", "r11"
);
Expand Down Expand Up @@ -4576,8 +4576,8 @@ void GCM_gmult_len(unsigned char* x_p, const unsigned char** m_p,
"subs %[len], %[len], #16\n\t"
"add %[data], %[data], #16\n\t"
"bne L_GCM_gmult_len_start_block_%=\n\t"
: [x] "+r" (x), [m] "+r" (m), [data] "+r" (data), [len] "+r" (len),
[L_GCM_gmult_len_r] "+r" (L_GCM_gmult_len_r_c)
: [x] "+r" (x), [m] "+r" (m), [data] "+r" (data), [len] "+r" (len),
[L_GCM_gmult_len_r] "+r" (L_GCM_gmult_len_r_c)
:
: "memory", "cc", "r12", "lr", "r5", "r6", "r7", "r8", "r9", "r10",
"r11"
Expand Down Expand Up @@ -4840,9 +4840,9 @@ void AES_GCM_encrypt(const unsigned char* in_p, unsigned char* out_p,
"rev r7, r7\n\t"
#endif /* WOLFSSL_ARM_ARCH && WOLFSSL_ARM_ARCH < 6 */
"stm r8, {r4, r5, r6, r7}\n\t"
: [in] "+r" (in), [out] "+r" (out), [len] "+r" (len), [ks] "+r" (ks),
[nr] "+r" (nr), [ctr] "+r" (ctr),
[L_AES_ARM32_te_gcm] "+r" (L_AES_ARM32_te_gcm_c)
: [in] "+r" (in), [out] "+r" (out), [len] "+r" (len), [ks] "+r" (ks),
[nr] "+r" (nr), [ctr] "+r" (ctr),
[L_AES_ARM32_te_gcm] "+r" (L_AES_ARM32_te_gcm_c)
:
: "memory", "cc", "r12", "lr", "r7", "r8", "r9", "r10", "r11"
);
Expand Down
12 changes: 6 additions & 6 deletions wolfcrypt/src/port/arm/armv8-32-chacha-asm_c.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ void wc_chacha_setiv(word32* x_p, const byte* iv_p, word32 counter_p)
"rev lr, lr\n\t"
#endif /* BIG_ENDIAN_ORDER */
"stm r3, {r4, r12, lr}\n\t"
: [x] "+r" (x), [iv] "+r" (iv), [counter] "+r" (counter)
: [x] "+r" (x), [iv] "+r" (iv), [counter] "+r" (counter)
:
: "memory", "cc", "r3", "r12", "lr", "r4"
);
Expand Down Expand Up @@ -119,8 +119,8 @@ void wc_chacha_setkey(word32* x_p, const byte* key_p, word32 keySz_p)
"\n"
"L_chacha_arm32_setkey_same_keyb_ytes_%=: \n\t"
"stm %[x], {r4, r5, r12, lr}\n\t"
: [x] "+r" (x), [key] "+r" (key), [keySz] "+r" (keySz),
[L_chacha_arm32_constants] "+r" (L_chacha_arm32_constants_c)
: [x] "+r" (x), [key] "+r" (key), [keySz] "+r" (keySz),
[L_chacha_arm32_constants] "+r" (L_chacha_arm32_constants_c)
:
: "memory", "cc", "r12", "lr", "r4", "r5"
);
Expand Down Expand Up @@ -484,7 +484,7 @@ void wc_chacha_crypt_bytes(ChaCha* ctx_p, byte* c_p, const byte* m_p,
"\n"
"L_chacha_arm32_crypt_done_%=: \n\t"
"add sp, sp, #52\n\t"
: [ctx] "+r" (ctx), [c] "+r" (c), [m] "+r" (m), [len] "+r" (len)
: [ctx] "+r" (ctx), [c] "+r" (c), [m] "+r" (m), [len] "+r" (len)
:
: "memory", "cc", "r12", "lr", "r4", "r5", "r6", "r7", "r8", "r9",
"r10", "r11"
Expand Down Expand Up @@ -557,8 +557,8 @@ void wc_chacha_use_over(byte* over_p, byte* output_p, const byte* input_p,
"b L_chacha_arm32_over_byte_loop_%=\n\t"
"\n"
"L_chacha_arm32_over_done_%=: \n\t"
: [over] "+r" (over), [output] "+r" (output), [input] "+r" (input),
[len] "+r" (len)
: [over] "+r" (over), [output] "+r" (output), [input] "+r" (input),
[len] "+r" (len)
:
: "memory", "cc", "r12", "lr", "r4", "r5", "r6", "r7", "r8", "r9"
);
Expand Down
Loading

0 comments on commit 49ad2d5

Please sign in to comment.