Contiki 2.6
|
AES encryption functions. More...
#include "contiki.h"
#include "dev/cc2420.h"
#include "dev/cc2420-aes.h"
#include "dev/spi.h"
Go to the source code of this file.
Functions | |
void | cc2420_aes_set_key (const uint8_t *key, int index) |
Setup an AES key. | |
void | cc2420_aes_cipher (uint8_t *data, int len, int key_index) |
Encrypt/decrypt data with AES. |
AES encryption functions.
Definition in file cc2420-aes.c.
void cc2420_aes_cipher | ( | uint8_t * | data, |
int | len, | ||
int | key_index | ||
) |
Encrypt/decrypt data with AES.
data | A pointer to the data to be encrypted/decrypted |
len | The length of the data to be encrypted/decrypted |
key_index | The key to use. The key must have previously been set up with cc2420_aes_set_key(). |
This function encrypts/decrypts data with AES. A pointer to the data is passed as a parameter, and the function overwrites the data with the encrypted data.
Definition at line 96 of file cc2420-aes.c.
void cc2420_aes_set_key | ( | const uint8_t * | key, |
int | index | ||
) |
Setup an AES key.
key | A pointer to a 16-byte AES key |
index | The key index: either 0 or 1. |
This function sets up an AES key with the CC2420 chip. The AES key can later be used with the cc2420_aes_cipher() function to encrypt or decrypt data.
The CC2420 can store two separate keys in its memory. The keys are indexed as 0 or 1 and the key index is given by the 'index' parameter.
Definition at line 66 of file cc2420-aes.c.