#include <AES.h>
+
+#include<AES-128_V10.h>
//#include "./printf.h"
AES aes ;
byte *key = (unsigned char*)"0123456789010123";
-const int size_mesg=256;
+const int size_mesg=64;
+unsigned char NwkSkey[16] = {
+ 0x2B, 0x7E, 0x15, 0x16, 0x28, 0xAE, 0xD2, 0xA6,
+ 0xAB, 0xF7, 0x15, 0x88, 0x09, 0xCF, 0x4F, 0x3C
+};
-
-
+unsigned char AppSkey[16] = {
+ 0x2B, 0x7E, 0x15, 0x16, 0x28, 0xAE, 0xD2, 0xA6,
+ 0xAB, 0xF7, 0x15, 0x88, 0x09, 0xCF, 0x4F, 0x3C
+};
equal=false;
}
}
- printf("CHECK %d\n",equal);
-
+ Serial.print("CHECK ");
+ Serial.println(equal);
+
+ for(int i=0;i<16;i++) {
+ Serial.print(plain[i]);
+ Serial.print(" ");
+ }
+ Serial.println();
+
+ ms = micros ();
+ AES_Encrypt(plain,AppSkey);
+ int time=micros() - ms;
+ Serial.print("new enc took: ");
+ Serial.println(time);
+
+ for(int i=0;i<16;i++) {
+ Serial.print(plain[i]);
+ Serial.print(" ");
+ }
+ Serial.println();
+
+
+
}
void prekey_test ()