1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 2<html xml:lang="en-US" lang="en-US" xmlns="http://www.w3.org/1999/xhtml"> 3 <head> 4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 5 <meta http-equiv="Content-Style-Type" content="text/css" /> 6 <link rel="stylesheet" href="../../../css/manpage.css" type="text/css" /> 7 <title>Decrypt</title> 8 </head> 9 <body> 10 <h1><CODE><a href="../../../nn/Overview.html">nn</a>::<a href="../../../nn/crypto/Overview.html">crypto</a>::<a href="../../../nn/crypto/CtrDecryptor/Overview.html">CtrDecryptor</a>::Decrypt</CODE> Member Function</h1> 11 <h2>Syntax</h2> 12 <div class="section"> 13 <pre class="definition"> 14static size_t Decrypt( 15 void * pDst, 16 size_t dstSize, 17 const void * pSrc, 18 size_t srcSize, 19 const void * pIv, 20 size_t ivSize, 21 const <a href="../../../nn/crypto/BlockCipher/Overview.html">BlockCipher</a> & c 22); 23</pre> 24 </div> 25 <h2>Parameters</h2> 26 <div class="section"> 27 <table class="arguments"> 28 <thead> 29 <tr> 30 <td width="15" /> 31 <th>Name</th> 32 <td>Description</td> 33 </tr> 34 </thead> 35 <tr> 36 <td>out</td> 37 <th>pDst</th> 38 <td>Pointer to the buffer storing the decryption results.</td> 39 </tr> 40 <tr> 41 <td>in</td> 42 <th>dstSize</th> 43 <td>Size of the buffer pointed to by <SPAN class="argument">pDst</SPAN>.</td> 44 </tr> 45 <tr> 46 <td>in</td> 47 <th>pSrc</th> 48 <td>Pointer to the buffer storing the ciphertext.</td> 49 </tr> 50 <tr> 51 <td>in</td> 52 <th>srcSize</th> 53 <td>Ciphertext size in bytes.</td> 54 </tr> 55 <tr> 56 <td>in</td> 57 <th>pIv</th> 58 <td>Pointer to the buffer storing the IV.</td> 59 </tr> 60 <tr> 61 <td>in</td> 62 <th>ivSize</th> 63 <td>IV size in bytes.</td> 64 </tr> 65 <tr> 66 <td>in</td> 67 <th>c</th> 68 <td>Instance of the block cipher implementation used in decryption.</td> 69 </tr> </table> 70 </div> 71 <h2>Return Values</h2> 72 <div class="section">Returns the number of bytes written to <SPAN class="argument">pDst</SPAN>. </div> 73 <h2>Description</h2> 74 <div class="section"> 75 <p>Handles batch decryption when in CTR mode.</p><p>When all data is loaded into memory, you can call this function to decrypt all of the data at once.</p><p>For <SPAN class="argument">c</SPAN>, specify the same key used in encryption for the block cipher of the same algorithm used in encryption.</p><p>Specify a pointer to an IV object in <SPAN class="argument">pIv</SPAN>, and its size in <SPAN class="argument">ivSize</SPAN>. You must specify the same IV value as the one used for encryption.</p><p>The function fails and displays an error if the size of the return value is larger than the buffer size specified in <SPAN class="argument">dstSize</SPAN>. Data is not written to the buffer beyond the size specified in <SPAN class="argument">dstSize</SPAN>. If the size of the return value is not larger than <SPAN class="argument">dstSize</SPAN>, the function indicates a successful completion and writes the size of the return value in <SPAN class="argument">pDst</SPAN>.</p><p>If this function fails, decryption cannot continue. You must then try again, starting by calling the <CODE><a href="../../../nn/crypto/CtrDecryptor/Initialize.html">Initialize</a></CODE> function.</p><!-- write here --></div> 76 <h2>Revision History</h2> 77 <div class="section"> 78 <dl class="history"> 79 <dt>2011/10/27</dt> 80 <dd>Initial version.<br /> 81 </dd> 82 </dl> 83 </div> 84 <hr><p>CONFIDENTIAL</p></body> 85</html>