<!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++: MontgomeryRepresentation Class 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="class_montgomery_representation-members.html">List of all members</a> </div> <div class="headertitle"> <div class="title">MontgomeryRepresentation Class Reference</div> </div> </div><!--header--> <div class="contents"> <p>Performs modular arithmetic in Montgomery representation for increased speed. <a href="class_montgomery_representation.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 MontgomeryRepresentation:</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_montgomery_representation.png" usemap="#MontgomeryRepresentation_map" alt=""/> <map id="MontgomeryRepresentation_map" name="MontgomeryRepresentation_map"> <area href="class_modular_arithmetic.html" title="Ring of congruence classes modulo n. " alt="ModularArithmetic" shape="rect" coords="0,112,166,136"/> <area href="class_abstract_ring.html" alt="AbstractRing< Integer >" shape="rect" coords="0,56,166,80"/> <area href="class_abstract_group.html" alt="AbstractGroup< Integer >" shape="rect" coords="0,0,166,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:ac65a390ac18c44b685a189047a4d3292"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="class_montgomery_representation.html#ac65a390ac18c44b685a189047a4d3292">MontgomeryRepresentation</a> (const <a class="el" href="class_integer.html">Integer</a> &modulus)</td></tr> <tr class="memdesc:ac65a390ac18c44b685a189047a4d3292"><td class="mdescLeft"> </td><td class="mdescRight">Construct a <a class="el" href="class_montgomery_representation.html" title="Performs modular arithmetic in Montgomery representation for increased speed. ">MontgomeryRepresentation</a>. <a href="#ac65a390ac18c44b685a189047a4d3292">More...</a><br /></td></tr> <tr class="separator:ac65a390ac18c44b685a189047a4d3292"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a4591893e6fb0e05f4d2585cddcc15201"><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="class_modular_arithmetic.html">ModularArithmetic</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="class_montgomery_representation.html#a4591893e6fb0e05f4d2585cddcc15201">Clone</a> () const</td></tr> <tr class="memdesc:a4591893e6fb0e05f4d2585cddcc15201"><td class="mdescLeft"> </td><td class="mdescRight">Clone a <a class="el" href="class_montgomery_representation.html" title="Performs modular arithmetic in Montgomery representation for increased speed. ">MontgomeryRepresentation</a>. <a href="#a4591893e6fb0e05f4d2585cddcc15201">More...</a><br /></td></tr> <tr class="separator:a4591893e6fb0e05f4d2585cddcc15201"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a5e2e1914f195a03be80c58d62be84f5e"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="class_montgomery_representation.html#a5e2e1914f195a03be80c58d62be84f5e">IsMontgomeryRepresentation</a> () const</td></tr> <tr class="memdesc:a5e2e1914f195a03be80c58d62be84f5e"><td class="mdescLeft"> </td><td class="mdescRight">Retrieves the representation. <a href="#a5e2e1914f195a03be80c58d62be84f5e">More...</a><br /></td></tr> <tr class="separator:a5e2e1914f195a03be80c58d62be84f5e"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a502f8e7355d1eb252159c0d6e149379a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_integer.html">Integer</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="class_montgomery_representation.html#a502f8e7355d1eb252159c0d6e149379a">ConvertIn</a> (const <a class="el" href="class_integer.html">Integer</a> &a) const</td></tr> <tr class="memdesc:a502f8e7355d1eb252159c0d6e149379a"><td class="mdescLeft"> </td><td class="mdescRight">Reduces an element in the congruence class. <a href="#a502f8e7355d1eb252159c0d6e149379a">More...</a><br /></td></tr> <tr class="separator:a502f8e7355d1eb252159c0d6e149379a"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a2591b1df42db492ab9792bbe1fc9bf5e"><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_integer.html">Integer</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="class_montgomery_representation.html#a2591b1df42db492ab9792bbe1fc9bf5e">ConvertOut</a> (const <a class="el" href="class_integer.html">Integer</a> &a) const</td></tr> <tr class="memdesc:a2591b1df42db492ab9792bbe1fc9bf5e"><td class="mdescLeft"> </td><td class="mdescRight">Reduces an element in the congruence class. <a href="#a2591b1df42db492ab9792bbe1fc9bf5e">More...</a><br /></td></tr> <tr class="separator:a2591b1df42db492ab9792bbe1fc9bf5e"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:aebab2112b22e0af65d4d0048166ca432"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="class_integer.html">Integer</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="class_montgomery_representation.html#aebab2112b22e0af65d4d0048166ca432">MultiplicativeIdentity</a> () const</td></tr> <tr class="memdesc:aebab2112b22e0af65d4d0048166ca432"><td class="mdescLeft"> </td><td class="mdescRight">Retrieves the multiplicative identity. <a href="#aebab2112b22e0af65d4d0048166ca432">More...</a><br /></td></tr> <tr class="separator:aebab2112b22e0af65d4d0048166ca432"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a793d265b8165135e2e972bf333ac5a49"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="class_integer.html">Integer</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="class_montgomery_representation.html#a793d265b8165135e2e972bf333ac5a49">Multiply</a> (const <a class="el" href="class_integer.html">Integer</a> &a, const <a class="el" href="class_integer.html">Integer</a> &b) const</td></tr> <tr class="memdesc:a793d265b8165135e2e972bf333ac5a49"><td class="mdescLeft"> </td><td class="mdescRight">Multiplies elements in the ring. <a href="#a793d265b8165135e2e972bf333ac5a49">More...</a><br /></td></tr> <tr class="separator:a793d265b8165135e2e972bf333ac5a49"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a2f24e4fb6d9b9fc9c6b363d41e7ee449"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="class_integer.html">Integer</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="class_montgomery_representation.html#a2f24e4fb6d9b9fc9c6b363d41e7ee449">Square</a> (const <a class="el" href="class_integer.html">Integer</a> &a) const</td></tr> <tr class="memdesc:a2f24e4fb6d9b9fc9c6b363d41e7ee449"><td class="mdescLeft"> </td><td class="mdescRight"><a class="el" href="class_square.html" title="Square block cipher. ">Square</a> an element in the ring. <a href="#a2f24e4fb6d9b9fc9c6b363d41e7ee449">More...</a><br /></td></tr> <tr class="separator:a2f24e4fb6d9b9fc9c6b363d41e7ee449"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:ae1c2c1f3144d88ee4cdb2bd5b5a376b8"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="class_integer.html">Integer</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="class_montgomery_representation.html#ae1c2c1f3144d88ee4cdb2bd5b5a376b8">MultiplicativeInverse</a> (const <a class="el" href="class_integer.html">Integer</a> &a) const</td></tr> <tr class="memdesc:ae1c2c1f3144d88ee4cdb2bd5b5a376b8"><td class="mdescLeft"> </td><td class="mdescRight">Calculate the multiplicative inverse of an element in the ring. <a href="#ae1c2c1f3144d88ee4cdb2bd5b5a376b8">More...</a><br /></td></tr> <tr class="separator:ae1c2c1f3144d88ee4cdb2bd5b5a376b8"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a63d9f4e3b09f34349fcc87059d86a77a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_integer.html">Integer</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="class_montgomery_representation.html#a63d9f4e3b09f34349fcc87059d86a77a">CascadeExponentiate</a> (const <a class="el" href="class_integer.html">Integer</a> &x, const <a class="el" href="class_integer.html">Integer</a> &e1, const <a class="el" href="class_integer.html">Integer</a> &y, const <a class="el" href="class_integer.html">Integer</a> &e2) const</td></tr> <tr class="memdesc:a63d9f4e3b09f34349fcc87059d86a77a"><td class="mdescLeft"> </td><td class="mdescRight">TODO. <a href="#a63d9f4e3b09f34349fcc87059d86a77a">More...</a><br /></td></tr> <tr class="separator:a63d9f4e3b09f34349fcc87059d86a77a"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a1b03500e21a63d27be5c137877b69d43"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_montgomery_representation.html#a1b03500e21a63d27be5c137877b69d43">SimultaneousExponentiate</a> (<a class="el" href="class_integer.html">Element</a> *results, const <a class="el" href="class_integer.html">Element</a> &base, const <a class="el" href="class_integer.html">Integer</a> *exponents, unsigned int exponentsCount) const</td></tr> <tr class="memdesc:a1b03500e21a63d27be5c137877b69d43"><td class="mdescLeft"> </td><td class="mdescRight">Exponentiates a base to multiple exponents in the ring. <a href="#a1b03500e21a63d27be5c137877b69d43">More...</a><br /></td></tr> <tr class="separator:a1b03500e21a63d27be5c137877b69d43"><td class="memSeparator" colspan="2"> </td></tr> <tr class="inherit_header pub_methods_class_modular_arithmetic"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_class_modular_arithmetic')"><img src="closed.png" alt="-"/> Public Member Functions inherited from <a class="el" href="class_modular_arithmetic.html">ModularArithmetic</a></td></tr> <tr class="memitem:a1cdfc924e8d11f9620bd826535aabb62 inherit pub_methods_class_modular_arithmetic"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="class_modular_arithmetic.html#a1cdfc924e8d11f9620bd826535aabb62">ModularArithmetic</a> (const <a class="el" href="class_integer.html">Integer</a> &modulus=<a class="el" href="class_integer.html#a8c070592581bf6c2f928c72bfa1c1638">Integer::One</a>())</td></tr> <tr class="memdesc:a1cdfc924e8d11f9620bd826535aabb62 inherit pub_methods_class_modular_arithmetic"><td class="mdescLeft"> </td><td class="mdescRight">Construct a <a class="el" href="class_modular_arithmetic.html" title="Ring of congruence classes modulo n. ">ModularArithmetic</a>. <a href="class_modular_arithmetic.html#a1cdfc924e8d11f9620bd826535aabb62">More...</a><br /></td></tr> <tr class="separator:a1cdfc924e8d11f9620bd826535aabb62 inherit pub_methods_class_modular_arithmetic"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a7a7bf808b07baa755ed9ce9f300ce743 inherit pub_methods_class_modular_arithmetic"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="class_modular_arithmetic.html#a7a7bf808b07baa755ed9ce9f300ce743">ModularArithmetic</a> (const <a class="el" href="class_modular_arithmetic.html">ModularArithmetic</a> &ma)</td></tr> <tr class="memdesc:a7a7bf808b07baa755ed9ce9f300ce743 inherit pub_methods_class_modular_arithmetic"><td class="mdescLeft"> </td><td class="mdescRight">Copy construct a <a class="el" href="class_modular_arithmetic.html" title="Ring of congruence classes modulo n. ">ModularArithmetic</a>. <a href="class_modular_arithmetic.html#a7a7bf808b07baa755ed9ce9f300ce743">More...</a><br /></td></tr> <tr class="separator:a7a7bf808b07baa755ed9ce9f300ce743 inherit pub_methods_class_modular_arithmetic"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:aa13202d33f899282fa10019f6ac31427 inherit pub_methods_class_modular_arithmetic"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="class_modular_arithmetic.html#aa13202d33f899282fa10019f6ac31427">ModularArithmetic</a> (<a class="el" href="class_buffered_transformation.html">BufferedTransformation</a> &bt)</td></tr> <tr class="memdesc:aa13202d33f899282fa10019f6ac31427 inherit pub_methods_class_modular_arithmetic"><td class="mdescLeft"> </td><td class="mdescRight">Construct a <a class="el" href="class_modular_arithmetic.html" title="Ring of congruence classes modulo n. ">ModularArithmetic</a>. <a href="class_modular_arithmetic.html#aa13202d33f899282fa10019f6ac31427">More...</a><br /></td></tr> <tr class="separator:aa13202d33f899282fa10019f6ac31427 inherit pub_methods_class_modular_arithmetic"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:afc8159f16af5576bd52ba748d23d6214 inherit pub_methods_class_modular_arithmetic"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_modular_arithmetic.html#afc8159f16af5576bd52ba748d23d6214">DEREncode</a> (<a class="el" href="class_buffered_transformation.html">BufferedTransformation</a> &bt) const</td></tr> <tr class="memdesc:afc8159f16af5576bd52ba748d23d6214 inherit pub_methods_class_modular_arithmetic"><td class="mdescLeft"> </td><td class="mdescRight">Encodes in DER format. <a href="class_modular_arithmetic.html#afc8159f16af5576bd52ba748d23d6214">More...</a><br /></td></tr> <tr class="separator:afc8159f16af5576bd52ba748d23d6214 inherit pub_methods_class_modular_arithmetic"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a7003a94955e76dfcb5ff2f9011a413ba inherit pub_methods_class_modular_arithmetic"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_modular_arithmetic.html#a7003a94955e76dfcb5ff2f9011a413ba">DEREncodeElement</a> (<a class="el" href="class_buffered_transformation.html">BufferedTransformation</a> &out, const <a class="el" href="class_integer.html">Element</a> &a) const</td></tr> <tr class="memdesc:a7003a94955e76dfcb5ff2f9011a413ba inherit pub_methods_class_modular_arithmetic"><td class="mdescLeft"> </td><td class="mdescRight">Encodes element in DER format. <a href="class_modular_arithmetic.html#a7003a94955e76dfcb5ff2f9011a413ba">More...</a><br /></td></tr> <tr class="separator:a7003a94955e76dfcb5ff2f9011a413ba inherit pub_methods_class_modular_arithmetic"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a55824c8d8099d73bb5f4f851560bb606 inherit pub_methods_class_modular_arithmetic"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_modular_arithmetic.html#a55824c8d8099d73bb5f4f851560bb606">BERDecodeElement</a> (<a class="el" href="class_buffered_transformation.html">BufferedTransformation</a> &in, <a class="el" href="class_integer.html">Element</a> &a) const</td></tr> <tr class="memdesc:a55824c8d8099d73bb5f4f851560bb606 inherit pub_methods_class_modular_arithmetic"><td class="mdescLeft"> </td><td class="mdescRight">Decodes element in DER format. <a href="class_modular_arithmetic.html#a55824c8d8099d73bb5f4f851560bb606">More...</a><br /></td></tr> <tr class="separator:a55824c8d8099d73bb5f4f851560bb606 inherit pub_methods_class_modular_arithmetic"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a71a51e5b665bf7fb89af2ccba19f0043 inherit pub_methods_class_modular_arithmetic"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="class_integer.html">Integer</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="class_modular_arithmetic.html#a71a51e5b665bf7fb89af2ccba19f0043">GetModulus</a> () const</td></tr> <tr class="memdesc:a71a51e5b665bf7fb89af2ccba19f0043 inherit pub_methods_class_modular_arithmetic"><td class="mdescLeft"> </td><td class="mdescRight">Retrieves the modulus. <a href="class_modular_arithmetic.html#a71a51e5b665bf7fb89af2ccba19f0043">More...</a><br /></td></tr> <tr class="separator:a71a51e5b665bf7fb89af2ccba19f0043 inherit pub_methods_class_modular_arithmetic"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a2d7a07fd3831386eb9315c4e1f5fcf25 inherit pub_methods_class_modular_arithmetic"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_modular_arithmetic.html#a2d7a07fd3831386eb9315c4e1f5fcf25">SetModulus</a> (const <a class="el" href="class_integer.html">Integer</a> &newModulus)</td></tr> <tr class="memdesc:a2d7a07fd3831386eb9315c4e1f5fcf25 inherit pub_methods_class_modular_arithmetic"><td class="mdescLeft"> </td><td class="mdescRight">Sets the modulus. <a href="class_modular_arithmetic.html#a2d7a07fd3831386eb9315c4e1f5fcf25">More...</a><br /></td></tr> <tr class="separator:a2d7a07fd3831386eb9315c4e1f5fcf25 inherit pub_methods_class_modular_arithmetic"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a1f48cc76a72062075778f317e29ae441 inherit pub_methods_class_modular_arithmetic"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="class_integer.html">Integer</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="class_modular_arithmetic.html#a1f48cc76a72062075778f317e29ae441">Half</a> (const <a class="el" href="class_integer.html">Integer</a> &a) const</td></tr> <tr class="memdesc:a1f48cc76a72062075778f317e29ae441 inherit pub_methods_class_modular_arithmetic"><td class="mdescLeft"> </td><td class="mdescRight">Divides an element by 2. <a href="class_modular_arithmetic.html#a1f48cc76a72062075778f317e29ae441">More...</a><br /></td></tr> <tr class="separator:a1f48cc76a72062075778f317e29ae441 inherit pub_methods_class_modular_arithmetic"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a89c5edea6e87341761c35ab03a46bcc0 inherit pub_methods_class_modular_arithmetic"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="class_modular_arithmetic.html#a89c5edea6e87341761c35ab03a46bcc0">Equal</a> (const <a class="el" href="class_integer.html">Integer</a> &a, const <a class="el" href="class_integer.html">Integer</a> &b) const</td></tr> <tr class="memdesc:a89c5edea6e87341761c35ab03a46bcc0 inherit pub_methods_class_modular_arithmetic"><td class="mdescLeft"> </td><td class="mdescRight">Compare two elements for equality. <a href="class_modular_arithmetic.html#a89c5edea6e87341761c35ab03a46bcc0">More...</a><br /></td></tr> <tr class="separator:a89c5edea6e87341761c35ab03a46bcc0 inherit pub_methods_class_modular_arithmetic"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:abd2425e1caf5af1a290b424cadb1517c inherit pub_methods_class_modular_arithmetic"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="class_integer.html">Integer</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="class_modular_arithmetic.html#abd2425e1caf5af1a290b424cadb1517c">Identity</a> () const</td></tr> <tr class="memdesc:abd2425e1caf5af1a290b424cadb1517c inherit pub_methods_class_modular_arithmetic"><td class="mdescLeft"> </td><td class="mdescRight">Provides the Identity element. <a href="class_modular_arithmetic.html#abd2425e1caf5af1a290b424cadb1517c">More...</a><br /></td></tr> <tr class="separator:abd2425e1caf5af1a290b424cadb1517c inherit pub_methods_class_modular_arithmetic"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:af840f9421d210579fb9b526a90e857fe inherit pub_methods_class_modular_arithmetic"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="class_integer.html">Integer</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="class_modular_arithmetic.html#af840f9421d210579fb9b526a90e857fe">Add</a> (const <a class="el" href="class_integer.html">Integer</a> &a, const <a class="el" href="class_integer.html">Integer</a> &b) const</td></tr> <tr class="memdesc:af840f9421d210579fb9b526a90e857fe inherit pub_methods_class_modular_arithmetic"><td class="mdescLeft"> </td><td class="mdescRight">Adds elements in the ring. <a href="class_modular_arithmetic.html#af840f9421d210579fb9b526a90e857fe">More...</a><br /></td></tr> <tr class="separator:af840f9421d210579fb9b526a90e857fe inherit pub_methods_class_modular_arithmetic"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:acf6e8cc8fcabe8eed4c7ebc4361d28fc inherit pub_methods_class_modular_arithmetic"><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_integer.html">Integer</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="class_modular_arithmetic.html#acf6e8cc8fcabe8eed4c7ebc4361d28fc">Accumulate</a> (<a class="el" href="class_integer.html">Integer</a> &a, const <a class="el" href="class_integer.html">Integer</a> &b) const</td></tr> <tr class="memdesc:acf6e8cc8fcabe8eed4c7ebc4361d28fc inherit pub_methods_class_modular_arithmetic"><td class="mdescLeft"> </td><td class="mdescRight">TODO. <a href="class_modular_arithmetic.html#acf6e8cc8fcabe8eed4c7ebc4361d28fc">More...</a><br /></td></tr> <tr class="separator:acf6e8cc8fcabe8eed4c7ebc4361d28fc inherit pub_methods_class_modular_arithmetic"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a355c52bd9e20a22037f17d0461b4575a inherit pub_methods_class_modular_arithmetic"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="class_integer.html">Integer</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="class_modular_arithmetic.html#a355c52bd9e20a22037f17d0461b4575a">Inverse</a> (const <a class="el" href="class_integer.html">Integer</a> &a) const</td></tr> <tr class="memdesc:a355c52bd9e20a22037f17d0461b4575a inherit pub_methods_class_modular_arithmetic"><td class="mdescLeft"> </td><td class="mdescRight">Inverts the element in the ring. <a href="class_modular_arithmetic.html#a355c52bd9e20a22037f17d0461b4575a">More...</a><br /></td></tr> <tr class="separator:a355c52bd9e20a22037f17d0461b4575a inherit pub_methods_class_modular_arithmetic"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:ae4705633e8ca4308894f9a26c6f2881c inherit pub_methods_class_modular_arithmetic"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="class_integer.html">Integer</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="class_modular_arithmetic.html#ae4705633e8ca4308894f9a26c6f2881c">Subtract</a> (const <a class="el" href="class_integer.html">Integer</a> &a, const <a class="el" href="class_integer.html">Integer</a> &b) const</td></tr> <tr class="memdesc:ae4705633e8ca4308894f9a26c6f2881c inherit pub_methods_class_modular_arithmetic"><td class="mdescLeft"> </td><td class="mdescRight">Subtracts elements in the ring. <a href="class_modular_arithmetic.html#ae4705633e8ca4308894f9a26c6f2881c">More...</a><br /></td></tr> <tr class="separator:ae4705633e8ca4308894f9a26c6f2881c inherit pub_methods_class_modular_arithmetic"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a131ab327c94c1967a936c144769d098c inherit pub_methods_class_modular_arithmetic"><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_integer.html">Integer</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="class_modular_arithmetic.html#a131ab327c94c1967a936c144769d098c">Reduce</a> (<a class="el" href="class_integer.html">Integer</a> &a, const <a class="el" href="class_integer.html">Integer</a> &b) const</td></tr> <tr class="memdesc:a131ab327c94c1967a936c144769d098c inherit pub_methods_class_modular_arithmetic"><td class="mdescLeft"> </td><td class="mdescRight">TODO. <a href="class_modular_arithmetic.html#a131ab327c94c1967a936c144769d098c">More...</a><br /></td></tr> <tr class="separator:a131ab327c94c1967a936c144769d098c inherit pub_methods_class_modular_arithmetic"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a042dc36ae961ede73694e4c5dcf7cbbc inherit pub_methods_class_modular_arithmetic"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="class_integer.html">Integer</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="class_modular_arithmetic.html#a042dc36ae961ede73694e4c5dcf7cbbc">Double</a> (const <a class="el" href="class_integer.html">Integer</a> &a) const</td></tr> <tr class="memdesc:a042dc36ae961ede73694e4c5dcf7cbbc inherit pub_methods_class_modular_arithmetic"><td class="mdescLeft"> </td><td class="mdescRight">Doubles an element in the ring. <a href="class_modular_arithmetic.html#a042dc36ae961ede73694e4c5dcf7cbbc">More...</a><br /></td></tr> <tr class="separator:a042dc36ae961ede73694e4c5dcf7cbbc inherit pub_methods_class_modular_arithmetic"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a0d8edd3e4ff60627b92e93ebd00cdfb3 inherit pub_methods_class_modular_arithmetic"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="class_modular_arithmetic.html#a0d8edd3e4ff60627b92e93ebd00cdfb3">IsUnit</a> (const <a class="el" href="class_integer.html">Integer</a> &a) const</td></tr> <tr class="memdesc:a0d8edd3e4ff60627b92e93ebd00cdfb3 inherit pub_methods_class_modular_arithmetic"><td class="mdescLeft"> </td><td class="mdescRight">Determines whether an element is a unit in the ring. <a href="class_modular_arithmetic.html#a0d8edd3e4ff60627b92e93ebd00cdfb3">More...</a><br /></td></tr> <tr class="separator:a0d8edd3e4ff60627b92e93ebd00cdfb3 inherit pub_methods_class_modular_arithmetic"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a584d214676856d1463e14c6407d1cd31 inherit pub_methods_class_modular_arithmetic"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="class_integer.html">Integer</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="class_modular_arithmetic.html#a584d214676856d1463e14c6407d1cd31">Divide</a> (const <a class="el" href="class_integer.html">Integer</a> &a, const <a class="el" href="class_integer.html">Integer</a> &b) const</td></tr> <tr class="memdesc:a584d214676856d1463e14c6407d1cd31 inherit pub_methods_class_modular_arithmetic"><td class="mdescLeft"> </td><td class="mdescRight">Divides elements in the ring. <a href="class_modular_arithmetic.html#a584d214676856d1463e14c6407d1cd31">More...</a><br /></td></tr> <tr class="separator:a584d214676856d1463e14c6407d1cd31 inherit pub_methods_class_modular_arithmetic"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a3c802233b0edf8df4228d65082ff37fa inherit pub_methods_class_modular_arithmetic"><td class="memItemLeft" align="right" valign="top">unsigned int </td><td class="memItemRight" valign="bottom"><a class="el" href="class_modular_arithmetic.html#a3c802233b0edf8df4228d65082ff37fa">MaxElementBitLength</a> () const</td></tr> <tr class="memdesc:a3c802233b0edf8df4228d65082ff37fa inherit pub_methods_class_modular_arithmetic"><td class="mdescLeft"> </td><td class="mdescRight">Provides the maximum bit size of an element in the ring. <a href="class_modular_arithmetic.html#a3c802233b0edf8df4228d65082ff37fa">More...</a><br /></td></tr> <tr class="separator:a3c802233b0edf8df4228d65082ff37fa inherit pub_methods_class_modular_arithmetic"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a5897aea2ee78595979f8f261130c93ee inherit pub_methods_class_modular_arithmetic"><td class="memItemLeft" align="right" valign="top">unsigned int </td><td class="memItemRight" valign="bottom"><a class="el" href="class_modular_arithmetic.html#a5897aea2ee78595979f8f261130c93ee">MaxElementByteLength</a> () const</td></tr> <tr class="memdesc:a5897aea2ee78595979f8f261130c93ee inherit pub_methods_class_modular_arithmetic"><td class="mdescLeft"> </td><td class="mdescRight">Provides the maximum byte size of an element in the ring. <a href="class_modular_arithmetic.html#a5897aea2ee78595979f8f261130c93ee">More...</a><br /></td></tr> <tr class="separator:a5897aea2ee78595979f8f261130c93ee inherit pub_methods_class_modular_arithmetic"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a6abf94f5924223c316c04752ba39795a inherit pub_methods_class_modular_arithmetic"><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_integer.html">Element</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="class_modular_arithmetic.html#a6abf94f5924223c316c04752ba39795a">RandomElement</a> (<a class="el" href="class_random_number_generator.html">RandomNumberGenerator</a> &rng, const RandomizationParameter &ignore_for_now=0) const</td></tr> <tr class="memdesc:a6abf94f5924223c316c04752ba39795a inherit pub_methods_class_modular_arithmetic"><td class="mdescLeft"> </td><td class="mdescRight">Provides a random element in the ring. <a href="class_modular_arithmetic.html#a6abf94f5924223c316c04752ba39795a">More...</a><br /></td></tr> <tr class="separator:a6abf94f5924223c316c04752ba39795a inherit pub_methods_class_modular_arithmetic"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a0ebc62368fdab13aae9521778beeea4c inherit pub_methods_class_modular_arithmetic"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="class_modular_arithmetic.html#a0ebc62368fdab13aae9521778beeea4c">operator==</a> (const <a class="el" href="class_modular_arithmetic.html">ModularArithmetic</a> &rhs) const</td></tr> <tr class="memdesc:a0ebc62368fdab13aae9521778beeea4c inherit pub_methods_class_modular_arithmetic"><td class="mdescLeft"> </td><td class="mdescRight">Compares two <a class="el" href="class_modular_arithmetic.html" title="Ring of congruence classes modulo n. ">ModularArithmetic</a> for equality. <a href="class_modular_arithmetic.html#a0ebc62368fdab13aae9521778beeea4c">More...</a><br /></td></tr> <tr class="separator:a0ebc62368fdab13aae9521778beeea4c inherit pub_methods_class_modular_arithmetic"><td class="memSeparator" colspan="2"> </td></tr> <tr class="inherit_header pub_methods_class_abstract_ring"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_class_abstract_ring')"><img src="closed.png" alt="-"/> Public Member Functions inherited from <a class="el" href="class_abstract_ring.html">AbstractRing< Integer ></a></td></tr> <tr class="memitem:ae55c525c1aa75bf898907bd6949e2b64 inherit pub_methods_class_abstract_ring"><td class="memItemLeft" align="right" valign="top"><a id="ae55c525c1aa75bf898907bd6949e2b64"></a>  </td><td class="memItemRight" valign="bottom"><a class="el" href="class_abstract_ring.html#ae55c525c1aa75bf898907bd6949e2b64">AbstractRing</a> ()</td></tr> <tr class="memdesc:ae55c525c1aa75bf898907bd6949e2b64 inherit pub_methods_class_abstract_ring"><td class="mdescLeft"> </td><td class="mdescRight">Construct an <a class="el" href="class_abstract_ring.html" title="Abstract ring. ">AbstractRing</a>. <br /></td></tr> <tr class="separator:ae55c525c1aa75bf898907bd6949e2b64 inherit pub_methods_class_abstract_ring"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:acc8afd5ce95e32e45d3c30a710bf36dc inherit pub_methods_class_abstract_ring"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="class_abstract_ring.html#acc8afd5ce95e32e45d3c30a710bf36dc">AbstractRing</a> (const <a class="el" href="class_abstract_ring.html">AbstractRing</a> &source)</td></tr> <tr class="memdesc:acc8afd5ce95e32e45d3c30a710bf36dc inherit pub_methods_class_abstract_ring"><td class="mdescLeft"> </td><td class="mdescRight">Copy construct an <a class="el" href="class_abstract_ring.html" title="Abstract ring. ">AbstractRing</a>. <a href="class_abstract_ring.html#acc8afd5ce95e32e45d3c30a710bf36dc">More...</a><br /></td></tr> <tr class="separator:acc8afd5ce95e32e45d3c30a710bf36dc inherit pub_methods_class_abstract_ring"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a26709c02c869d09d756653ae1129f8a9 inherit pub_methods_class_abstract_ring"><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_abstract_ring.html">AbstractRing</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="class_abstract_ring.html#a26709c02c869d09d756653ae1129f8a9">operator=</a> (const <a class="el" href="class_abstract_ring.html">AbstractRing</a> &source)</td></tr> <tr class="memdesc:a26709c02c869d09d756653ae1129f8a9 inherit pub_methods_class_abstract_ring"><td class="mdescLeft"> </td><td class="mdescRight">Assign an <a class="el" href="class_abstract_ring.html" title="Abstract ring. ">AbstractRing</a>. <a href="class_abstract_ring.html#a26709c02c869d09d756653ae1129f8a9">More...</a><br /></td></tr> <tr class="separator:a26709c02c869d09d756653ae1129f8a9 inherit pub_methods_class_abstract_ring"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a0f011366054a4edb80be92f968083538 inherit pub_methods_class_abstract_ring"><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="class_integer.html">Element</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="class_abstract_ring.html#a0f011366054a4edb80be92f968083538">Exponentiate</a> (const <a class="el" href="class_integer.html">Element</a> &a, const <a class="el" href="class_integer.html">Integer</a> &e) const</td></tr> <tr class="memdesc:a0f011366054a4edb80be92f968083538 inherit pub_methods_class_abstract_ring"><td class="mdescLeft"> </td><td class="mdescRight">Raises a base to an exponent in the group. <a href="class_abstract_ring.html#a0f011366054a4edb80be92f968083538">More...</a><br /></td></tr> <tr class="separator:a0f011366054a4edb80be92f968083538 inherit pub_methods_class_abstract_ring"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:ae19ef788f5ce5192e5867666ef38717f inherit pub_methods_class_abstract_ring"><td class="memItemLeft" align="right" valign="top">virtual const <a class="el" href="class_abstract_group.html">AbstractGroup</a>< <a class="el" href="class_integer.html">Integer</a> > & </td><td class="memItemRight" valign="bottom"><a class="el" href="class_abstract_ring.html#ae19ef788f5ce5192e5867666ef38717f">MultiplicativeGroup</a> () const</td></tr> <tr class="memdesc:ae19ef788f5ce5192e5867666ef38717f inherit pub_methods_class_abstract_ring"><td class="mdescLeft"> </td><td class="mdescRight">Retrieves the multiplicative group. <a href="class_abstract_ring.html#ae19ef788f5ce5192e5867666ef38717f">More...</a><br /></td></tr> <tr class="separator:ae19ef788f5ce5192e5867666ef38717f inherit pub_methods_class_abstract_ring"><td class="memSeparator" colspan="2"> </td></tr> <tr class="inherit_header pub_methods_class_abstract_group"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_class_abstract_group')"><img src="closed.png" alt="-"/> Public Member Functions inherited from <a class="el" href="class_abstract_group.html">AbstractGroup< Integer ></a></td></tr> <tr class="memitem:a257836994abefe25b80293f4c6b10f60 inherit pub_methods_class_abstract_group"><td class="memItemLeft" align="right" valign="top">virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="class_abstract_group.html#a257836994abefe25b80293f4c6b10f60">InversionIsFast</a> () const</td></tr> <tr class="memdesc:a257836994abefe25b80293f4c6b10f60 inherit pub_methods_class_abstract_group"><td class="mdescLeft"> </td><td class="mdescRight">Determine if inversion is fast. <a href="class_abstract_group.html#a257836994abefe25b80293f4c6b10f60">More...</a><br /></td></tr> <tr class="separator:a257836994abefe25b80293f4c6b10f60 inherit pub_methods_class_abstract_group"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:ac01536b91c4fa3d0e0f929917143595b inherit pub_methods_class_abstract_group"><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="class_integer.html">Element</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="class_abstract_group.html#ac01536b91c4fa3d0e0f929917143595b">ScalarMultiply</a> (const <a class="el" href="class_integer.html">Element</a> &a, const <a class="el" href="class_integer.html">Integer</a> &e) const</td></tr> <tr class="memdesc:ac01536b91c4fa3d0e0f929917143595b inherit pub_methods_class_abstract_group"><td class="mdescLeft"> </td><td class="mdescRight">Performs a scalar multiplication. <a href="class_abstract_group.html#ac01536b91c4fa3d0e0f929917143595b">More...</a><br /></td></tr> <tr class="separator:ac01536b91c4fa3d0e0f929917143595b inherit pub_methods_class_abstract_group"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a89bd24f1a83e62ac8cc5ad014cb5883e inherit pub_methods_class_abstract_group"><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="class_integer.html">Element</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="class_abstract_group.html#a89bd24f1a83e62ac8cc5ad014cb5883e">CascadeScalarMultiply</a> (const <a class="el" href="class_integer.html">Element</a> &x, const <a class="el" href="class_integer.html">Integer</a> &e1, const <a class="el" href="class_integer.html">Element</a> &y, const <a class="el" href="class_integer.html">Integer</a> &e2) const</td></tr> <tr class="memdesc:a89bd24f1a83e62ac8cc5ad014cb5883e inherit pub_methods_class_abstract_group"><td class="mdescLeft"> </td><td class="mdescRight">TODO. <a href="class_abstract_group.html#a89bd24f1a83e62ac8cc5ad014cb5883e">More...</a><br /></td></tr> <tr class="separator:a89bd24f1a83e62ac8cc5ad014cb5883e inherit pub_methods_class_abstract_group"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a9c73ab688612e76786f43e311376eb8d inherit pub_methods_class_abstract_group"><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_abstract_group.html#a9c73ab688612e76786f43e311376eb8d">SimultaneousMultiply</a> (<a class="el" href="class_integer.html">Element</a> *results, const <a class="el" href="class_integer.html">Element</a> &base, const <a class="el" href="class_integer.html">Integer</a> *exponents, unsigned int exponentsCount) const</td></tr> <tr class="memdesc:a9c73ab688612e76786f43e311376eb8d inherit pub_methods_class_abstract_group"><td class="mdescLeft"> </td><td class="mdescRight">Multiplies a base to multiple exponents in a group. <a href="class_abstract_group.html#a9c73ab688612e76786f43e311376eb8d">More...</a><br /></td></tr> <tr class="separator:a9c73ab688612e76786f43e311376eb8d inherit pub_methods_class_abstract_group"><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_modular_arithmetic"><td colspan="2" onclick="javascript:toggleInherit('pub_types_class_modular_arithmetic')"><img src="closed.png" alt="-"/> Public Types inherited from <a class="el" href="class_modular_arithmetic.html">ModularArithmetic</a></td></tr> <tr class="memitem:a872afa5efebf43e4744156dcdfac3ca3 inherit pub_types_class_modular_arithmetic"><td class="memItemLeft" align="right" valign="top"><a id="a872afa5efebf43e4744156dcdfac3ca3"></a> typedef int </td><td class="memItemRight" valign="bottom"><b>RandomizationParameter</b></td></tr> <tr class="separator:a872afa5efebf43e4744156dcdfac3ca3 inherit pub_types_class_modular_arithmetic"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a17f2266382639dde45d028e630e07296 inherit pub_types_class_modular_arithmetic"><td class="memItemLeft" align="right" valign="top"><a id="a17f2266382639dde45d028e630e07296"></a> typedef <a class="el" href="class_integer.html">Integer</a> </td><td class="memItemRight" valign="bottom"><b>Element</b></td></tr> <tr class="separator:a17f2266382639dde45d028e630e07296 inherit pub_types_class_modular_arithmetic"><td class="memSeparator" colspan="2"> </td></tr> <tr class="inherit_header pub_types_class_abstract_ring"><td colspan="2" onclick="javascript:toggleInherit('pub_types_class_abstract_ring')"><img src="closed.png" alt="-"/> Public Types inherited from <a class="el" href="class_abstract_ring.html">AbstractRing< Integer ></a></td></tr> <tr class="memitem:acd93e8ce4e2897173310c68fcb60f3e9 inherit pub_types_class_abstract_ring"><td class="memItemLeft" align="right" valign="top"><a id="acd93e8ce4e2897173310c68fcb60f3e9"></a> typedef <a class="el" href="class_integer.html">Integer</a> </td><td class="memItemRight" valign="bottom"><b>Element</b></td></tr> <tr class="separator:acd93e8ce4e2897173310c68fcb60f3e9 inherit pub_types_class_abstract_ring"><td class="memSeparator" colspan="2"> </td></tr> <tr class="inherit_header pub_types_class_abstract_group"><td colspan="2" onclick="javascript:toggleInherit('pub_types_class_abstract_group')"><img src="closed.png" alt="-"/> Public Types inherited from <a class="el" href="class_abstract_group.html">AbstractGroup< Integer ></a></td></tr> <tr class="memitem:a4a2b3308fb5c13f70fcc5746be52ba7b inherit pub_types_class_abstract_group"><td class="memItemLeft" align="right" valign="top"><a id="a4a2b3308fb5c13f70fcc5746be52ba7b"></a> typedef <a class="el" href="class_integer.html">Integer</a> </td><td class="memItemRight" valign="bottom"><b>Element</b></td></tr> <tr class="separator:a4a2b3308fb5c13f70fcc5746be52ba7b inherit pub_types_class_abstract_group"><td class="memSeparator" colspan="2"> </td></tr> <tr class="inherit_header pub_static_attribs_class_modular_arithmetic"><td colspan="2" onclick="javascript:toggleInherit('pub_static_attribs_class_modular_arithmetic')"><img src="closed.png" alt="-"/> Static Public Attributes inherited from <a class="el" href="class_modular_arithmetic.html">ModularArithmetic</a></td></tr> <tr class="memitem:a0bc237302baf05d7a7dcf7469eb2d331 inherit pub_static_attribs_class_modular_arithmetic"><td class="memItemLeft" align="right" valign="top"><a id="a0bc237302baf05d7a7dcf7469eb2d331"></a> static const RandomizationParameter </td><td class="memItemRight" valign="bottom"><b>DefaultRandomizationParameter</b></td></tr> <tr class="separator:a0bc237302baf05d7a7dcf7469eb2d331 inherit pub_static_attribs_class_modular_arithmetic"><td class="memSeparator" colspan="2"> </td></tr> </table> <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> <div class="textblock"><p>Performs modular arithmetic in Montgomery representation for increased speed. </p> <p>The Montgomery representation represents each congruence class <code>[a]</code> as <code>a*r%n</code>, where <code>r</code> is a convenient power of 2.</p> <p><code>const Element&</code> returned by member functions are references to internal data members. Since each object may have only one such data member for holding results, the following code will produce incorrect results: </p><pre> abcd = group.Add(group.Add(a,b), group.Add(c,d));</pre><p> But this should be fine: </p><pre> abcd = group.Add(a, group.Add(b, group.Add(c,d));</pre> <p class="definition">Definition at line <a class="el" href="modarith_8h_source.html#l00274">274</a> of file <a class="el" href="modarith_8h_source.html">modarith.h</a>.</p> </div><h2 class="groupheader">Constructor & Destructor Documentation</h2> <a id="ac65a390ac18c44b685a189047a4d3292"></a> <h2 class="memtitle"><span class="permalink"><a href="#ac65a390ac18c44b685a189047a4d3292">◆ </a></span>MontgomeryRepresentation()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">MontgomeryRepresentation::MontgomeryRepresentation </td> <td>(</td> <td class="paramtype">const <a class="el" href="class_integer.html">Integer</a> & </td> <td class="paramname"><em>modulus</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Construct a <a class="el" href="class_montgomery_representation.html" title="Performs modular arithmetic in Montgomery representation for increased speed. ">MontgomeryRepresentation</a>. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">modulus</td><td>congruence class modulus </td></tr> </table> </dd> </dl> <dl class="section note"><dt>Note</dt><dd>The modulus must be odd. </dd></dl> <p class="definition">Definition at line <a class="el" href="integer_8cpp_source.html#l04604">4604</a> of file <a class="el" href="integer_8cpp_source.html">integer.cpp</a>.</p> </div> </div> <h2 class="groupheader">Member Function Documentation</h2> <a id="a4591893e6fb0e05f4d2585cddcc15201"></a> <h2 class="memtitle"><span class="permalink"><a href="#a4591893e6fb0e05f4d2585cddcc15201">◆ </a></span>Clone()</h2> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">virtual <a class="el" href="class_modular_arithmetic.html">ModularArithmetic</a>* MontgomeryRepresentation::Clone </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>Clone a <a class="el" href="class_montgomery_representation.html" title="Performs modular arithmetic in Montgomery representation for increased speed. ">MontgomeryRepresentation</a>. </p> <dl class="section return"><dt>Returns</dt><dd>pointer to a new <a class="el" href="class_montgomery_representation.html" title="Performs modular arithmetic in Montgomery representation for increased speed. ">MontgomeryRepresentation</a></dd></dl> <p>Clone effectively copy constructs a new <a class="el" href="class_montgomery_representation.html" title="Performs modular arithmetic in Montgomery representation for increased speed. ">MontgomeryRepresentation</a>. The caller is responsible for deleting the pointer returned from this method. </p> <p>Reimplemented from <a class="el" href="class_modular_arithmetic.html#a2ea01ae9e84d5392a8781b99d5cba83f">ModularArithmetic</a>.</p> <p class="definition">Definition at line <a class="el" href="modarith_8h_source.html#l00288">288</a> of file <a class="el" href="modarith_8h_source.html">modarith.h</a>.</p> </div> </div> <a id="a5e2e1914f195a03be80c58d62be84f5e"></a> <h2 class="memtitle"><span class="permalink"><a href="#a5e2e1914f195a03be80c58d62be84f5e">◆ </a></span>IsMontgomeryRepresentation()</h2> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">bool MontgomeryRepresentation::IsMontgomeryRepresentation </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>Retrieves the representation. </p> <dl class="section return"><dt>Returns</dt><dd>true if the if the modulus is in Montgomery form for multiplication, false otherwise </dd></dl> <p>Reimplemented from <a class="el" href="class_modular_arithmetic.html#a7a93adfe41f5545dcfaf3ee9f2b49bc3">ModularArithmetic</a>.</p> <p class="definition">Definition at line <a class="el" href="modarith_8h_source.html#l00290">290</a> of file <a class="el" href="modarith_8h_source.html">modarith.h</a>.</p> </div> </div> <a id="a502f8e7355d1eb252159c0d6e149379a"></a> <h2 class="memtitle"><span class="permalink"><a href="#a502f8e7355d1eb252159c0d6e149379a">◆ </a></span>ConvertIn()</h2> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname"><a class="el" href="class_integer.html">Integer</a> MontgomeryRepresentation::ConvertIn </td> <td>(</td> <td class="paramtype">const <a class="el" href="class_integer.html">Integer</a> & </td> <td class="paramname"><em>a</em></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>Reduces an element in the congruence class. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">a</td><td>element to convert </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>the reduced element</dd></dl> <p>ConvertIn is useful for derived classes, like <a class="el" href="class_montgomery_representation.html" title="Performs modular arithmetic in Montgomery representation for increased speed. ">MontgomeryRepresentation</a>, which must convert between representations. </p> <p>Reimplemented from <a class="el" href="class_modular_arithmetic.html#afc5cb8d95e05c9f8975b1b940218d07c">ModularArithmetic</a>.</p> <p class="definition">Definition at line <a class="el" href="modarith_8h_source.html#l00292">292</a> of file <a class="el" href="modarith_8h_source.html">modarith.h</a>.</p> </div> </div> <a id="a2591b1df42db492ab9792bbe1fc9bf5e"></a> <h2 class="memtitle"><span class="permalink"><a href="#a2591b1df42db492ab9792bbe1fc9bf5e">◆ </a></span>ConvertOut()</h2> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname"><a class="el" href="class_integer.html">Integer</a> MontgomeryRepresentation::ConvertOut </td> <td>(</td> <td class="paramtype">const <a class="el" href="class_integer.html">Integer</a> & </td> <td class="paramname"><em>a</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>Reduces an element in the congruence class. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">a</td><td>element to convert </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>the reduced element</dd></dl> <p>ConvertOut is useful for derived classes, like <a class="el" href="class_montgomery_representation.html" title="Performs modular arithmetic in Montgomery representation for increased speed. ">MontgomeryRepresentation</a>, which must convert between representations. </p> <p>Reimplemented from <a class="el" href="class_modular_arithmetic.html#ac97e7eea935290b4af9e89591f06f4cf">ModularArithmetic</a>.</p> <p class="definition">Definition at line <a class="el" href="integer_8cpp_source.html#l04641">4641</a> of file <a class="el" href="integer_8cpp_source.html">integer.cpp</a>.</p> </div> </div> <a id="aebab2112b22e0af65d4d0048166ca432"></a> <h2 class="memtitle"><span class="permalink"><a href="#aebab2112b22e0af65d4d0048166ca432">◆ </a></span>MultiplicativeIdentity()</h2> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">const <a class="el" href="class_integer.html">Integer</a>& MontgomeryRepresentation::MultiplicativeIdentity </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>Retrieves the multiplicative identity. </p> <dl class="section return"><dt>Returns</dt><dd>the multiplicative identity</dd></dl> <p>the base class implementations returns 1. </p> <p>Reimplemented from <a class="el" href="class_modular_arithmetic.html#af942a7ca057b363cb7a4c74f15a9530e">ModularArithmetic</a>.</p> <p class="definition">Definition at line <a class="el" href="modarith_8h_source.html#l00297">297</a> of file <a class="el" href="modarith_8h_source.html">modarith.h</a>.</p> </div> </div> <a id="a793d265b8165135e2e972bf333ac5a49"></a> <h2 class="memtitle"><span class="permalink"><a href="#a793d265b8165135e2e972bf333ac5a49">◆ </a></span>Multiply()</h2> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">const <a class="el" href="class_integer.html">Integer</a> & MontgomeryRepresentation::Multiply </td> <td>(</td> <td class="paramtype">const <a class="el" href="class_integer.html">Integer</a> & </td> <td class="paramname"><em>a</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="el" href="class_integer.html">Integer</a> & </td> <td class="paramname"><em>b</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>Multiplies elements in the ring. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">a</td><td>the multiplicand </td></tr> <tr><td class="paramname">b</td><td>the multiplier </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>the product of a and b</dd></dl> <p>Multiply returns <code>a*b%n</code>. </p> <p>Reimplemented from <a class="el" href="class_modular_arithmetic.html#a3b88a85b11eb1a826d26d01bdaafbf0a">ModularArithmetic</a>.</p> <p class="definition">Definition at line <a class="el" href="integer_8cpp_source.html#l04615">4615</a> of file <a class="el" href="integer_8cpp_source.html">integer.cpp</a>.</p> </div> </div> <a id="a2f24e4fb6d9b9fc9c6b363d41e7ee449"></a> <h2 class="memtitle"><span class="permalink"><a href="#a2f24e4fb6d9b9fc9c6b363d41e7ee449">◆ </a></span>Square()</h2> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">const <a class="el" href="class_integer.html">Integer</a> & MontgomeryRepresentation::Square </td> <td>(</td> <td class="paramtype">const <a class="el" href="class_integer.html">Integer</a> & </td> <td class="paramname"><em>a</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><a class="el" href="class_square.html" title="Square block cipher. ">Square</a> an element in the ring. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">a</td><td>the element </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>the element squared</dd></dl> <p><a class="el" href="class_square.html" title="Square block cipher. ">Square</a> returns <code>a*a%n</code>. The element <code>a</code> must provide a <a class="el" href="class_square.html" title="Square block cipher. ">Square</a> member function. </p> <p>Reimplemented from <a class="el" href="class_modular_arithmetic.html#a7f74883ad789f0db51ed9b45385c14db">ModularArithmetic</a>.</p> <p class="definition">Definition at line <a class="el" href="integer_8cpp_source.html#l04628">4628</a> of file <a class="el" href="integer_8cpp_source.html">integer.cpp</a>.</p> </div> </div> <a id="ae1c2c1f3144d88ee4cdb2bd5b5a376b8"></a> <h2 class="memtitle"><span class="permalink"><a href="#ae1c2c1f3144d88ee4cdb2bd5b5a376b8">◆ </a></span>MultiplicativeInverse()</h2> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">const <a class="el" href="class_integer.html">Integer</a> & MontgomeryRepresentation::MultiplicativeInverse </td> <td>(</td> <td class="paramtype">const <a class="el" href="class_integer.html">Integer</a> & </td> <td class="paramname"><em>a</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>Calculate the multiplicative inverse of an element in the ring. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">a</td><td>the element</td></tr> </table> </dd> </dl> <p>MultiplicativeInverse returns <code>a<sup>-1</sup>%n</code>. The element <code>a</code> must provide a InverseMod member function. </p> <p>Reimplemented from <a class="el" href="class_modular_arithmetic.html#a149c6c7abe3e1729880658db5650e48a">ModularArithmetic</a>.</p> <p class="definition">Definition at line <a class="el" href="integer_8cpp_source.html#l04654">4654</a> of file <a class="el" href="integer_8cpp_source.html">integer.cpp</a>.</p> </div> </div> <a id="a63d9f4e3b09f34349fcc87059d86a77a"></a> <h2 class="memtitle"><span class="permalink"><a href="#a63d9f4e3b09f34349fcc87059d86a77a">◆ </a></span>CascadeExponentiate()</h2> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname"><a class="el" href="class_integer.html">Integer</a> MontgomeryRepresentation::CascadeExponentiate </td> <td>(</td> <td class="paramtype">const <a class="el" href="class_integer.html">Integer</a> & </td> <td class="paramname"><em>x</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="el" href="class_integer.html">Integer</a> & </td> <td class="paramname"><em>e1</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="el" href="class_integer.html">Integer</a> & </td> <td class="paramname"><em>y</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="el" href="class_integer.html">Integer</a> & </td> <td class="paramname"><em>e2</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">inline</span><span class="mlabel">virtual</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>TODO. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">x</td><td>first element </td></tr> <tr><td class="paramname">e1</td><td>first exponent </td></tr> <tr><td class="paramname">y</td><td>second element </td></tr> <tr><td class="paramname">e2</td><td>second exponent </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>TODO </dd></dl> <p>Reimplemented from <a class="el" href="class_modular_arithmetic.html#abc45ee154d39d39e45e0d0f7a053a8c1">ModularArithmetic</a>.</p> <p class="definition">Definition at line <a class="el" href="modarith_8h_source.html#l00306">306</a> of file <a class="el" href="modarith_8h_source.html">modarith.h</a>.</p> </div> </div> <a id="a1b03500e21a63d27be5c137877b69d43"></a> <h2 class="memtitle"><span class="permalink"><a href="#a1b03500e21a63d27be5c137877b69d43">◆ </a></span>SimultaneousExponentiate()</h2> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">void MontgomeryRepresentation::SimultaneousExponentiate </td> <td>(</td> <td class="paramtype"><a class="el" href="class_integer.html">Element</a> * </td> <td class="paramname"><em>results</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="el" href="class_integer.html">Element</a> & </td> <td class="paramname"><em>base</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="el" href="class_integer.html">Integer</a> * </td> <td class="paramname"><em>exponents</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">unsigned int </td> <td class="paramname"><em>exponentsCount</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">inline</span><span class="mlabel">virtual</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Exponentiates a base to multiple exponents in the ring. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">results</td><td>an array of Elements </td></tr> <tr><td class="paramname">base</td><td>the base to raise to the exponents </td></tr> <tr><td class="paramname">exponents</td><td>an array of exponents </td></tr> <tr><td class="paramname">exponentsCount</td><td>the number of exponents in the array</td></tr> </table> </dd> </dl> <p><a class="el" href="class_montgomery_representation.html#a1b03500e21a63d27be5c137877b69d43" title="Exponentiates a base to multiple exponents in the ring. ">SimultaneousExponentiate()</a> raises the base to each exponent in the exponents array and stores the result at the respective position in the results array.</p> <p><a class="el" href="class_montgomery_representation.html#a1b03500e21a63d27be5c137877b69d43" title="Exponentiates a base to multiple exponents in the ring. ">SimultaneousExponentiate()</a> must be implemented in a derived class. </p><dl class="section pre"><dt>Precondition</dt><dd><code><a class="el" href="misc_8h.html#a2d7e4464ea73d6393ebe78f952253426" title="Counts elements in an array. ">COUNTOF(results)</a> == exponentsCount</code> </dd> <dd> <code><a class="el" href="misc_8h.html#a2d7e4464ea73d6393ebe78f952253426" title="Counts elements in an array. ">COUNTOF(exponents)</a> == exponentsCount</code> </dd></dl> <p>Reimplemented from <a class="el" href="class_modular_arithmetic.html#aaf8e51fdf899092a19520f3e0a367608">ModularArithmetic</a>.</p> <p class="definition">Definition at line <a class="el" href="modarith_8h_source.html#l00309">309</a> of file <a class="el" href="modarith_8h_source.html">modarith.h</a>.</p> </div> </div> <hr/>The documentation for this class was generated from the following files:<ul> <li><a class="el" href="modarith_8h_source.html">modarith.h</a></li> <li><a class="el" href="integer_8cpp_source.html">integer.cpp</a></li> </ul> </div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> Generated on Sun Sep 16 2018 07:58:44 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>