Files
rippled/classripple_1_1detail_1_1Generator.html
2025-11-04 00:36:48 -08:00

296 lines
17 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>rippled: ripple::detail::Generator 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="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.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 id="projectrow">
<td id="projectalign">
<div id="projectname">rippled
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.8 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<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:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="namespaceripple.html">ripple</a></li><li class="navelem"><a class="el" href="namespaceripple_1_1detail.html">detail</a></li><li class="navelem"><a class="el" href="classripple_1_1detail_1_1Generator.html">Generator</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pri-methods">Private Member Functions</a> &#124;
<a href="#pri-attribs">Private Attributes</a> &#124;
<a href="classripple_1_1detail_1_1Generator-members.html">List of all members</a> </div>
<div class="headertitle"><div class="title">ripple::detail::Generator Class Reference</div></div>
</div><!--header-->
<div class="contents">
<p>Produces a sequence of secp256k1 key pairs.
<a href="classripple_1_1detail_1_1Generator.html#details">More...</a></p>
<div class="dynheader">
Collaboration diagram for ripple::detail::Generator:</div>
<div class="dyncontent">
<div class="center"><img src="classripple_1_1detail_1_1Generator__coll__graph.png" border="0" usemap="#aripple_1_1detail_1_1Generator_coll__map" alt="Collaboration graph"/></div>
<map name="aripple_1_1detail_1_1Generator_coll__map" id="aripple_1_1detail_1_1Generator_coll__map">
<area shape="rect" title="Produces a sequence of secp256k1 key pairs." alt="" coords="185,313,362,339"/>
<area shape="rect" href="classripple_1_1base__uint.html" title=" " alt="" coords="116,211,257,251"/>
<area shape="poly" title=" " alt="" coords="215,259,264,311,260,315,211,262"/>
<area shape="rect" target="_parent" href="http://en.cppreference.com/w/cpp/types/size_t.html" title=" " alt="" coords="5,101,93,126"/>
<area shape="poly" title=" " alt="" coords="75,133,166,208,162,212,72,137"/>
<area shape="rect" target="_parent" href="http://en.cppreference.com/w/cpp/container/array.html" title=" " alt="" coords="117,93,285,133"/>
<area shape="poly" title=" " alt="" coords="200,148,192,211,186,210,195,147"/>
<area shape="rect" target="_parent" href="http://en.cppreference.com/w/cpp/types/integer.html" title=" " alt="" coords="150,5,253,31"/>
<area shape="poly" title=" " alt="" coords="204,44,204,93,199,93,199,44"/>
<area shape="rect" target="_parent" href="http://en.cppreference.com/w/cpp/container/array.html" title=" " alt="" coords="281,211,441,251"/>
<area shape="poly" title=" " alt="" coords="336,262,286,315,283,311,332,259"/>
<area shape="rect" target="_parent" href="http://en.cppreference.com/w/cpp/types/integer.html" title=" " alt="" coords="314,101,409,126"/>
<area shape="poly" title=" " alt="" coords="364,140,364,210,359,210,359,140"/>
</map>
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:ae11becc70b55539d04194b61ffe035c3" id="r_ae11becc70b55539d04194b61ffe035c3"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classripple_1_1detail_1_1Generator.html#ae11becc70b55539d04194b61ffe035c3">Generator</a> (<a class="el" href="classripple_1_1Seed.html">Seed</a> const &amp;seed)</td></tr>
<tr class="separator:ae11becc70b55539d04194b61ffe035c3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aeeba66b5e9f8d3786bf3d23f108277ce" id="r_aeeba66b5e9f8d3786bf3d23f108277ce"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classripple_1_1detail_1_1Generator.html#aeeba66b5e9f8d3786bf3d23f108277ce">~Generator</a> ()</td></tr>
<tr class="separator:aeeba66b5e9f8d3786bf3d23f108277ce"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9a74354edbac88be7fc0fbcff8cfdd12" id="r_a9a74354edbac88be7fc0fbcff8cfdd12"><td class="memItemLeft" align="right" valign="top"><a class="elRef" href="http://en.cppreference.com/w/cpp/utility/pair.html">std::pair</a>&lt; <a class="el" href="classripple_1_1PublicKey.html">PublicKey</a>, <a class="el" href="classripple_1_1SecretKey.html">SecretKey</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classripple_1_1detail_1_1Generator.html#a9a74354edbac88be7fc0fbcff8cfdd12">operator()</a> (<a class="elRef" href="http://en.cppreference.com/w/cpp/types/size_t.html">std::size_t</a> ordinal) const</td></tr>
<tr class="memdesc:a9a74354edbac88be7fc0fbcff8cfdd12"><td class="mdescLeft">&#160;</td><td class="mdescRight">Generate the nth key pair. <br /></td></tr>
<tr class="separator:a9a74354edbac88be7fc0fbcff8cfdd12"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pri-methods" name="pri-methods"></a>
Private Member Functions</h2></td></tr>
<tr class="memitem:a034ba31059edc745a9ef73de617c1c1f" id="r_a034ba31059edc745a9ef73de617c1c1f"><td class="memItemLeft" align="right" valign="top"><a class="el" href="namespaceripple.html#a356c68147333a9a48a344718038576d9">uint256</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classripple_1_1detail_1_1Generator.html#a034ba31059edc745a9ef73de617c1c1f">calculateTweak</a> (<a class="elRef" href="http://en.cppreference.com/w/cpp/types/integer.html">std::uint32_t</a> seq) const</td></tr>
<tr class="separator:a034ba31059edc745a9ef73de617c1c1f"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pri-attribs" name="pri-attribs"></a>
Private Attributes</h2></td></tr>
<tr class="memitem:a5a47d648fed09ef1067300e95d6d833f" id="r_a5a47d648fed09ef1067300e95d6d833f"><td class="memItemLeft" align="right" valign="top"><a class="el" href="namespaceripple.html#a356c68147333a9a48a344718038576d9">uint256</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classripple_1_1detail_1_1Generator.html#a5a47d648fed09ef1067300e95d6d833f">root_</a></td></tr>
<tr class="separator:a5a47d648fed09ef1067300e95d6d833f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7cbb4f3a78a09e2fb110c6726e24d859" id="r_a7cbb4f3a78a09e2fb110c6726e24d859"><td class="memItemLeft" align="right" valign="top"><a class="elRef" href="http://en.cppreference.com/w/cpp/container/array.html">std::array</a>&lt; <a class="elRef" href="http://en.cppreference.com/w/cpp/types/integer.html">std::uint8_t</a>, 33 &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classripple_1_1detail_1_1Generator.html#a7cbb4f3a78a09e2fb110c6726e24d859">generator_</a></td></tr>
<tr class="separator:a7cbb4f3a78a09e2fb110c6726e24d859"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Produces a sequence of secp256k1 key pairs. </p>
<p>The reference implementation of the XRP <a class="el" href="classripple_1_1Ledger.html" title="Holds a ledger.">Ledger</a> uses a custom derivation algorithm which enables the derivation of an entire family of secp256k1 keypairs from a single 128-bit seed. The algorithm predates widely-used standards like BIP-32 and BIP-44.</p>
<p>Important note to implementers: </p><pre class="fragment">Using this algorithm is not required: all valid secp256k1 keypairs will
work correctly. Third party implementations can use whatever mechanisms
they prefer. However, implementers of wallets or other tools that allow
users to use existing accounts should consider at least supporting this
derivation technique to make it easier for users to 'import' accounts.
</pre><p> For more details, please check out: <a href="https://xrpl.org/cryptographic-keys.html#secp256k1-key-derivation">https://xrpl.org/cryptographic-keys.html#secp256k1-key-derivation</a> </p>
<p class="definition">Definition at line <a class="el" href="SecretKey_8cpp_source.html#l00119">119</a> of file <a class="el" href="SecretKey_8cpp_source.html">SecretKey.cpp</a>.</p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="ae11becc70b55539d04194b61ffe035c3" name="ae11becc70b55539d04194b61ffe035c3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae11becc70b55539d04194b61ffe035c3">&#9670;&#160;</a></span>Generator()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">ripple::detail::Generator::Generator </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classripple_1_1Seed.html">Seed</a> const &amp;&#160;</td>
<td class="paramname"><em>seed</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">explicit</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p class="definition">Definition at line <a class="el" href="SecretKey_8cpp_source.html#l00160">160</a> of file <a class="el" href="SecretKey_8cpp_source.html">SecretKey.cpp</a>.</p>
</div>
</div>
<a id="aeeba66b5e9f8d3786bf3d23f108277ce" name="aeeba66b5e9f8d3786bf3d23f108277ce"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aeeba66b5e9f8d3786bf3d23f108277ce">&#9670;&#160;</a></span>~Generator()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">ripple::detail::Generator::~Generator </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p class="definition">Definition at line <a class="el" href="SecretKey_8cpp_source.html#l00179">179</a> of file <a class="el" href="SecretKey_8cpp_source.html">SecretKey.cpp</a>.</p>
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a034ba31059edc745a9ef73de617c1c1f" name="a034ba31059edc745a9ef73de617c1c1f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a034ba31059edc745a9ef73de617c1c1f">&#9670;&#160;</a></span>calculateTweak()</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="namespaceripple.html#a356c68147333a9a48a344718038576d9">uint256</a> ripple::detail::Generator::calculateTweak </td>
<td>(</td>
<td class="paramtype"><a class="elRef" href="http://en.cppreference.com/w/cpp/types/integer.html">std::uint32_t</a>&#160;</td>
<td class="paramname"><em>seq</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p class="definition">Definition at line <a class="el" href="SecretKey_8cpp_source.html#l00126">126</a> of file <a class="el" href="SecretKey_8cpp_source.html">SecretKey.cpp</a>.</p>
</div>
</div>
<a id="a9a74354edbac88be7fc0fbcff8cfdd12" name="a9a74354edbac88be7fc0fbcff8cfdd12"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9a74354edbac88be7fc0fbcff8cfdd12">&#9670;&#160;</a></span>operator()()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="elRef" href="http://en.cppreference.com/w/cpp/utility/pair.html">std::pair</a>&lt; <a class="el" href="classripple_1_1PublicKey.html">PublicKey</a>, <a class="el" href="classripple_1_1SecretKey.html">SecretKey</a> &gt; ripple::detail::Generator::operator() </td>
<td>(</td>
<td class="paramtype"><a class="elRef" href="http://en.cppreference.com/w/cpp/types/size_t.html">std::size_t</a>&#160;</td>
<td class="paramname"><em>ordinal</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Generate the nth key pair. </p>
<p class="definition">Definition at line <a class="el" href="SecretKey_8cpp_source.html#l00187">187</a> of file <a class="el" href="SecretKey_8cpp_source.html">SecretKey.cpp</a>.</p>
</div>
</div>
<h2 class="groupheader">Member Data Documentation</h2>
<a id="a5a47d648fed09ef1067300e95d6d833f" name="a5a47d648fed09ef1067300e95d6d833f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5a47d648fed09ef1067300e95d6d833f">&#9670;&#160;</a></span>root_</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="namespaceripple.html#a356c68147333a9a48a344718038576d9">uint256</a> ripple::detail::Generator::root_</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p class="definition">Definition at line <a class="el" href="SecretKey_8cpp_source.html#l00122">122</a> of file <a class="el" href="SecretKey_8cpp_source.html">SecretKey.cpp</a>.</p>
</div>
</div>
<a id="a7cbb4f3a78a09e2fb110c6726e24d859" name="a7cbb4f3a78a09e2fb110c6726e24d859"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7cbb4f3a78a09e2fb110c6726e24d859">&#9670;&#160;</a></span>generator_</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="elRef" href="http://en.cppreference.com/w/cpp/container/array.html">std::array</a>&lt;<a class="elRef" href="http://en.cppreference.com/w/cpp/types/integer.html">std::uint8_t</a>, 33&gt; ripple::detail::Generator::generator_</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p class="definition">Definition at line <a class="el" href="SecretKey_8cpp_source.html#l00123">123</a> of file <a class="el" href="SecretKey_8cpp_source.html">SecretKey.cpp</a>.</p>
</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.8
</small></address>
</body>
</html>