Skip to content

Commit 8125b7c

Browse files
committed
Don't instantiate singletons on resource-constrained hw
1 parent a96bcbe commit 8125b7c

File tree

5 files changed

+9
-4
lines changed

5 files changed

+9
-4
lines changed

src/AES128.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,6 @@ int AES128Class::runDecryption(uint8_t *key, size_t size, uint8_t *input, size_t
4949
return 1;
5050
}
5151

52+
#ifndef ARDUINO_ARCH_MEGAAVR
5253
AES128Class AES128;
54+
#endif

src/ArduinoBearSSL.h

-4
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,6 @@
3333

3434
#include "BearSSLClient.h"
3535
#include "SHA1.h"
36-
#include "SHA256.h"
37-
#include "MD5.h"
38-
#include "AES128.h"
39-
#include "DES.h"
4036

4137
class ArduinoBearSSLClass {
4238
public:

src/DES.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,7 @@ int DESClass::runDecryption(uint8_t *key, size_t size, uint8_t *input, size_t bl
4949
return 1;
5050
}
5151

52+
53+
#ifndef ARDUINO_ARCH_MEGAAVR
5254
DESClass DES;
55+
#endif

src/MD5.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,6 @@ int MD5Class::end(uint8_t *digest)
5454
return 1;
5555
}
5656

57+
#ifndef ARDUINO_ARCH_MEGAAVR
5758
MD5Class MD5;
59+
#endif

src/SHA256.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,6 @@ int SHA256Class::end(uint8_t *digest)
5454
return 1;
5555
}
5656

57+
#ifndef ARDUINO_ARCH_MEGAAVR
5758
SHA256Class SHA256;
59+
#endif

0 commit comments

Comments
 (0)