<!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++: DLIES< HASH, COFACTOR_OPTION, DHAES_MODE, LABEL_OCTETS > Struct 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-static-methods">Static Public Member Functions</a> | <a href="struct_d_l_i_e_s-members.html">List of all members</a> </div> <div class="headertitle"> <div class="title">DLIES< HASH, COFACTOR_OPTION, DHAES_MODE, LABEL_OCTETS > Struct Template Reference</div> </div> </div><!--header--> <div class="contents"> <p>Discrete Log Integrated Encryption Scheme. <a href="struct_d_l_i_e_s.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 DLIES< HASH, COFACTOR_OPTION, DHAES_MODE, LABEL_OCTETS >:</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="struct_d_l_i_e_s.png" usemap="#DLIES_3C_20HASH_2C_20COFACTOR_5FOPTION_2C_20DHAES_5FMODE_2C_20LABEL_5FOCTETS_20_3E_map" alt=""/> <map id="DLIES_3C_20HASH_2C_20COFACTOR_5FOPTION_2C_20DHAES_5FMODE_2C_20LABEL_5FOCTETS_20_3E_map" name="DLIES_3C_20HASH_2C_20COFACTOR_5FOPTION_2C_20DHAES_5FMODE_2C_20LABEL_5FOCTETS_20_3E_map"> <area href="class_d_l___e_s.html" alt="DL_ES< DL_CryptoKeys_GFP, DL_KeyAgreementAlgorithm_DH< Integer, COFACTOR_OPTION >, DL_KeyDerivationAlgorithm_P1363< Integer, DHAES_MODE, P1363_KDF2< HASH > >, DL_EncryptionAlgorithm_Xor< HMAC< HASH >, DHAES_MODE, LABEL_OCTETS >, DLIES<> >" shape="rect" coords="0,56,1650,80"/> <area href="struct_d_l___crypto_keys___g_f_p.html" title="Discrete Log (DL) encryption/decryption keys in GF(p) groups. " alt="DL_CryptoKeys_GFP" shape="rect" coords="0,0,1650,24"/> </map> </div></div> <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:aeceeb409575172759fa53174fd997051"><td class="memItemLeft" align="right" valign="top"><a id="aeceeb409575172759fa53174fd997051"></a> static std::string </td><td class="memItemRight" valign="bottom"><b>StaticAlgorithmName</b> ()</td></tr> <tr class="separator:aeceeb409575172759fa53174fd997051"><td class="memSeparator" colspan="2"> </td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="inherited"></a> Additional Inherited Members</h2></td></tr> <tr class="inherit_header pub_types_class_d_l___e_s"><td colspan="2" onclick="javascript:toggleInherit('pub_types_class_d_l___e_s')"><img src="closed.png" alt="-"/> Public Types inherited from <a class="el" href="class_d_l___e_s.html">DL_ES< DL_CryptoKeys_GFP, DL_KeyAgreementAlgorithm_DH< Integer, COFACTOR_OPTION >, DL_KeyDerivationAlgorithm_P1363< Integer, DHAES_MODE, P1363_KDF2< HASH > >, DL_EncryptionAlgorithm_Xor< HMAC< HASH >, DHAES_MODE, LABEL_OCTETS >, DLIES<> ></a></td></tr> <tr class="memitem:a6f4960dec76bc05d9c720c9b903e2a79 inherit pub_types_class_d_l___e_s"><td class="memItemLeft" align="right" valign="top"><a id="a6f4960dec76bc05d9c720c9b903e2a79"></a> typedef <a class="el" href="class_p_k___final_template.html">PK_FinalTemplate</a>< <a class="el" href="class_d_l___decryptor_impl.html">DL_DecryptorImpl</a>< <a class="el" href="struct_d_l___crypto_scheme_options.html">SchemeOptions</a> > > </td><td class="memItemRight" valign="bottom"><a class="el" href="class_d_l___e_s.html#a6f4960dec76bc05d9c720c9b903e2a79">Decryptor</a></td></tr> <tr class="memdesc:a6f4960dec76bc05d9c720c9b903e2a79 inherit pub_types_class_d_l___e_s"><td class="mdescLeft"> </td><td class="mdescRight">implements <a class="el" href="class_p_k___decryptor.html" title="Interface for public-key decryptors. ">PK_Decryptor</a> interface <br /></td></tr> <tr class="separator:a6f4960dec76bc05d9c720c9b903e2a79 inherit pub_types_class_d_l___e_s"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:ae0f5a08f99a0ff49d52a4400c58bde76 inherit pub_types_class_d_l___e_s"><td class="memItemLeft" align="right" valign="top"><a id="ae0f5a08f99a0ff49d52a4400c58bde76"></a> typedef <a class="el" href="class_p_k___final_template.html">PK_FinalTemplate</a>< <a class="el" href="class_d_l___encryptor_impl.html">DL_EncryptorImpl</a>< <a class="el" href="struct_d_l___crypto_scheme_options.html">SchemeOptions</a> > > </td><td class="memItemRight" valign="bottom"><a class="el" href="class_d_l___e_s.html#ae0f5a08f99a0ff49d52a4400c58bde76">Encryptor</a></td></tr> <tr class="memdesc:ae0f5a08f99a0ff49d52a4400c58bde76 inherit pub_types_class_d_l___e_s"><td class="mdescLeft"> </td><td class="mdescRight">implements <a class="el" href="class_p_k___encryptor.html" title="Interface for public-key encryptors. ">PK_Encryptor</a> interface <br /></td></tr> <tr class="separator:ae0f5a08f99a0ff49d52a4400c58bde76 inherit pub_types_class_d_l___e_s"><td class="memSeparator" colspan="2"> </td></tr> <tr class="inherit_header pub_types_struct_d_l___crypto_keys___g_f_p"><td colspan="2" onclick="javascript:toggleInherit('pub_types_struct_d_l___crypto_keys___g_f_p')"><img src="closed.png" alt="-"/> Public Types inherited from <a class="el" href="struct_d_l___crypto_keys___g_f_p.html">DL_CryptoKeys_GFP</a></td></tr> <tr class="memitem:ae775386f9d0dfc252bdd1b58dbb5a529 inherit pub_types_struct_d_l___crypto_keys___g_f_p"><td class="memItemLeft" align="right" valign="top"><a id="ae775386f9d0dfc252bdd1b58dbb5a529"></a> typedef <a class="el" href="class_d_l___group_parameters___g_f_p___default_safe_prime.html">DL_GroupParameters_GFP_DefaultSafePrime</a> </td><td class="memItemRight" valign="bottom"><b>GroupParameters</b></td></tr> <tr class="separator:ae775386f9d0dfc252bdd1b58dbb5a529 inherit pub_types_struct_d_l___crypto_keys___g_f_p"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a6675e22c646660d02ad3d01604031135 inherit pub_types_struct_d_l___crypto_keys___g_f_p"><td class="memItemLeft" align="right" valign="top"><a id="a6675e22c646660d02ad3d01604031135"></a> typedef <a class="el" href="class_d_l___public_key___g_f_p.html">DL_PublicKey_GFP</a>< <a class="el" href="class_d_l___group_parameters___g_f_p___default_safe_prime.html">GroupParameters</a> > </td><td class="memItemRight" valign="bottom"><b>PublicKey</b></td></tr> <tr class="separator:a6675e22c646660d02ad3d01604031135 inherit pub_types_struct_d_l___crypto_keys___g_f_p"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:ab9e7e2d594a87bf4a1777f23c721c22e inherit pub_types_struct_d_l___crypto_keys___g_f_p"><td class="memItemLeft" align="right" valign="top"><a id="ab9e7e2d594a87bf4a1777f23c721c22e"></a> typedef <a class="el" href="class_d_l___private_key___g_f_p.html">DL_PrivateKey_GFP</a>< <a class="el" href="class_d_l___group_parameters___g_f_p___default_safe_prime.html">GroupParameters</a> > </td><td class="memItemRight" valign="bottom"><b>PrivateKey</b></td></tr> <tr class="separator:ab9e7e2d594a87bf4a1777f23c721c22e inherit pub_types_struct_d_l___crypto_keys___g_f_p"><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 HASH = SHA1, class COFACTOR_OPTION = NoCofactorMultiplication, bool DHAES_MODE = true, bool LABEL_OCTETS = false><br /> struct DLIES< HASH, COFACTOR_OPTION, DHAES_MODE, LABEL_OCTETS ></h3> <p>Discrete Log Integrated Encryption Scheme. </p> <dl class="tparams"><dt>Template Parameters</dt><dd> <table class="tparams"> <tr><td class="paramname">COFACTOR_OPTION</td><td>cofactor multiplication option </td></tr> <tr><td class="paramname">HASH</td><td><a class="el" href="class_hash_transformation.html" title="Interface for hash functions and data processing part of MACs. ">HashTransformation</a> derived class used for key drivation and MAC computation </td></tr> <tr><td class="paramname">DHAES_MODE</td><td>flag indicating if the MAC includes addition context parameters such as the label </td></tr> <tr><td class="paramname">LABEL_OCTETS</td><td>flag indicating if the label size is specified in octets or bits</td></tr> </table> </dd> </dl> <p><a class="el" href="struct_d_l_i_e_s.html" title="Discrete Log Integrated Encryption Scheme. ">DLIES</a> is an <a class="el" href="class_integer.html" title="Multiple precision integer with arithmetic operations. ">Integer</a> based Integrated Encryption Scheme (IES). The scheme combines a Key Encapsulation Method (KEM) with a Data Encapsulation Method (DEM) and a MAC tag. The scheme is <a href="http://en.wikipedia.org/wiki/ciphertext_indistinguishability">IND-CCA2</a>, which is a strong notion of security. You should prefer an Integrated Encryption Scheme over homegrown schemes.</p> <p>The library's original implementation is based on an early P1363 draft, which itself appears to be based on an early Certicom SEC-1 draft (or an early SEC-1 draft was based on a P1363 draft). Crypto++ 4.2 used the early draft in its Integrated Ecryption Schemes with <code>NoCofactorMultiplication</code>, <code>DHAES_MODE=false</code> and <code>LABEL_OCTETS=true</code>.</p> <p>If you desire an Integrated Encryption Scheme with Crypto++ 4.2 compatibility, then use the <a class="el" href="struct_d_l_i_e_s.html" title="Discrete Log Integrated Encryption Scheme. ">DLIES</a> template class with <code>NoCofactorMultiplication</code>, <code>DHAES_MODE=false</code> and <code>LABEL_OCTETS=true</code>.</p> <p>If you desire an Integrated Encryption Scheme with Bouncy Castle 1.54 and Botan 1.11 compatibility, then use the <a class="el" href="struct_d_l_i_e_s.html" title="Discrete Log Integrated Encryption Scheme. ">DLIES</a> template class with <code>NoCofactorMultiplication</code>, <code>DHAES_MODE=true</code> and <code>LABEL_OCTETS=false</code>.</p> <p>The default template parameters ensure compatibility with Bouncy Castle 1.54 and Botan 1.11. The combination of <code>IncompatibleCofactorMultiplication</code> and <code>DHAES_MODE=true</code> is recommended for best efficiency and security. <a class="el" href="class_s_h_a1.html" title="SHA-1 message digest. ">SHA1</a> is used for compatibility reasons, but it can be changed if desired. SHA-256 or another hash will likely improve the security provided by the MAC. The hash is also used in the key derivation function as a PRF.</p> <p>Below is an example of constructing a Crypto++ 4.2 compatible <a class="el" href="struct_d_l_i_e_s.html" title="Discrete Log Integrated Encryption Scheme. ">DLIES</a> encryptor and decryptor. </p><pre> <a class="el" href="class_auto_seeded_random_pool.html" title="Automatically Seeded Randomness Pool. ">AutoSeededRandomPool</a> prng; DL_PrivateKey_GFP<DL_GroupParameters_GFP> key; key.Initialize(prng, 2048);</pre><pre> <a class="el" href="class_d_l___e_s.html#a6f4960dec76bc05d9c720c9b903e2a79" title="implements PK_Decryptor interface ">DLIES<SHA1,NoCofactorMultiplication,true,true>::Decryptor</a> decryptor(key); <a class="el" href="class_d_l___e_s.html#ae0f5a08f99a0ff49d52a4400c58bde76" title="implements PK_Encryptor interface ">DLIES<SHA1,NoCofactorMultiplication,true,true>::Encryptor</a> encryptor(decryptor); </pre> <dl class="section see"><dt>See also</dt><dd><a class="el" href="struct_e_c_i_e_s.html" title="Elliptic Curve Integrated Encryption Scheme. ">ECIES</a>, <a href="http://www.weidai.com/scan-mirror/ca.html#DLIES">Discrete Log Integrated Encryption Scheme (DLIES)</a>, Martínez, Encinas, and Ávila's <a href="http://digital.csic.es/bitstream/10261/32671/1/V2-I2-P7-13.pdf">A Survey of the Elliptic Curve Integrated Encryption Schemes</a> </dd></dl> <dl class="section since"><dt>Since</dt><dd>Crypto++ 4.0, Crypto++ 5.7 for Bouncy Castle and Botan compatibility </dd></dl> <p class="definition">Definition at line <a class="el" href="gfpcrypt_8h_source.html#l00844">844</a> of file <a class="el" href="gfpcrypt_8h_source.html">gfpcrypt.h</a>.</p> </div><hr/>The documentation for this struct was generated from the following file:<ul> <li><a class="el" href="gfpcrypt_8h_source.html">gfpcrypt.h</a></li> </ul> </div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> Generated on Sun Sep 16 2018 07:58:30 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>