Skip to content

Commit e4301bc

Browse files
committed
ARM32 generated files: fix line lengths
Generated ARM32 assembly files no longer have lines with more than 80 characters.
1 parent 2323a5c commit e4301bc

16 files changed

Lines changed: 346 additions & 218 deletions

src/include.am

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -164,13 +164,11 @@ if BUILD_ARMASM
164164
src_libwolfssl@LIBSUFFIX@_la_SOURCES += wolfcrypt/src/port/arm/armv8-aes.c
165165
endif BUILD_ARMASM
166166
if BUILD_ARMASM_NEON
167-
if !BUILD_ARMASM_CRYPTO
168167
if BUILD_ARMASM_INLINE
169168
src_libwolfssl@LIBSUFFIX@_la_SOURCES += wolfcrypt/src/port/arm/armv8-32-aes-asm_c.c
170169
else
171170
src_libwolfssl@LIBSUFFIX@_la_SOURCES += wolfcrypt/src/port/arm/armv8-32-aes-asm.S
172171
endif !BUILD_ARMASM_INLINE
173-
endif !BUILD_ARMASM_CRYPTO
174172
else
175173
if BUILD_ARMASM
176174
if BUILD_ARMASM_INLINE
@@ -336,13 +334,11 @@ if BUILD_ARMASM
336334
src_libwolfssl@LIBSUFFIX@_la_SOURCES += wolfcrypt/src/port/arm/armv8-aes.c
337335
endif BUILD_ARMASM
338336
if BUILD_ARMASM_NEON
339-
if !BUILD_ARMASM_CRYPTO
340337
if BUILD_ARMASM_INLINE
341338
src_libwolfssl@LIBSUFFIX@_la_SOURCES += wolfcrypt/src/port/arm/armv8-32-aes-asm_c.c
342339
else
343340
src_libwolfssl@LIBSUFFIX@_la_SOURCES += wolfcrypt/src/port/arm/armv8-32-aes-asm.S
344341
endif !BUILD_ARMASM_INLINE
345-
endif !BUILD_ARMASM_CRYPTO
346342
else
347343
if BUILD_ARMASM
348344
if BUILD_ARMASM_INLINE
@@ -701,15 +697,13 @@ if BUILD_ARMASM
701697
src_libwolfssl@LIBSUFFIX@_la_SOURCES += wolfcrypt/src/port/arm/armv8-aes.c
702698
endif BUILD_ARMASM
703699
if BUILD_ARMASM_NEON
704-
if !BUILD_ARMASM_CRYPTO
705700
if BUILD_ARMASM_INLINE
706701
src_libwolfssl@LIBSUFFIX@_la_SOURCES += wolfcrypt/src/port/arm/armv8-32-aes-asm_c.c
707702
src_libwolfssl@LIBSUFFIX@_la_SOURCES += wolfcrypt/src/port/arm/thumb2-aes-asm_c.c
708703
else
709704
src_libwolfssl@LIBSUFFIX@_la_SOURCES += wolfcrypt/src/port/arm/armv8-32-aes-asm.S
710705
src_libwolfssl@LIBSUFFIX@_la_SOURCES += wolfcrypt/src/port/arm/thumb2-aes-asm.S
711706
endif !BUILD_ARMASM_INLINE
712-
endif !BUILD_ARMASM_CRYPTO
713707
else
714708
if BUILD_ARMASM
715709
if BUILD_ARMASM_INLINE

wolfcrypt/src/port/arm/armv8-32-aes-asm.S

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121

2222
/* Generated using (from wolfssl):
2323
* cd ../scripts
24-
* ruby ./aes/aes.rb arm32 ../wolfssl/wolfcrypt/src/port/arm/armv8-32-aes-asm.S
24+
* ruby ./aes/aes.rb arm32 \
25+
* ../wolfssl/wolfcrypt/src/port/arm/armv8-32-aes-asm.S
2526
*/
2627

2728
#ifdef HAVE_CONFIG_H

wolfcrypt/src/port/arm/armv8-32-aes-asm_c.c

Lines changed: 128 additions & 62 deletions
Large diffs are not rendered by default.

wolfcrypt/src/port/arm/armv8-32-chacha-asm.S

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121

2222
/* Generated using (from wolfssl):
2323
* cd ../scripts
24-
* ruby ./chacha/chacha.rb arm32 ../wolfssl/wolfcrypt/src/port/arm/armv8-32-chacha-asm.S
24+
* ruby ./chacha/chacha.rb arm32 \
25+
* ../wolfssl/wolfcrypt/src/port/arm/armv8-32-chacha-asm.S
2526
*/
2627

2728
#ifdef HAVE_CONFIG_H

wolfcrypt/src/port/arm/armv8-32-chacha-asm_c.c

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121

2222
/* Generated using (from wolfssl):
2323
* cd ../scripts
24-
* ruby ./chacha/chacha.rb arm32 ../wolfssl/wolfcrypt/src/port/arm/armv8-32-chacha-asm.c
24+
* ruby ./chacha/chacha.rb arm32 \
25+
* ../wolfssl/wolfcrypt/src/port/arm/armv8-32-chacha-asm.c
2526
*/
2627

2728
#ifdef HAVE_CONFIG_H
@@ -72,9 +73,9 @@ void wc_chacha_setiv(word32* x_p, const byte* iv_p, word32 counter_p)
7273
"rev lr, lr\n\t"
7374
#endif /* BIG_ENDIAN_ORDER */
7475
"stm r3, {r4, r12, lr}\n\t"
75-
: [x] "+r" (x), [iv] "+r" (iv), [counter] "+r" (counter)
76+
: [x] "+r" (x), [iv] "+r" (iv), [counter] "+r" (counter)
7677
:
77-
: "memory", "r3", "r12", "lr", "r4", "cc"
78+
: "memory", "cc", "r3", "r12", "lr", "r4"
7879
);
7980
}
8081

@@ -88,7 +89,8 @@ void wc_chacha_setkey(word32* x_p, const byte* key_p, word32 keySz_p)
8889
register word32* x asm ("r0") = (word32*)x_p;
8990
register const byte* key asm ("r1") = (const byte*)key_p;
9091
register word32 keySz asm ("r2") = (word32)keySz_p;
91-
register uint32_t* L_chacha_arm32_constants_c asm ("r3") = (uint32_t*)&L_chacha_arm32_constants;
92+
register uint32_t* L_chacha_arm32_constants_c asm ("r3") =
93+
(uint32_t*)&L_chacha_arm32_constants;
9294

9395
__asm__ __volatile__ (
9496
"subs %[keySz], %[keySz], #16\n\t"
@@ -119,14 +121,16 @@ void wc_chacha_setkey(word32* x_p, const byte* key_p, word32 keySz_p)
119121
"\n"
120122
"L_chacha_arm32_setkey_same_keyb_ytes_%=: \n\t"
121123
"stm %[x], {r4, r5, r12, lr}\n\t"
122-
: [x] "+r" (x), [key] "+r" (key), [keySz] "+r" (keySz), [L_chacha_arm32_constants] "+r" (L_chacha_arm32_constants_c)
124+
: [x] "+r" (x), [key] "+r" (key), [keySz] "+r" (keySz),
125+
[L_chacha_arm32_constants] "+r" (L_chacha_arm32_constants_c)
123126
:
124-
: "memory", "r12", "lr", "r4", "r5", "cc"
127+
: "memory", "cc", "r12", "lr", "r4", "r5"
125128
);
126129
}
127130

128131
#ifdef WOLFSSL_ARMASM_NO_NEON
129-
void wc_chacha_crypt_bytes(ChaCha* ctx_p, byte* c_p, const byte* m_p, word32 len_p)
132+
void wc_chacha_crypt_bytes(ChaCha* ctx_p, byte* c_p, const byte* m_p,
133+
word32 len_p)
130134
{
131135
register ChaCha* ctx asm ("r0") = (ChaCha*)ctx_p;
132136
register byte* c asm ("r1") = (byte*)c_p;
@@ -176,7 +180,7 @@ void wc_chacha_crypt_bytes(ChaCha* ctx_p, byte* c_p, const byte* m_p, word32 len
176180
"strd r6, r7, [sp, #24]\n\t"
177181
#endif
178182
/* Load x[0]..x[12] into registers. */
179-
"ldm lr, {%[ctx], %[c], %[m], %[len], r4, r5, r6, r7, r8, r9, r10, r11, r12}\n\t"
183+
"ldm lr, {r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, r12}\n\t"
180184
/* 10x 2 full rounds to perform. */
181185
"mov lr, #10\n\t"
182186
"str lr, [sp, #48]\n\t"
@@ -414,9 +418,9 @@ void wc_chacha_crypt_bytes(ChaCha* ctx_p, byte* c_p, const byte* m_p, word32 len
414418
/* Store in over field of ChaCha. */
415419
"ldr lr, [sp, #32]\n\t"
416420
"add r12, lr, #0x44\n\t"
417-
"stm r12!, {%[ctx], %[c], %[m], %[len], r4, r5, r6, r7}\n\t"
418-
"ldm sp, {%[ctx], %[c], %[m], %[len], r4, r5, r6, r7}\n\t"
419-
"stm r12, {%[ctx], %[c], %[m], %[len], r4, r5, r6, r7}\n\t"
421+
"stm r12!, {r0, r1, r2, r3, r4, r5, r6, r7}\n\t"
422+
"ldm sp, {r0, r1, r2, r3, r4, r5, r6, r7}\n\t"
423+
"stm r12, {r0, r1, r2, r3, r4, r5, r6, r7}\n\t"
420424
#if defined(WOLFSSL_ARM_ARCH) && (WOLFSSL_ARM_ARCH < 7)
421425
"ldr %[m], [sp, #40]\n\t"
422426
"ldr %[len], [sp, #44]\n\t"
@@ -482,13 +486,15 @@ void wc_chacha_crypt_bytes(ChaCha* ctx_p, byte* c_p, const byte* m_p, word32 len
482486
"\n"
483487
"L_chacha_arm32_crypt_done_%=: \n\t"
484488
"add sp, sp, #52\n\t"
485-
: [ctx] "+r" (ctx), [c] "+r" (c), [m] "+r" (m), [len] "+r" (len)
489+
: [ctx] "+r" (ctx), [c] "+r" (c), [m] "+r" (m), [len] "+r" (len)
486490
:
487-
: "memory", "r12", "lr", "r4", "r5", "r6", "r7", "r8", "r9", "r10", "r11", "cc"
491+
: "memory", "cc", "r12", "lr", "r4", "r5", "r6", "r7", "r8", "r9",
492+
"r10", "r11"
488493
);
489494
}
490495

491-
void wc_chacha_use_over(byte* over_p, byte* output_p, const byte* input_p, word32 len_p)
496+
void wc_chacha_use_over(byte* over_p, byte* output_p, const byte* input_p,
497+
word32 len_p)
492498
{
493499
register byte* over asm ("r0") = (byte*)over_p;
494500
register byte* output asm ("r1") = (byte*)output_p;
@@ -553,9 +559,10 @@ void wc_chacha_use_over(byte* over_p, byte* output_p, const byte* input_p, word3
553559
"b L_chacha_arm32_over_byte_loop_%=\n\t"
554560
"\n"
555561
"L_chacha_arm32_over_done_%=: \n\t"
556-
: [over] "+r" (over), [output] "+r" (output), [input] "+r" (input), [len] "+r" (len)
562+
: [over] "+r" (over), [output] "+r" (output), [input] "+r" (input),
563+
[len] "+r" (len)
557564
:
558-
: "memory", "r12", "lr", "r4", "r5", "r6", "r7", "r8", "r9", "cc"
565+
: "memory", "cc", "r12", "lr", "r4", "r5", "r6", "r7", "r8", "r9"
559566
);
560567
}
561568

wolfcrypt/src/port/arm/armv8-32-curve25519.S

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121

2222
/* Generated using (from wolfssl):
2323
* cd ../scripts
24-
* ruby ./x25519/x25519.rb arm32 ../wolfssl/wolfcrypt/src/port/arm/armv8-32-curve25519.S
24+
* ruby ./x25519/x25519.rb arm32 \
25+
* ../wolfssl/wolfcrypt/src/port/arm/armv8-32-curve25519.S
2526
*/
2627

2728
#ifdef HAVE_CONFIG_H

0 commit comments

Comments
 (0)