generalised CCM module into lib

introduced convenience functions for LLSEC modules
This commit is contained in:
Justin King-Lacroix 2015-06-08 19:06:40 +01:00
parent 06f7acfd5b
commit 3ce8f26eea
7 changed files with 159 additions and 102 deletions

View file

@ -41,9 +41,10 @@
#include "net/packetbuf.h"
#include "net/netstack.h"
#include "net/llsec/llsec802154.h"
#include "net/llsec/ccm-star.h"
#include "net/llsec/ccm-star-packetbuf.h"
#include "net/mac/frame802154.h"
#include "lib/aes-128.h"
#include "lib/ccm-star.h"
#include <stdio.h>
#include <string.h>
@ -112,8 +113,8 @@ test_sec_lvl_2()
packetbuf_set_attr(PACKETBUF_ATTR_SECURITY_LEVEL, LLSEC802154_SECURITY_LEVEL);
packetbuf_hdrreduce(18);
AES_128.set_key(key);
CCM_STAR.mic(extended_source_address, mic, LLSEC802154_MIC_LENGTH);
CCM_STAR.set_key(key);
ccm_star_mic_packetbuf(extended_source_address,mic, LLSEC802154_MIC_LENGTH);
if(memcmp(mic, oracle, LLSEC802154_MIC_LENGTH) == 0) {
printf("Success\n");