Skip to content

Commit c3748fd

Browse files
committed
Add ARDUINO_DISABLE_ECCX08
This new compilation flag can be set through ArduinoBearSSLConfig.h and will allow the user to use ArduinoBearSSL without ECCX08. Indeed, the cryptographic operations could be done through the default software implementation or offloaded to another secure element such as an applet compliant with the GSMA IoT SAFE standard. Signed-off-by: Fabrice Fontaine <[email protected]>
1 parent e985450 commit c3748fd

File tree

13 files changed

+91
-2
lines changed

13 files changed

+91
-2
lines changed

README.adoc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ image:https://github.com/{repository-owner}/{repository-name}/workflows/Spell%20
88

99
Port of https://bearssl.org[BearSSL] to Arduino.
1010

11-
This library depends on ArduinoECCX08.
11+
This library depends on ArduinoECCX08. This dependency could be
12+
disabled by defining ARDUINO_DISABLE_ECCX08 in ArduinoBearSSLConfig.h
13+
(see examples).
1214

1315
== License ==
1416

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#ifndef ARDUINO_BEARSSL_CONFIG_H_
2+
#define ARDUINO_BEARSSL_CONFIG_H_
3+
4+
/* Enabling this define allows the usage of ArduinoBearSSL without crypto chip. */
5+
//#define ARDUINO_DISABLE_ECCX08
6+
7+
#endif /* ARDUINO_BEARSSL_CONFIG_H_ */

examples/DES/ArduinoBearSSLConfig.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#ifndef ARDUINO_BEARSSL_CONFIG_H_
2+
#define ARDUINO_BEARSSL_CONFIG_H_
3+
4+
/* Enabling this define allows the usage of ArduinoBearSSL without crypto chip. */
5+
//#define ARDUINO_DISABLE_ECCX08
6+
7+
#endif /* ARDUINO_BEARSSL_CONFIG_H_ */

examples/MD5/ArduinoBearSSLConfig.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#ifndef ARDUINO_BEARSSL_CONFIG_H_
2+
#define ARDUINO_BEARSSL_CONFIG_H_
3+
4+
/* Enabling this define allows the usage of ArduinoBearSSL without crypto chip. */
5+
//#define ARDUINO_DISABLE_ECCX08
6+
7+
#endif /* ARDUINO_BEARSSL_CONFIG_H_ */
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#ifndef ARDUINO_BEARSSL_CONFIG_H_
2+
#define ARDUINO_BEARSSL_CONFIG_H_
3+
4+
/* Enabling this define allows the usage of ArduinoBearSSL without crypto chip. */
5+
//#define ARDUINO_DISABLE_ECCX08
6+
7+
#endif /* ARDUINO_BEARSSL_CONFIG_H_ */

examples/SHA1/ArduinoBearSSLConfig.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#ifndef ARDUINO_BEARSSL_CONFIG_H_
2+
#define ARDUINO_BEARSSL_CONFIG_H_
3+
4+
/* Enabling this define allows the usage of ArduinoBearSSL without crypto chip. */
5+
//#define ARDUINO_DISABLE_ECCX08
6+
7+
#endif /* ARDUINO_BEARSSL_CONFIG_H_ */
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#ifndef ARDUINO_BEARSSL_CONFIG_H_
2+
#define ARDUINO_BEARSSL_CONFIG_H_
3+
4+
/* Enabling this define allows the usage of ArduinoBearSSL without crypto chip. */
5+
//#define ARDUINO_DISABLE_ECCX08
6+
7+
#endif /* ARDUINO_BEARSSL_CONFIG_H_ */
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#ifndef ARDUINO_BEARSSL_CONFIG_H_
2+
#define ARDUINO_BEARSSL_CONFIG_H_
3+
4+
/* Enabling this define allows the usage of ArduinoBearSSL without crypto chip. */
5+
//#define ARDUINO_DISABLE_ECCX08
6+
7+
#endif /* ARDUINO_BEARSSL_CONFIG_H_ */
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#ifndef ARDUINO_BEARSSL_CONFIG_H_
2+
#define ARDUINO_BEARSSL_CONFIG_H_
3+
4+
/* Enabling this define allows the usage of ArduinoBearSSL without crypto chip. */
5+
//#define ARDUINO_DISABLE_ECCX08
6+
7+
#endif /* ARDUINO_BEARSSL_CONFIG_H_ */

src/ArduinoBearSSL.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@
2525
#ifndef _ARDUINO_BEAR_SSL_H_
2626
#define _ARDUINO_BEAR_SSL_H_
2727

28+
#if defined __has_include
29+
# if __has_include (<ArduinoBearSSLConfig.h>)
30+
# include <ArduinoBearSSLConfig.h>
31+
# endif
32+
#endif
33+
2834
#include "BearSSLClient.h"
2935
#include "SHA1.h"
3036
#include "SHA256.h"

0 commit comments

Comments
 (0)