nn::crypto::AuthenticatedDecryptor::UpdateCdata Member Function
virtual size_t UpdateCdata(
void * pDst,
size_t dstSize,
const void * pSrc,
size_t srcSize
) = 0;
| Name | Description | |
|---|---|---|
| out | pDst | Pointer to the buffer storing the decryption results. |
| in | dstSize | Size of the buffer specified by pDst. |
| in | pSrc | Pointer to the buffer storing the Cdata. |
| in | srcSize | Cdata size in bytes. |
Specifies the Cdata and gets the decryption result.
The Cdata is the encrypted Pdata. The Pdata is data for MAC and also for encryption.
You must call the UpdateAdataFinal function before calling this function.
You can call this function multiple times before calling the UpdateCdataFinal function. However, input data is all handled as a single consolidation, so note that the order of input is significant.
The size of the buffer required for pDst is (the total of all size values specified in the UpdateCdata function calls, including the current call) - (the total of all UpdateCdata function return values, excluding the current call). For instance, if you have called the UpdateCdata function three times and specified size values of 500, 600, and 700, and the return values were 450, 620, and 660. Then in your next call to the UpdateCdata function, you would have to specify a buffer in pDst that is as big as the size value for that plus (500 + 600 + 700) - (450 + 620 + 660) = 70 bytes. The value of (the total of all size values specified in the UpdateCdata function calls, including the current call) - (the total of all UpdateCdata function return values, excluding the current call). That is, the size of the buffer you must specify in pDst cannot be any bigger than (size + the block size).
The function fails and displays an error if the size of the return value is larger than the buffer size specified in dstSize. Data is not written to the buffer beyond the size specified in dstSize. If the size of the return value is not larger than dstSize, the function indicates a successful completion and writes the size of the return value in pDst.
If this function fails, decryption cannot continue. You must then try again, starting by calling the Initialize function.
CONFIDENTIAL