1
0
mirror of https://github.com/taigrr/arduinolibs synced 2025-01-18 04:33:12 -08:00

Refactor the low-memory versions of Speck

Rename SpeckLowMemory to SpeckTiny for the encrypt-only version.
SpeckSmall for the version that supports both encryption and decryption.
This commit is contained in:
Rhys Weatherley
2016-02-13 06:59:05 +10:00
parent e66f8fe6e0
commit 33df6a873d
10 changed files with 790 additions and 77 deletions

View File

@@ -27,7 +27,7 @@ This example runs tests on the GCM implementation to verify correct behaviour.
#include <Crypto.h>
#include <AES.h>
#include <Speck.h>
#include <SpeckLowMemory.h>
#include <SpeckTiny.h>
#include <GCM.h>
#include <string.h>
#include <avr/pgmspace.h>
@@ -261,7 +261,7 @@ GCM<AES128> *gcmaes128 = 0;
GCM<AES192> *gcmaes192 = 0;
GCM<AES256> *gcmaes256 = 0;
GCM<Speck> *gcmspeck = 0;
GCM<SpeckLowMemory> *gcmspecklm = 0;
GCM<SpeckTiny> *gcmspecklm = 0;
byte buffer[128];
@@ -516,7 +516,7 @@ void setup()
Serial.println(sizeof(*gcmaes256));
Serial.print("GCM<Speck> ... ");
Serial.println(sizeof(*gcmspeck));
Serial.print("GCM<SpeckLowMemory> ... ");
Serial.print("GCM<SpeckTiny> ... ");
Serial.println(sizeof(*gcmspecklm));
Serial.println();
#endif
@@ -556,8 +556,8 @@ void setup()
gcmspeck = new GCM<Speck>();
perfCipher(gcmspeck, &testVectorGCM16, "GCM-Speck-256");
delete gcmspeck;
gcmspecklm = new GCM<SpeckLowMemory>();
perfCipher(gcmspecklm, &testVectorGCM16, "GCM-SpeckLowMemory-256");
gcmspecklm = new GCM<SpeckTiny>();
perfCipher(gcmspecklm, &testVectorGCM16, "GCM-SpeckTiny-256");
delete gcmspecklm;
#endif
}