Skip to content

Commit e903a78

Browse files
authored
Merge pull request #107 from andreagilardoni/zephyr
Zephyr support
2 parents b23aac6 + b33af19 commit e903a78

File tree

8 files changed

+31
-18
lines changed

8 files changed

+31
-18
lines changed

.github/workflows/compile-examples.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,18 @@ jobs:
6666
- fqbn: arduino:megaavr:uno2018
6767
type: megaavr
6868
artifact-name-suffix: arduino-megaavr-uno2018
69+
- fqbn: "arduino:zephyr_main:portentah7"
70+
platform-name: arduino:zephyr_main
71+
artifact-name-suffix: arduino-zephyr_main-portentah7
72+
- fqbn: "arduino:zephyr_main:portentac33"
73+
platform-name: arduino:zephyr_main
74+
artifact-name-suffix: arduino-zephyr_main-portentac33
75+
- fqbn: "arduino:zephyr_main:giga"
76+
platform-name: arduino:zephyr_main
77+
artifact-name-suffix: arduino-zephyr_main-giga
78+
- fqbn: "arduino:zephyr_main:opta"
79+
platform-name: arduino:zephyr_main
80+
artifact-name-suffix: arduino-zephyr_main-opta
6981

7082
# make board type-specific customizations to the matrix jobs
7183
include:

src/bearssl/aes_pwr8.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ key_schedule_128(unsigned char *sk, const unsigned char *key)
5252
* of the computation is VMX only. VMX register 0 is VSX
5353
* register 32.
5454
*/
55-
asm volatile (
55+
__asm__ volatile (
5656

5757
/*
5858
* v0 = all-zero word
@@ -161,7 +161,7 @@ key_schedule_192(unsigned char *sk, const unsigned char *key)
161161
* of the computation is VMX only. VMX register 0 is VSX
162162
* register 32.
163163
*/
164-
asm volatile (
164+
__asm__ volatile (
165165

166166
/*
167167
* v0 = all-zero word
@@ -299,7 +299,7 @@ key_schedule_256(unsigned char *sk, const unsigned char *key)
299299
* of the computation is VMX only. VMX register 0 is VSX
300300
* register 32.
301301
*/
302-
asm volatile (
302+
__asm__ volatile (
303303

304304
/*
305305
* v0 = all-zero word

src/bearssl/aes_pwr8_cbcdec.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ cbcdec_128(const unsigned char *sk,
5252
cc1 = 16;
5353
cc2 = 32;
5454
cc3 = 48;
55-
asm volatile (
55+
__asm__ volatile (
5656

5757
/*
5858
* Load subkeys into v0..v10
@@ -223,7 +223,7 @@ cbcdec_192(const unsigned char *sk,
223223
cc1 = 16;
224224
cc2 = 32;
225225
cc3 = 48;
226-
asm volatile (
226+
__asm__ volatile (
227227

228228
/*
229229
* Load subkeys into v0..v12
@@ -406,7 +406,7 @@ cbcdec_256(const unsigned char *sk,
406406
cc1 = 16;
407407
cc2 = 32;
408408
cc3 = 48;
409-
asm volatile (
409+
__asm__ volatile (
410410

411411
/*
412412
* Load subkeys into v0..v14

src/bearssl/aes_pwr8_cbcenc.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ cbcenc_128(const unsigned char *sk,
4949
#endif
5050

5151
cc = 0;
52-
asm volatile (
52+
__asm__ volatile (
5353

5454
/*
5555
* Load subkeys into v0..v10
@@ -153,7 +153,7 @@ cbcenc_192(const unsigned char *sk,
153153
#endif
154154

155155
cc = 0;
156-
asm volatile (
156+
__asm__ volatile (
157157

158158
/*
159159
* Load subkeys into v0..v12
@@ -263,7 +263,7 @@ cbcenc_256(const unsigned char *sk,
263263
#endif
264264

265265
cc = 0;
266-
asm volatile (
266+
__asm__ volatile (
267267

268268
/*
269269
* Load subkeys into v0..v14

src/bearssl/aes_pwr8_ctr.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ ctr_128(const unsigned char *sk, const unsigned char *ivbuf,
5555
cc1 = 16;
5656
cc2 = 32;
5757
cc3 = 48;
58-
asm volatile (
58+
__asm__ volatile (
5959

6060
/*
6161
* Load subkeys into v0..v10
@@ -239,7 +239,7 @@ ctr_192(const unsigned char *sk, const unsigned char *ivbuf,
239239
cc1 = 16;
240240
cc2 = 32;
241241
cc3 = 48;
242-
asm volatile (
242+
__asm__ volatile (
243243

244244
/*
245245
* Load subkeys into v0..v12
@@ -435,7 +435,7 @@ ctr_256(const unsigned char *sk, const unsigned char *ivbuf,
435435
cc1 = 16;
436436
cc2 = 32;
437437
cc3 = 48;
438-
asm volatile (
438+
__asm__ volatile (
439439

440440
/*
441441
* Load subkeys into v0..v14

src/bearssl/aes_pwr8_ctrcbc.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ ctr_ ## size(const unsigned char *sk, \
437437
cc1 = 16; \
438438
cc2 = 32; \
439439
cc3 = 48; \
440-
asm volatile ( \
440+
__asm__ volatile ( \
441441
\
442442
/* \
443443
* Load subkeys into v0..v10 \
@@ -543,7 +543,7 @@ cbcmac_ ## size(const unsigned char *sk, \
543543
long cc; \
544544
\
545545
cc = 0; \
546-
asm volatile ( \
546+
__asm__ volatile ( \
547547
\
548548
/* \
549549
* Load subkeys into v0..v10 \
@@ -603,7 +603,7 @@ ctrcbc_ ## size ## _encrypt(const unsigned char *sk, \
603603
long cc; \
604604
\
605605
cc = 0; \
606-
asm volatile ( \
606+
__asm__ volatile ( \
607607
\
608608
/* \
609609
* Load subkeys into v0..v10 \
@@ -706,7 +706,7 @@ ctrcbc_ ## size ## _decrypt(const unsigned char *sk, \
706706
long cc; \
707707
\
708708
cc = 0; \
709-
asm volatile ( \
709+
__asm__ volatile ( \
710710
\
711711
/* \
712712
* Load subkeys into v0..v10 \

src/bearssl/ghash_pwr8.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ br_ghash_pwr8(void *y, const void *h, const void *data, size_t len)
159159
cc1 = 16;
160160
cc2 = 32;
161161
cc3 = 48;
162-
asm volatile (
162+
__asm__ volatile (
163163
INIT
164164

165165
/*

src/bearssl/i15_montmul.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include "inner.h"
2626

2727
/* see inner.h */
28+
__attribute__((optimize("omit-frame-pointer")))
2829
void
2930
br_i15_montymul(uint16_t *d, const uint16_t *x, const uint16_t *y,
3031
const uint16_t *m, uint16_t m0i)
@@ -47,7 +48,7 @@ br_i15_montymul(uint16_t *d, const uint16_t *x, const uint16_t *y,
4748
uint16_t *limit;
4849

4950
limit = d + len4;
50-
asm volatile (
51+
__asm__ volatile (
5152
"\n\
5253
@ carry: r=r2 \n\
5354
@ multipliers: xu=r3 f=r4 \n\

0 commit comments

Comments
 (0)