I am using the Oscilloscope component to read sensor data. I'm sending this data to a basestation mote which is sending the data to a laptop.
I want to implement AES encryption on the sensor data using the components provided here: http://tinyos.cvs.sourceforge.net/viewvc/tinyos/tinyos-2.x-contrib/crypto/index.html
My plan is to reduce the data buffer from 10 to 8 in Oscilloscope.h. This changes the total data size to 128 bits (the same as a block size in AES). Now the only problem is each array element in the AES block is a unit_8, but the array elements of the data buffer are uint_16.
Is there anyway I can 'split' a uint_16 value to the upper and lower bits? I would then store them as 2 elements in my AES block array.
To clarify, I have a uint_16 which corresponds to some data read by the sensor. I want to be able to store this value in 2 uint_8 values. I will then encrypt the data block, send the packet to the basestation, and the basestation will decrypt and combine the values to the original uint_16.