Update

nn::crypto::Decryptor::Update Member Function

Syntax

virtual size_t Update(
     void * pDst,
     size_t dstSize,
     const void * pSrc,
     size_t srcSize
) = 0;

Parameters

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 ciphertext.
in srcSize Ciphertext size in bytes.

Return Values

Returns the number of bytes written to pDst.

Description

Decrypts.

You can call this function multiple times before calling the UpdateFinal 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 Update function calls, including the current call) - (the total of all Update function return values, excluding the current call). For instance, if you have called the Update 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 Update 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 Update function calls, including the current call) - (the total of all Update 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 call the Initialize function and start over.

Revision History

2011/10/27
Initial version.

CONFIDENTIAL