llsec: Fixed style issues in CCM*

This commit is contained in:
Konrad Krentz 2015-07-01 07:00:14 -07:00 committed by kkrentz
parent b522c042ec
commit c656a4d1c5
7 changed files with 174 additions and 96 deletions

View file

@ -56,8 +56,8 @@ test_sec_lvl_6()
0xC4 , 0xC5 , 0xC6 , 0xC7 ,
0xC8 , 0xC9 , 0xCA , 0xCB ,
0xCC , 0xCD , 0xCE , 0xCF };
uint8_t extended_source_address[8] = { 0xAC , 0xDE , 0x48 , 0x00 ,
0x00 , 0x00 , 0x00 , 0x01 };
linkaddr_t source_address = {{ 0xAC , 0xDE , 0x48 , 0x00 ,
0x00 , 0x00 , 0x00 , 0x01 }};
uint8_t data[30] = { 0x2B , 0xDC , 0x84 , 0x21 , 0x43 ,
/* Destination Address */
0x02 , 0x00 , 0x00 , 0x00 , 0x00 , 0x48 , 0xDE , 0xAC ,
@ -87,7 +87,7 @@ test_sec_lvl_6()
packetbuf_hdrreduce(29);
CCM_STAR.set_key(key);
ccm_star_mic_packetbuf(extended_source_address, mic, LLSEC802154_MIC_LENGTH);
ccm_star_packetbuf_mic(&source_address, mic, LLSEC802154_MIC_LENGTH);
if(memcmp(mic, oracle, LLSEC802154_MIC_LENGTH) == 0) {
printf("Success\n");
@ -97,7 +97,7 @@ test_sec_lvl_6()
printf("Testing encryption ... ");
ccm_star_ctr_packetbuf(extended_source_address);
ccm_star_packetbuf_ctr(&source_address);
if(((uint8_t *) packetbuf_hdrptr())[29] == 0xD8) {
printf("Success\n");
} else {
@ -105,7 +105,7 @@ test_sec_lvl_6()
}
printf("Testing decryption ... ");
ccm_star_ctr_packetbuf(extended_source_address);
ccm_star_packetbuf_ctr(&source_address);
if(((uint8_t *) packetbuf_hdrptr())[29] == 0xCE) {
printf("Success\n");
} else {

View file

@ -86,8 +86,8 @@ test_sec_lvl_2()
0xC4 , 0xC5 , 0xC6 , 0xC7 ,
0xC8 , 0xC9 , 0xCA , 0xCB ,
0xCC , 0xCD , 0xCE , 0xCF };
uint8_t extended_source_address[8] = { 0xAC , 0xDE , 0x48 , 0x00 ,
0x00 , 0x00 , 0x00 , 0x01 };
linkaddr_t source_address = {{ 0xAC , 0xDE , 0x48 , 0x00 ,
0x00 , 0x00 , 0x00 , 0x01 }};
uint8_t data[26] = { 0x08 , 0xD0 , 0x84 , 0x21 , 0x43 ,
/* Source Address */
0x01 , 0x00 , 0x00 , 0x00 , 0x00 , 0x48 , 0xDE , 0xAC ,
@ -114,7 +114,7 @@ test_sec_lvl_2()
packetbuf_hdrreduce(18);
CCM_STAR.set_key(key);
ccm_star_mic_packetbuf(extended_source_address,mic, LLSEC802154_MIC_LENGTH);
ccm_star_packetbuf_mic(&source_address, mic, LLSEC802154_MIC_LENGTH);
if(memcmp(mic, oracle, LLSEC802154_MIC_LENGTH) == 0) {
printf("Success\n");