cc2420-aes.c File Reference

AES encryption functions. More...

#include "contiki.h"
#include "io.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.

Detailed Description

AES encryption functions.

Author:
Adam Dunkels <adam@sics.se>

Definition in file cc2420-aes.c.


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