Fixed ccm encryption and decryption buffer overflows.
Finished keymanagement decrypt (not tested).