4 This project is just an Arduino ready extract from the [AVR-Crypto-Lib](https://github.com/cantora/avr-crypto-lib).
6 It only packages the ASM implementations of AES into a library ready to use in
9 See the LICENSE file for details of the GPLv3 license in which the AVR-Crypo-Lib
16 - Download the files in this repository (using either clone or the download button)
17 - Copy the `AESLib` folder into `libraries` folder (same level as your `sketch` folder)
18 - add `#include <AESLib.h>` in your sketch.
24 At the moment only 128bit keys are supported, the blocksize is also fixed at 128bit.
25 This means that the key array and possible iv array should contain exactly 16 bytes (`uint8_t` or `byte`).
26 Moreover the amount of bytes to encrypt should be mod 16.
27 (this means you have to take care of padding yourself).
29 The library supports 3 kinds of operations.
31 1. single block encryption/decryption
32 - multiple block encryption/decryption using CBC (single call)
33 - multiple block encryption/decryption using CBC (multiple calls)
35 The single block enc/decryption are the following methods:
38 void aes128_enc_single(const uint8_t* key, void* data);
39 void aes128_dec_single(const uint8_t* key, void* data);
46 uint8_t key[] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
47 char data[] = "0123456789012345"; //16 chars == 16 bytes
48 aes128_enc_single(key, data);
49 Serial.print("encrypted:");
51 aes128_dec_single(key, data);
52 Serial.print("decrypted:");
56 Usage example for AES256:
60 uint8_t key[] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31};
61 char data[] = "0123456789012345";
62 aes256_enc_single(key, data);
63 Serial.print("encrypted:");
65 aes256_dec_single(key, data);
66 Serial.print("decrypted:");