Changes

Jump to navigation Jump to search
77 bytes added ,  00:24, 1 June 2013
no edit summary
Line 47: Line 47:     
=Description=
 
=Description=
This decrypts the input data with [[PS:EncryptSignDecryptVerifyAesCcm|AES-CCM]] using keytype2. The 12-byte nonce buffer used by NS is cleared to all-zero, then the nonce from inputbuf+0 with the noncesize is copied to this nonce buffer. NS then uses [[PS:EncryptSignDecryptVerifyAesCcm]] with keytype2 and with the above nonce buffer, where the inputptr is inputbuf+noncesize, outputptr is outputbuf+0, and size is inputbuffersize - noncesize - 16.
+
This decrypts the input data with [[PS:EncryptSignDecryptVerifyAesCcm|AES-CCM]] using keytype2, when the input noncesize is <12 the low 2-bits are cleared in the noncesize. The 12-byte nonce buffer used by NS is cleared to all-zero, then the nonce from inputbuf+0 with the noncesize is copied to this nonce buffer. NS then uses [[PS:EncryptSignDecryptVerifyAesCcm]] with keytype2 and with the above nonce buffer, where the inputptr is inputbuf+noncesize, outputptr is outputbuf+0, and size is inputbuffersize - noncesize - 16.
    
After decryption, NS copies the data at outbuf+blocksize to outbuf+blocksize+noncesize, with size inputbuffersize-blocksize-16. NS then copies the nonce from inputbuf+0 with the noncesize, to outbuf+blocksize.
 
After decryption, NS copies the data at outbuf+blocksize to outbuf+blocksize+noncesize, with size inputbuffersize-blocksize-16. NS then copies the nonce from inputbuf+0 with the noncesize, to outbuf+blocksize.

Navigation menu