Khusro Saleem schrieb:
Hi,
I have just stared to use the stand-alone encryption feature on the
CC2420.
Here is my key (hex): 0123456789abcdef0123456789abcdef
Here is my Input data (hex): 000102030405060708090a0b0c0d0e0f
Here is the ciphertext (hex): 0d16729355efd507d8873563392e01d0
Can anybody tell if this is correct. I have not been able to find any
test
vectors specifically for the CC2420 stand-alone AES encryption engine.
I used the following website to try and verify my results:
http://www.cs.eku.edu/faculty/styer/460/Encrypt/JS-AES.html
but I get a different ciphertext result.
IEEE 802.15.4 specifies AES in CTR (counter) mode for encryption. The
above website does AES ECB mode.
In CTR mode, AES is used to encrypt input blocks with a fixed structure
using your key. The resulting ciphertext (called key stream) is XORed to
your message to produce the AES-CTR ciphertext.
The structure of the AES input blocks is defined in IEEE 802.15.4-2003
(section 7.6.2.1.3):
Flags (1 byte)
Source address (8 bytes)
Frame counter (4 bytes)
Key sequence counter (1 byte)
Block counter (2 bytes)
The block counter starts at 0. Frame and key sequence counter are
included in the payload field in the MAC payload of the MAC frame.
If you can determine all these values you can use
http://www.cs.eku.edu/faculty/styer/460/Encrypt/JS-AES.html
to encrypt the input block with you key. If you XOR the ouput with your
input data you get the AES-CTR ciphertext.
Any help (or test vectors) would be appreciated.
AES test vectors (for ECB) can be found in NIST FIPS 197 (AES standard):
http://csrc.nist.gov/publications/fips/fips197/fips-197.pdf
But as you cannot choose the value of the AES input blocks, I don't
think they'll be of much use for you.
HTH
Stefan Tillich
Thanks
Khusro
_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help