#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 |
Referenced by netstack_aes_decrypt(), netstack_aes_encrypt(), and netstack_aes_verify().
#define HEADER_LENGTH |
Referenced by netstack_aes_decrypt(), netstack_aes_encrypt(), and netstack_aes_verify().
#define NONCE_LEN |
Referenced by netstack_aes_decrypt(), netstack_aes_encrypt(), and netstack_aes_verify().
|
static |
References packetbuf_attr_copyfrom(), packetbuf_attr_copyto(), and packetbuf_copyfrom().
Referenced by netstack_aes_decrypt(), and netstack_aes_encrypt().
int netstack_aes_decrypt | ( | void | ) |
References active, aes_ccm_decrypt(), AES_MICLEN, c, copy_packet(), HEADER_LENGTH, i, key, key_set, NONCE_LEN, packetbuf_clear(), packetbuf_dataptr(), packetbuf_totlen(), payload_tmp, printf, ret, and RIMESTATS_ADD.
int netstack_aes_encrypt | ( | void | ) |
References active, aes_ccm_encrypt(), AES_MICLEN, c, copy_packet(), HEADER_LENGTH, i, key, key_set, NONCE_LEN, packetbuf_clear(), packetbuf_compact(), packetbuf_hdrptr(), packetbuf_totlen(), payload_tmp, printf, and ret.
void netstack_aes_set_active | ( | int | a | ) |
References active.
Referenced by PROCESS_THREAD().
void netstack_aes_set_key | ( | const uint8_t * | aes_key | ) |
void netstack_aes_set_master_key | ( | const uint8_t * | aes_key | ) |
References key.
int netstack_aes_verify | ( | void | ) |
References aes_ccm_verify(), AES_MICLEN, c, HEADER_LENGTH, i, key, key_set, NONCE_LEN, packetbuf_dataptr(), packetbuf_totlen(), printf, and ret.
|
static |
Referenced by netstack_aes_decrypt(), netstack_aes_encrypt(), netstack_aes_init(), and netstack_aes_set_active().
|
static |
|
static |
Referenced by netstack_aes_decrypt(), netstack_aes_encrypt(), netstack_aes_init(), netstack_aes_set_key(), and netstack_aes_verify().
struct mac_driver NETSTACK_AES_MAC |
struct network_driver NETSTACK_AES_NETWORK |
|
static |
Referenced by netstack_aes_decrypt(), and netstack_aes_encrypt().