Microchip® Advanced Software Framework

netstack-aes.c File Reference
#include "net/netstack.h"
#include "net/packetbuf.h"
#include "net/rime/rimestats.h"
#include "netstack-aes.h"
#include "aes-ccm.h"
#include <string.h>
#include <stdio.h>

Macros

#define AES_MICLEN
 
#define HEADER_LENGTH
 
#define NONCE_LEN
 

Functions

static void copy_packet (const uint8_t *data, int datalen)
 
int netstack_aes_decrypt (void)
 
int netstack_aes_encrypt (void)
 
void netstack_aes_init (void)
 
void netstack_aes_set_active (int a)
 
void netstack_aes_set_key (const uint8_t *aes_key)
 
void netstack_aes_set_master_key (const uint8_t *aes_key)
 
int netstack_aes_verify (void)
 

Variables

static uint8_t active = 1
 
static uint8_t key [16]
 
static uint8_t key_set
 
struct mac_driver NETSTACK_AES_MAC
 
struct network_driver NETSTACK_AES_NETWORK
 
static uint8_t payload_tmp [PACKETBUF_SIZE+AES_MICLEN]
 

#define AES_MICLEN
Value:
NETSTACK_AES_MICLEN /* Control level of authentication
security. Less than 4 is considered
insecure. */
#define NETSTACK_AES_MICLEN
Definition: netstack-aes.h:50

Referenced by netstack_aes_decrypt(), netstack_aes_encrypt(), and netstack_aes_verify().

#define HEADER_LENGTH
Value:
16 /* This is actually protocol dependent, but
this setting works for IPv6 with 6lowpan
adaptation over 802.15.4. */

Referenced by netstack_aes_decrypt(), netstack_aes_encrypt(), and netstack_aes_verify().

#define NONCE_LEN
Value:
13 /* We use the 802.15.4 header as a nonce,
fixed at 13 bytes. */

Referenced by netstack_aes_decrypt(), netstack_aes_encrypt(), and netstack_aes_verify().

static void copy_packet ( const uint8_t *  data,
int  datalen 
)
static
void netstack_aes_init ( void  )

References active, key_set, and printf.

void netstack_aes_set_active ( int  a)

References active.

Referenced by PROCESS_THREAD().

void netstack_aes_set_key ( const uint8_t *  aes_key)

References key, and key_set.

Referenced by main().

void netstack_aes_set_master_key ( const uint8_t *  aes_key)

References key.

int netstack_aes_verify ( void  )

uint8_t key[16]
static
Initial value:
= { 0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0 }
struct mac_driver NETSTACK_AES_MAC
struct network_driver NETSTACK_AES_NETWORK
uint8_t payload_tmp[PACKETBUF_SIZE+AES_MICLEN]
static