<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta name="generator" content="Doxygen 1.8.14"/> <meta name="viewport" content="width=device-width, initial-scale=1"/> <title>Crypto++: HKDF< T > Class Template Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td id="projectalign" style="padding-left: 0.5em;"> <div id="projectname">Crypto++  <span id="projectnumber">7.0</span> </div> <div id="projectbrief">Free C++ class library of cryptographic schemes</div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.14 --> <script type="text/javascript" src="menudata.js"></script> <script type="text/javascript" src="menu.js"></script> <script type="text/javascript"> /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */ $(function() { initMenu('',false,false,'search.php','Search'); }); /* @license-end */</script> <div id="main-nav"></div> </div><!-- top --> <div class="header"> <div class="summary"> <a href="#pub-methods">Public Member Functions</a> | <a href="#pub-static-methods">Static Public Member Functions</a> | <a href="class_h_k_d_f-members.html">List of all members</a> </div> <div class="headertitle"> <div class="title">HKDF< T > Class Template Reference</div> </div> </div><!--header--> <div class="contents"> <p>Extract-and-Expand Key Derivation Function (<a class="el" href="class_h_k_d_f.html" title="Extract-and-Expand Key Derivation Function (HKDF) ">HKDF</a>) <a href="class_h_k_d_f.html#details">More...</a></p> <div id="dynsection-0" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;"> <img id="dynsection-0-trigger" src="closed.png" alt="+"/> Inheritance diagram for HKDF< T >:</div> <div id="dynsection-0-summary" class="dynsummary" style="display:block;"> </div> <div id="dynsection-0-content" class="dyncontent" style="display:none;"> <div class="center"> <img src="class_h_k_d_f.png" usemap="#HKDF_3C_20T_20_3E_map" alt=""/> <map id="HKDF_3C_20T_20_3E_map" name="HKDF_3C_20T_20_3E_map"> <area href="class_key_derivation_function.html" title="Interface for key derivation functions. " alt="KeyDerivationFunction" shape="rect" coords="0,112,141,136"/> <area href="class_algorithm.html" title="Interface for all crypto algorithms. " alt="Algorithm" shape="rect" coords="0,56,141,80"/> <area href="class_clonable.html" title="Interface for cloning objects. " alt="Clonable" shape="rect" coords="0,0,141,24"/> </map> </div></div> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a> Public Member Functions</h2></td></tr> <tr class="memitem:a673b012e36cc09c69c5c5b810068d676"><td class="memItemLeft" align="right" valign="top">std::string </td><td class="memItemRight" valign="bottom"><a class="el" href="class_h_k_d_f.html#a673b012e36cc09c69c5c5b810068d676">AlgorithmName</a> () const</td></tr> <tr class="memdesc:a673b012e36cc09c69c5c5b810068d676"><td class="mdescLeft"> </td><td class="mdescRight">Provides the name of this algorithm. <a href="#a673b012e36cc09c69c5c5b810068d676">More...</a><br /></td></tr> <tr class="separator:a673b012e36cc09c69c5c5b810068d676"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:aa7a98f9e475ba73484f5e63299e3623b"><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="class_h_k_d_f.html#aa7a98f9e475ba73484f5e63299e3623b">MaxDerivedLength</a> () const</td></tr> <tr class="memdesc:aa7a98f9e475ba73484f5e63299e3623b"><td class="mdescLeft"> </td><td class="mdescRight">Determine maximum number of bytes. <a href="#aa7a98f9e475ba73484f5e63299e3623b">More...</a><br /></td></tr> <tr class="separator:aa7a98f9e475ba73484f5e63299e3623b"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a23f6fd8ea5d27c37b18bef25a2f50012"><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="class_h_k_d_f.html#a23f6fd8ea5d27c37b18bef25a2f50012">GetValidDerivedLength</a> (size_t keylength) const</td></tr> <tr class="memdesc:a23f6fd8ea5d27c37b18bef25a2f50012"><td class="mdescLeft"> </td><td class="mdescRight">Returns a valid key length for the derivation function. <a href="#a23f6fd8ea5d27c37b18bef25a2f50012">More...</a><br /></td></tr> <tr class="separator:a23f6fd8ea5d27c37b18bef25a2f50012"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a164b826bcba31d1033a0c62f0162efe3"><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="class_h_k_d_f.html#a164b826bcba31d1033a0c62f0162efe3">DeriveKey</a> (byte *derived, size_t derivedLen, const byte *secret, size_t secretLen, const <a class="el" href="class_name_value_pairs.html">NameValuePairs</a> &params) const</td></tr> <tr class="memdesc:a164b826bcba31d1033a0c62f0162efe3"><td class="mdescLeft"> </td><td class="mdescRight">Derive a key from a seed. <a href="#a164b826bcba31d1033a0c62f0162efe3">More...</a><br /></td></tr> <tr class="separator:a164b826bcba31d1033a0c62f0162efe3"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a6f02e8b2a954bf2a87b2e14dafb3643f"><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="class_h_k_d_f.html#a6f02e8b2a954bf2a87b2e14dafb3643f">DeriveKey</a> (byte *derived, size_t derivedLen, const byte *secret, size_t secretLen, const byte *salt, size_t saltLen, const byte *info, size_t infoLen) const</td></tr> <tr class="memdesc:a6f02e8b2a954bf2a87b2e14dafb3643f"><td class="mdescLeft"> </td><td class="mdescRight">Derive a key from a seed. <a href="#a6f02e8b2a954bf2a87b2e14dafb3643f">More...</a><br /></td></tr> <tr class="separator:a6f02e8b2a954bf2a87b2e14dafb3643f"><td class="memSeparator" colspan="2"> </td></tr> <tr class="inherit_header pub_methods_class_key_derivation_function"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_class_key_derivation_function')"><img src="closed.png" alt="-"/> Public Member Functions inherited from <a class="el" href="class_key_derivation_function.html">KeyDerivationFunction</a></td></tr> <tr class="memitem:a7a78c05721ca33d0aaa6a33a5d7e78e4 inherit pub_methods_class_key_derivation_function"><td class="memItemLeft" align="right" valign="top">virtual size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="class_key_derivation_function.html#a7a78c05721ca33d0aaa6a33a5d7e78e4">MinDerivedLength</a> () const</td></tr> <tr class="memdesc:a7a78c05721ca33d0aaa6a33a5d7e78e4 inherit pub_methods_class_key_derivation_function"><td class="mdescLeft"> </td><td class="mdescRight">Determine minimum number of bytes. <a href="class_key_derivation_function.html#a7a78c05721ca33d0aaa6a33a5d7e78e4">More...</a><br /></td></tr> <tr class="separator:a7a78c05721ca33d0aaa6a33a5d7e78e4 inherit pub_methods_class_key_derivation_function"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:abe22587a8e66ee7e8de494edb1b3f6f9 inherit pub_methods_class_key_derivation_function"><td class="memItemLeft" align="right" valign="top">virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="class_key_derivation_function.html#abe22587a8e66ee7e8de494edb1b3f6f9">IsValidDerivedLength</a> (size_t keylength) const</td></tr> <tr class="memdesc:abe22587a8e66ee7e8de494edb1b3f6f9 inherit pub_methods_class_key_derivation_function"><td class="mdescLeft"> </td><td class="mdescRight">Returns whether keylength is a valid key length. <a href="class_key_derivation_function.html#abe22587a8e66ee7e8de494edb1b3f6f9">More...</a><br /></td></tr> <tr class="separator:abe22587a8e66ee7e8de494edb1b3f6f9 inherit pub_methods_class_key_derivation_function"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a4e86125e9ca40e3aac741ef240016087 inherit pub_methods_class_key_derivation_function"><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_key_derivation_function.html#a4e86125e9ca40e3aac741ef240016087">SetParameters</a> (const <a class="el" href="class_name_value_pairs.html">NameValuePairs</a> &params)</td></tr> <tr class="memdesc:a4e86125e9ca40e3aac741ef240016087 inherit pub_methods_class_key_derivation_function"><td class="mdescLeft"> </td><td class="mdescRight">Set or change parameters. <a href="class_key_derivation_function.html#a4e86125e9ca40e3aac741ef240016087">More...</a><br /></td></tr> <tr class="separator:a4e86125e9ca40e3aac741ef240016087 inherit pub_methods_class_key_derivation_function"><td class="memSeparator" colspan="2"> </td></tr> <tr class="inherit_header pub_methods_class_algorithm"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_class_algorithm')"><img src="closed.png" alt="-"/> Public Member Functions inherited from <a class="el" href="class_algorithm.html">Algorithm</a></td></tr> <tr class="memitem:a1c77f5117ca2cd881baf26a364cfc606 inherit pub_methods_class_algorithm"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="class_algorithm.html#a1c77f5117ca2cd881baf26a364cfc606">Algorithm</a> (bool checkSelfTestStatus=true)</td></tr> <tr class="memdesc:a1c77f5117ca2cd881baf26a364cfc606 inherit pub_methods_class_algorithm"><td class="mdescLeft"> </td><td class="mdescRight">Interface for all crypto algorithms. <a href="class_algorithm.html#a1c77f5117ca2cd881baf26a364cfc606">More...</a><br /></td></tr> <tr class="separator:a1c77f5117ca2cd881baf26a364cfc606 inherit pub_methods_class_algorithm"><td class="memSeparator" colspan="2"> </td></tr> <tr class="inherit_header pub_methods_class_clonable"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_class_clonable')"><img src="closed.png" alt="-"/> Public Member Functions inherited from <a class="el" href="class_clonable.html">Clonable</a></td></tr> <tr class="memitem:ad0016ba2d505c23aa85aad49e6c19bb7 inherit pub_methods_class_clonable"><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="class_clonable.html">Clonable</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="class_clonable.html#ad0016ba2d505c23aa85aad49e6c19bb7">Clone</a> () const</td></tr> <tr class="memdesc:ad0016ba2d505c23aa85aad49e6c19bb7 inherit pub_methods_class_clonable"><td class="mdescLeft"> </td><td class="mdescRight">Copies this object. <a href="class_clonable.html#ad0016ba2d505c23aa85aad49e6c19bb7">More...</a><br /></td></tr> <tr class="separator:ad0016ba2d505c23aa85aad49e6c19bb7 inherit pub_methods_class_clonable"><td class="memSeparator" colspan="2"> </td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a> Static Public Member Functions</h2></td></tr> <tr class="memitem:a7c4da9d1922ba850dfdd0c29d71191b4"><td class="memItemLeft" align="right" valign="top"><a id="a7c4da9d1922ba850dfdd0c29d71191b4"></a> static std::string </td><td class="memItemRight" valign="bottom"><b>StaticAlgorithmName</b> ()</td></tr> <tr class="separator:a7c4da9d1922ba850dfdd0c29d71191b4"><td class="memSeparator" colspan="2"> </td></tr> </table> <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> <div class="textblock"><h3>template<class T><br /> class HKDF< T ></h3> <p>Extract-and-Expand Key Derivation Function (<a class="el" href="class_h_k_d_f.html" title="Extract-and-Expand Key Derivation Function (HKDF) ">HKDF</a>) </p> <dl class="tparams"><dt>Template Parameters</dt><dd> <table class="tparams"> <tr><td class="paramname">T</td><td><a class="el" href="class_hash_transformation.html" title="Interface for hash functions and data processing part of MACs. ">HashTransformation</a> class </td></tr> </table> </dd> </dl> <dl class="section see"><dt>See also</dt><dd><a href="http://eprint.iacr.org/2010/264">Cryptographic Extraction and Key Derivation: The HKDF Scheme</a> and <a href="http://tools.ietf.org/html/rfc5869">HMAC-based Extract-and-Expand Key Derivation Function (HKDF)</a> </dd></dl> <dl class="section since"><dt>Since</dt><dd>Crypto++ 5.6.3 </dd></dl> <p class="definition">Definition at line <a class="el" href="hkdf_8h_source.html#l00024">24</a> of file <a class="el" href="hkdf_8h_source.html">hkdf.h</a>.</p> </div><h2 class="groupheader">Member Function Documentation</h2> <a id="a673b012e36cc09c69c5c5b810068d676"></a> <h2 class="memtitle"><span class="permalink"><a href="#a673b012e36cc09c69c5c5b810068d676">◆ </a></span>AlgorithmName()</h2> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template<class T > </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">std::string <a class="el" href="class_h_k_d_f.html">HKDF</a>< T >::AlgorithmName </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">virtual</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Provides the name of this algorithm. </p> <dl class="section return"><dt>Returns</dt><dd>the standard algorithm name </dd></dl> <p>Implements <a class="el" href="class_key_derivation_function.html#ad82f2d983ca8d389346357b378fa969e">KeyDerivationFunction</a>.</p> <p class="definition">Definition at line <a class="el" href="hkdf_8h_source.html#l00036">36</a> of file <a class="el" href="hkdf_8h_source.html">hkdf.h</a>.</p> </div> </div> <a id="aa7a98f9e475ba73484f5e63299e3623b"></a> <h2 class="memtitle"><span class="permalink"><a href="#aa7a98f9e475ba73484f5e63299e3623b">◆ </a></span>MaxDerivedLength()</h2> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template<class T > </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">size_t <a class="el" href="class_h_k_d_f.html">HKDF</a>< T >::MaxDerivedLength </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">virtual</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Determine maximum number of bytes. </p> <dl class="section return"><dt>Returns</dt><dd>Maximum number of bytes which can be derived </dd></dl> <p>Reimplemented from <a class="el" href="class_key_derivation_function.html#a009b339865543eb62af91240ac099a8f">KeyDerivationFunction</a>.</p> <p class="definition">Definition at line <a class="el" href="hkdf_8h_source.html#l00041">41</a> of file <a class="el" href="hkdf_8h_source.html">hkdf.h</a>.</p> </div> </div> <a id="a23f6fd8ea5d27c37b18bef25a2f50012"></a> <h2 class="memtitle"><span class="permalink"><a href="#a23f6fd8ea5d27c37b18bef25a2f50012">◆ </a></span>GetValidDerivedLength()</h2> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template<class T > </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">size_t <a class="el" href="class_h_k_d_f.html">HKDF</a>< T >::GetValidDerivedLength </td> <td>(</td> <td class="paramtype">size_t </td> <td class="paramname"><em>keylength</em></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">virtual</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Returns a valid key length for the derivation function. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">keylength</td><td>the size of the derived key, in bytes </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>the valid key length, in bytes </dd></dl> <p>Implements <a class="el" href="class_key_derivation_function.html#ac0f7e2658135a0df411aa619c7fcac90">KeyDerivationFunction</a>.</p> <p class="definition">Definition at line <a class="el" href="hkdf_8h_source.html#l00092">92</a> of file <a class="el" href="hkdf_8h_source.html">hkdf.h</a>.</p> </div> </div> <a id="a164b826bcba31d1033a0c62f0162efe3"></a> <h2 class="memtitle"><span class="permalink"><a href="#a164b826bcba31d1033a0c62f0162efe3">◆ </a></span>DeriveKey() <span class="overload">[1/2]</span></h2> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template<class T > </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">size_t <a class="el" href="class_h_k_d_f.html">HKDF</a>< T >::DeriveKey </td> <td>(</td> <td class="paramtype">byte * </td> <td class="paramname"><em>derived</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">size_t </td> <td class="paramname"><em>derivedLen</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const byte * </td> <td class="paramname"><em>secret</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">size_t </td> <td class="paramname"><em>secretLen</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="el" href="class_name_value_pairs.html">NameValuePairs</a> & </td> <td class="paramname"><em>params</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">virtual</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Derive a key from a seed. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">derived</td><td>the derived output buffer </td></tr> <tr><td class="paramname">derivedLen</td><td>the size of the derived buffer, in bytes </td></tr> <tr><td class="paramname">secret</td><td>the seed input buffer </td></tr> <tr><td class="paramname">secretLen</td><td>the size of the secret buffer, in bytes </td></tr> <tr><td class="paramname">params</td><td>additional initialization parameters to configure this object </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>the number of iterations performed </dd></dl> <dl class="exception"><dt>Exceptions</dt><dd> <table class="exception"> <tr><td class="paramname"><a class="el" href="class_invalid_derived_length.html" title="Exception thrown when an invalid derived key length is encountered. ">InvalidDerivedLength</a></td><td>if <code>derivedLen</code> is invalid for the scheme</td></tr> </table> </dd> </dl> <p><a class="el" href="class_h_k_d_f.html#a164b826bcba31d1033a0c62f0162efe3" title="Derive a key from a seed. ">DeriveKey()</a> provides a standard interface to derive a key from a secret seed and other parameters. Each class that derives from <a class="el" href="class_key_derivation_function.html" title="Interface for key derivation functions. ">KeyDerivationFunction</a> provides an overload that accepts most parameters used by the derivation function.</p> <p>the number of iterations performed by <a class="el" href="class_h_k_d_f.html#a164b826bcba31d1033a0c62f0162efe3" title="Derive a key from a seed. ">DeriveKey()</a> may be 1. For example, a scheme like <a class="el" href="class_h_k_d_f.html" title="Extract-and-Expand Key Derivation Function (HKDF) ">HKDF</a> does not use the iteration count so it returns 1. </p> <p>Implements <a class="el" href="class_key_derivation_function.html#a97cb4cd409b17220063c891e80acdf8d">KeyDerivationFunction</a>.</p> <p class="definition">Definition at line <a class="el" href="hkdf_8h_source.html#l00100">100</a> of file <a class="el" href="hkdf_8h_source.html">hkdf.h</a>.</p> </div> </div> <a id="a6f02e8b2a954bf2a87b2e14dafb3643f"></a> <h2 class="memtitle"><span class="permalink"><a href="#a6f02e8b2a954bf2a87b2e14dafb3643f">◆ </a></span>DeriveKey() <span class="overload">[2/2]</span></h2> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template<class T > </div> <table class="memname"> <tr> <td class="memname">size_t <a class="el" href="class_h_k_d_f.html">HKDF</a>< T >::DeriveKey </td> <td>(</td> <td class="paramtype">byte * </td> <td class="paramname"><em>derived</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">size_t </td> <td class="paramname"><em>derivedLen</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const byte * </td> <td class="paramname"><em>secret</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">size_t </td> <td class="paramname"><em>secretLen</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const byte * </td> <td class="paramname"><em>salt</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">size_t </td> <td class="paramname"><em>saltLen</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const byte * </td> <td class="paramname"><em>info</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">size_t </td> <td class="paramname"><em>infoLen</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td> const</td> </tr> </table> </div><div class="memdoc"> <p>Derive a key from a seed. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">derived</td><td>the derived output buffer </td></tr> <tr><td class="paramname">derivedLen</td><td>the size of the derived buffer, in bytes </td></tr> <tr><td class="paramname">secret</td><td>the seed input buffer </td></tr> <tr><td class="paramname">secretLen</td><td>the size of the secret buffer, in bytes </td></tr> <tr><td class="paramname">salt</td><td>the salt input buffer </td></tr> <tr><td class="paramname">saltLen</td><td>the size of the salt buffer, in bytes </td></tr> <tr><td class="paramname">info</td><td>the additional input buffer </td></tr> <tr><td class="paramname">infoLen</td><td>the size of the info buffer, in bytes </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>the number of iterations performed </dd></dl> <dl class="exception"><dt>Exceptions</dt><dd> <table class="exception"> <tr><td class="paramname"><a class="el" href="class_invalid_derived_length.html" title="Exception thrown when an invalid derived key length is encountered. ">InvalidDerivedLength</a></td><td>if <code>derivedLen</code> is invalid for the scheme</td></tr> </table> </dd> </dl> <p><a class="el" href="class_h_k_d_f.html#a164b826bcba31d1033a0c62f0162efe3" title="Derive a key from a seed. ">DeriveKey()</a> provides a standard interface to derive a key from a seed and other parameters. Each class that derives from <a class="el" href="class_key_derivation_function.html" title="Interface for key derivation functions. ">KeyDerivationFunction</a> provides an overload that accepts most parameters used by the derivation function.</p> <p><code>salt</code> and <code>info</code> can be <code>nullptr</code> with 0 length. <a class="el" href="class_h_k_d_f.html" title="Extract-and-Expand Key Derivation Function (HKDF) ">HKDF</a> is unusual in that a non-NULL salt with length 0 is different than a NULL <code>salt</code>. A NULL <code>salt</code> causes <a class="el" href="class_h_k_d_f.html" title="Extract-and-Expand Key Derivation Function (HKDF) ">HKDF</a> to use a string of 0's of length <code>T::DIGESTSIZE</code> for the <code>salt</code>.</p> <p><a class="el" href="class_h_k_d_f.html" title="Extract-and-Expand Key Derivation Function (HKDF) ">HKDF</a> always returns 1 because it only performs 1 iteration. Other derivation functions, like PBKDF's, will return more interesting values. </p> <p class="definition">Definition at line <a class="el" href="hkdf_8h_source.html#l00124">124</a> of file <a class="el" href="hkdf_8h_source.html">hkdf.h</a>.</p> </div> </div> <hr/>The documentation for this class was generated from the following file:<ul> <li><a class="el" href="hkdf_8h_source.html">hkdf.h</a></li> </ul> </div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> Generated on Sun Sep 16 2018 07:58:37 for Crypto++ by  <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/> </a> 1.8.14 </small></address> </body> </html>