7 //#include "./printf.h"
13 const int size_mesg = 256;
15 uint8_t key[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15};
18 void printArray(byte *mes, int n) {
19 for (byte i = 0; i < n; i++) {
28 // put your setup code here, to run once:
33 // put your main code here, to run repeatedly:
35 byte plain[size_mesg];
38 for (int i = 0; i < size_mesg; i++) {
39 plain[i] = random(255);
42 //Serial.print("plain :");
43 // printArray(plain,size_mesg);
47 unsigned long ms1 = micros ();
48 for(int i=0;i<size_mesg;i+=16) {
49 aes128_enc_single(key, &plain[i]);
51 Serial.print("Encryption took: ");
52 Serial.println(micros() - ms1);
53 //Serial.print("encrypted:");
54 //printArray(plain,size_mesg);
57 for(int i=0;i<size_mesg;i+=16) {
58 aes128_dec_single(key, &plain[i]);
60 Serial.print("Decryption took: ");
61 Serial.println(micros() - ms1);
62 //Serial.print("decrypted:");
63 //printArray(plain,size_mesg);