You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I modified the code to drop all specksmall and tiny, and it still passes works properly, I then change the plaintext so that it matches the first bytes I want to send over a rmf95. It then fails I modified the code to show the encrypted array, and the decrypted array. I assume the encrypted array is correct, but the decrypted array matches the original plaintext! Where is it getting the old array from? I then wrote this sketch to a different samd21 that never had the original plaintext and it still serial prints the old array I don't know where its getting it from. following is the original struct, then my modified TestSpeck.ino and the serial output. Thanks for your help.
THE ORIGINAL UNMODIFIED PARTS.........................................................................................
THIS IS THE END OF THE SKETCH.................................................................................................................................
State Sizes:
Speck ... 288
Speck Test Vectors:
Speck-128-ECB Encryption ... 68DC68CAE751527E564EB93FBD776A Failed
Speck-128-ECB Decryption ... 6C617669757165207469206564616D20 Failed
Speck Performance Tests:
Speck-128-ECB Set Key ... 89.00us per operation, 11235.90 per second
Speck-128-ECB Encrypt ... 2.88us per byte, 346724.11 bytes per second
Speck-128-ECB Decrypt ... 3.29us per byte, 303831.31 bytes per second
The text was updated successfully, but these errors were encountered:
I modified the code to drop all specksmall and tiny, and it still passes works properly, I then change the plaintext so that it matches the first bytes I want to send over a rmf95. It then fails I modified the code to show the encrypted array, and the decrypted array. I assume the encrypted array is correct, but the decrypted array matches the original plaintext! Where is it getting the old array from? I then wrote this sketch to a different samd21 that never had the original plaintext and it still serial prints the old array I don't know where its getting it from. following is the original struct, then my modified TestSpeck.ino and the serial output. Thanks for your help.
THE ORIGINAL UNMODIFIED PARTS.........................................................................................
// Define the test vectors from http://eprint.iacr.org/2013/404
static TestVector const testVectorSpeck128 = {
.name = "Speck-128-ECB",
.key = {0x0f, 0x0e, 0x0d, 0x0c, 0x0b, 0x0a, 0x09, 0x08,
0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00},
.plaintext = {0x6c, 0x61, 0x76, 0x69, 0x75, 0x71, 0x65, 0x20,
0x74, 0x69, 0x20, 0x65, 0x64, 0x61, 0x6d, 0x20},
.ciphertext = {0xa6, 0x5d, 0x98, 0x51, 0x79, 0x78, 0x32, 0x65,
0x78, 0x60, 0xfe, 0xdf, 0x5c, 0x57, 0x0d, 0x18}
};
MY MODIFIED TESTSPECK.INO......................................................................................................
/*
*/
/*
This example runs tests on the Speck implementation to verify correct behaviour.
*/
#include <Crypto.h>
#include <Speck.h>
#include <string.h>
struct TestVector
{
const char *name;
byte key[16];
byte plaintext[16];
byte ciphertext[16];
};
// Define the test vectors from http://eprint.iacr.org/2013/404
static TestVector const testVectorSpeck128 = {
.name = "Speck-128-ECB",
.key = {0x0f, 0x0e, 0x0d, 0x0c, 0x0b, 0x0a, 0x09, 0x08,
0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00},
.plaintext = {0x0B, 0x89, 0xA4, 0xC2, 0x6B, 0xC9, 0xA0, 0x6C,
0x1A, 0xD4, 0xC0, 0xB5, 0xFC, 0x6E, 0x83, 0xD2},
.ciphertext = {0xa6, 0x5d, 0x98, 0x51, 0x79, 0x78, 0x32, 0x65,
0x78, 0x60, 0xfe, 0xdf, 0x5c, 0x57, 0x0d, 0x18}
};
Speck speck;
byte buffer[16];
void testCipher(BlockCipher *cipher, const struct TestVector *test, size_t keySize, bool decryption = true)
{
crypto_feed_watchdog();
}
void perfCipher(BlockCipher *cipher, const struct TestVector *test, size_t keySize, bool decryption = true)
{
unsigned long start;
unsigned long elapsed;
int count;
// if (!decryption) {
// Serial.println();
// return;
// }
}
void setup()
{
Serial.begin(115200);
}
void loop()
{
Serial.println("State Sizes:");
Serial.print("Speck ... ");
Serial.println(sizeof(Speck));
}
THIS IS THE END OF THE SKETCH.................................................................................................................................
State Sizes:
Speck ... 288
Speck Test Vectors:
Speck-128-ECB Encryption ... 68DC68CAE751527E564EB93FBD776A Failed
Speck-128-ECB Decryption ... 6C617669757165207469206564616D20 Failed
Speck Performance Tests:
Speck-128-ECB Set Key ... 89.00us per operation, 11235.90 per second
Speck-128-ECB Encrypt ... 2.88us per byte, 346724.11 bytes per second
Speck-128-ECB Decrypt ... 3.29us per byte, 303831.31 bytes per second
The text was updated successfully, but these errors were encountered: