cc2420-aes.h File Reference

Interface to the CC2420 AES encryption/decryption functions. More...

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.

Detailed Description

Interface to the CC2420 AES encryption/decryption functions.

Author:
Adam Dunkels <adam@sics.se>

Definition in file cc2420-aes.h.


Function Documentation

void cc2420_aes_cipher ( uint8_t *  data,
int  len,
int  key_index 
)

Encrypt/decrypt data with AES.

Parameters:
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 97 of file cc2420-aes.c.

void cc2420_aes_set_key ( const uint8_t *  key,
int  index 
)

Setup an AES key.

Parameters:
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 67 of file cc2420-aes.c.


Generated on Mon Apr 11 14:23:45 2011 for Contiki 2.5 by  doxygen 1.6.1