mirror of
https://github.com/taigrr/arduinolibs
synced 2025-01-18 04:33:12 -08:00
Make the Crypto examples work for ESP8266
This commit is contained in:
@@ -30,7 +30,11 @@ This example runs tests on the EAX implementation to verify correct behaviour.
|
||||
#include <Speck.h>
|
||||
#include <SpeckTiny.h>
|
||||
#include <string.h>
|
||||
#if defined(ESP8266)
|
||||
#include <pgmspace.h>
|
||||
#else
|
||||
#include <avr/pgmspace.h>
|
||||
#endif
|
||||
|
||||
#define MAX_PLAINTEXT_LEN 64
|
||||
|
||||
@@ -244,6 +248,8 @@ bool testCipher_N(AuthenticatedCipher *cipher, const struct TestVector *test, si
|
||||
size_t posn, len;
|
||||
uint8_t tag[16];
|
||||
|
||||
crypto_feed_watchdog();
|
||||
|
||||
cipher->clear();
|
||||
if (!cipher->setKey(test->key, 16)) {
|
||||
Serial.print("setKey ");
|
||||
@@ -344,6 +350,8 @@ void perfCipherSetKey(AuthenticatedCipher *cipher, const struct TestVector *test
|
||||
unsigned long elapsed;
|
||||
int count;
|
||||
|
||||
crypto_feed_watchdog();
|
||||
|
||||
memcpy_P(&testVector, test, sizeof(TestVector));
|
||||
test = &testVector;
|
||||
|
||||
@@ -371,6 +379,8 @@ void perfCipherEncrypt(AuthenticatedCipher *cipher, const struct TestVector *tes
|
||||
unsigned long elapsed;
|
||||
int count;
|
||||
|
||||
crypto_feed_watchdog();
|
||||
|
||||
memcpy_P(&testVector, test, sizeof(TestVector));
|
||||
test = &testVector;
|
||||
|
||||
@@ -399,6 +409,8 @@ void perfCipherDecrypt(AuthenticatedCipher *cipher, const struct TestVector *tes
|
||||
unsigned long elapsed;
|
||||
int count;
|
||||
|
||||
crypto_feed_watchdog();
|
||||
|
||||
memcpy_P(&testVector, test, sizeof(TestVector));
|
||||
test = &testVector;
|
||||
|
||||
@@ -427,6 +439,8 @@ void perfCipherAddAuthData(AuthenticatedCipher *cipher, const struct TestVector
|
||||
unsigned long elapsed;
|
||||
int count;
|
||||
|
||||
crypto_feed_watchdog();
|
||||
|
||||
memcpy_P(&testVector, test, sizeof(TestVector));
|
||||
test = &testVector;
|
||||
|
||||
@@ -456,6 +470,8 @@ void perfCipherComputeTag(AuthenticatedCipher *cipher, const struct TestVector *
|
||||
unsigned long elapsed;
|
||||
int count;
|
||||
|
||||
crypto_feed_watchdog();
|
||||
|
||||
memcpy_P(&testVector, test, sizeof(TestVector));
|
||||
test = &testVector;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user