Hi all
I have several questions about security. I'm working with CC2420/IEEE154 and
telosb, tinyos 2.1.0.
I'm sorry if my questions are dumb for you.
I have a small application that send a frame to a coordinator.
My goal is encrypt my frame in some way.
First I set my key with the command setKey
(chips/CC2420/Security/CC2420KeysP). It works fine.
Then I want to set the mode like ccm (chips/cc2420/Security/secAMSenderP)
I found this command
command error_t CC2420SecurityMode.setCcm(uint8_t setKey, uint8_t setSkip,
uint8_t size)
{
if (setKey > 1 || (size != 4 && size != 8 && size != 16) || (setSkip >
7)){
return FAIL;
}
if(size == 4)
secLevel = CCM_4; // 5
else if (size == 8)
secLevel = CCM_8; // 6
else if (size == 16)
secLevel = CCM_16; // 7
else
return FAIL;
keyIndex = setKey;
reserved = setSkip;
micLength = size;
return SUCCESS;
But my question is; Don't have i to set some register? Or the setCCm has
only to set some local variabile?
Then in CC2420TrasmitP i found the SecurityCheck() that, i guess, makes the
operation for ecrypt the frame, am i right?
There are also some parts of code that i don't undarstand in this function
like the following.
CTR_SECCTRL0 = ((mode << CC2420_SECCTRL0_SEC_MODE) |
((micLength-2)/2 << CC2420_SECCTRL0_SEC_M) |
(key << CC2420_SECCTRL0_SEC_TXKEYSEL) |
(1 << CC2420_SECCTRL0_SEC_CBC_HEAD)) ;
#ifndef TFRAMES_ENABLED
CTR_SECCTRL1 =
(skip+11+sizeof(security_header_t))+((skip+11+sizeof(security_header_t))<<8);
#else
CTR_SECCTRL1 =
(skip+10+sizeof(security_header_t))+((skip+10+sizeof(security_header_t))<<8);
#endif
Could somebody give me an hint to understand that?
Thanks in advantage.
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help