Files
rippled/classripple_1_1hardened__hash.html
2021-06-04 17:39:30 +00:00

254 lines
15 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">
<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.17"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>rippled: ripple::hardened_hash&lt; HashAlgorithm &gt; Class Template Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="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 style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">rippled
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.17 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @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:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(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">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</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="classripple_1_1hardened__hash.html">hardened_hash</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-types">Public Types</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pri-attribs">Private Attributes</a> &#124;
<a href="classripple_1_1hardened__hash-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">ripple::hardened_hash&lt; HashAlgorithm &gt; Class Template Reference</div> </div>
</div><!--header-->
<div class="contents">
<p><a class="el" href="classripple_1_1Seed.html" title="Seeds are used to generate deterministic secret keys.">Seed</a> functor once per construction.
<a href="classripple_1_1hardened__hash.html#details">More...</a></p>
<div class="dynheader">
Inheritance diagram for ripple::hardened_hash&lt; HashAlgorithm &gt;:</div>
<div class="dyncontent">
<div class="center"><img src="classripple_1_1hardened__hash__inherit__graph.png" border="0" usemap="#ripple_1_1hardened__hash_3_01HashAlgorithm_01_4_inherit__map" alt="Inheritance graph"/></div>
<map name="ripple_1_1hardened__hash_3_01HashAlgorithm_01_4_inherit__map" id="ripple_1_1hardened__hash_3_01HashAlgorithm_01_4_inherit__map">
<area shape="rect" title="Seed functor once per construction." alt="" coords="75,5,242,47"/>
<area shape="rect" href="structstd_1_1hash_3_01ripple_1_1Currency_01_4.html" title=" " alt="" coords="5,95,147,136"/>
<area shape="rect" href="structstd_1_1hash_3_01ripple_1_1Directory_01_4.html" title=" " alt="" coords="171,95,312,136"/>
</map>
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
<div class="dynheader">
Collaboration diagram for ripple::hardened_hash&lt; HashAlgorithm &gt;:</div>
<div class="dyncontent">
<div class="center"><img src="classripple_1_1hardened__hash__coll__graph.png" border="0" usemap="#ripple_1_1hardened__hash_3_01HashAlgorithm_01_4_coll__map" alt="Collaboration graph"/></div>
<map name="ripple_1_1hardened__hash_3_01HashAlgorithm_01_4_coll__map" id="ripple_1_1hardened__hash_3_01HashAlgorithm_01_4_coll__map">
<area shape="rect" title="Seed functor once per construction." alt="" coords="5,213,172,255"/>
<area shape="rect" href="http://en.cppreference.com/w/cpp/utility/pair.html" title=" " alt="" coords="9,109,168,151"/>
<area shape="rect" title=" " alt="" coords="69,5,108,32"/>
</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 name="pub-types"></a>
Public Types</h2></td></tr>
<tr class="memitem:a0447c9ec0860439ed67f13cd9d01b732"><td class="memItemLeft" align="right" valign="top">using&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classripple_1_1hardened__hash.html#a0447c9ec0860439ed67f13cd9d01b732">result_type</a> = typename HashAlgorithm::result_type</td></tr>
<tr class="separator:a0447c9ec0860439ed67f13cd9d01b732"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><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:ac5fe30a6c4b1f14433a2598323cf8ddf"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classripple_1_1hardened__hash.html#ac5fe30a6c4b1f14433a2598323cf8ddf">hardened_hash</a> ()</td></tr>
<tr class="separator:ac5fe30a6c4b1f14433a2598323cf8ddf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:addb99e4c2034d9eb2027345e4f50ce34"><td class="memTemplParams" colspan="2">template&lt;class T &gt; </td></tr>
<tr class="memitem:addb99e4c2034d9eb2027345e4f50ce34"><td class="memTemplItemLeft" align="right" valign="top"><a class="el" href="classripple_1_1hardened__hash.html#a0447c9ec0860439ed67f13cd9d01b732">result_type</a>&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classripple_1_1hardened__hash.html#addb99e4c2034d9eb2027345e4f50ce34">operator()</a> (T const &amp;t) const noexcept</td></tr>
<tr class="separator:addb99e4c2034d9eb2027345e4f50ce34"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pri-attribs"></a>
Private Attributes</h2></td></tr>
<tr class="memitem:a3765aed06bf6e6296439d0fc70c709a3"><td class="memItemLeft" align="right" valign="top"><a class="el" href="namespaceripple_1_1detail.html#ab71dc38912727712056be6817a81bcd1">detail::seed_pair</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classripple_1_1hardened__hash.html#a3765aed06bf6e6296439d0fc70c709a3">m_seeds</a></td></tr>
<tr class="separator:a3765aed06bf6e6296439d0fc70c709a3"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><h3>template&lt;class HashAlgorithm = beast::xxhasher&gt;<br />
class ripple::hardened_hash&lt; HashAlgorithm &gt;</h3>
<p><a class="el" href="classripple_1_1Seed.html" title="Seeds are used to generate deterministic secret keys.">Seed</a> functor once per construction. </p>
<p>A std compatible hash adapter that resists adversarial inputs. For this to work, T must implement in its own namespace:</p>
<div class="fragment"><div class="line"><span class="keyword">template</span> &lt;<span class="keyword">class</span> Hasher&gt;</div>
<div class="line"><span class="keywordtype">void</span></div>
<div class="line"><a class="code" href="namespaceripple.html#a9c3a01178261b6e8a98c0ea99f01d154">hash_append</a> (Hasher&amp; h, T <span class="keyword">const</span>&amp; t) noexcept</div>
<div class="line">{</div>
<div class="line"> <span class="comment">// hash_append each base and member that should</span></div>
<div class="line"> <span class="comment">// participate in forming the hash</span></div>
<div class="line"> <span class="keyword">using</span> <a class="code" href="namespacebeast.html#a4a9eebb8b68941c49b07763d7a95d456">beast::hash_append</a>;</div>
<div class="line"> <a class="code" href="namespaceripple.html#a9c3a01178261b6e8a98c0ea99f01d154">hash_append</a> (h, <span class="keyword">static_cast&lt;</span>T::base1 const&amp;<span class="keyword">&gt;</span>(t));</div>
<div class="line"> <a class="code" href="namespaceripple.html#a9c3a01178261b6e8a98c0ea99f01d154">hash_append</a> (h, <span class="keyword">static_cast&lt;</span>T::base2 const&amp;<span class="keyword">&gt;</span>(t));</div>
<div class="line"> <span class="comment">// ...</span></div>
<div class="line"> <a class="code" href="namespaceripple.html#a9c3a01178261b6e8a98c0ea99f01d154">hash_append</a> (h, t.member1);</div>
<div class="line"> <a class="code" href="namespaceripple.html#a9c3a01178261b6e8a98c0ea99f01d154">hash_append</a> (h, t.member2);</div>
<div class="line"> <span class="comment">// ...</span></div>
<div class="line">}</div>
</div><!-- fragment --><p>Do not use any version of Murmur or CityHash for the Hasher template parameter (the hashing algorithm). For details see <a href="https://131002.net/siphash/#at">https://131002.net/siphash/#at</a> </p>
<p class="definition">Definition at line <a class="el" href="hardened__hash_8h_source.html#l00096">96</a> of file <a class="el" href="hardened__hash_8h_source.html">hardened_hash.h</a>.</p>
</div><h2 class="groupheader">Member Typedef Documentation</h2>
<a id="a0447c9ec0860439ed67f13cd9d01b732"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0447c9ec0860439ed67f13cd9d01b732">&#9670;&nbsp;</a></span>result_type</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class HashAlgorithm = beast::xxhasher&gt; </div>
<table class="memname">
<tr>
<td class="memname">using <a class="el" href="classripple_1_1hardened__hash.html">ripple::hardened_hash</a>&lt; HashAlgorithm &gt;::<a class="el" href="classripple_1_1hardened__hash.html#a0447c9ec0860439ed67f13cd9d01b732">result_type</a> = typename HashAlgorithm::result_type</td>
</tr>
</table>
</div><div class="memdoc">
<p class="definition">Definition at line <a class="el" href="hardened__hash_8h_source.html#l00102">102</a> of file <a class="el" href="hardened__hash_8h_source.html">hardened_hash.h</a>.</p>
</div>
</div>
<h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="ac5fe30a6c4b1f14433a2598323cf8ddf"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac5fe30a6c4b1f14433a2598323cf8ddf">&#9670;&nbsp;</a></span>hardened_hash()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class HashAlgorithm = beast::xxhasher&gt; </div>
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classripple_1_1hardened__hash.html">ripple::hardened_hash</a>&lt; HashAlgorithm &gt;::<a class="el" href="classripple_1_1hardened__hash.html">hardened_hash</a> </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="hardened__hash_8h_source.html#l00104">104</a> of file <a class="el" href="hardened__hash_8h_source.html">hardened_hash.h</a>.</p>
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="addb99e4c2034d9eb2027345e4f50ce34"></a>
<h2 class="memtitle"><span class="permalink"><a href="#addb99e4c2034d9eb2027345e4f50ce34">&#9670;&nbsp;</a></span>operator()()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class HashAlgorithm = beast::xxhasher&gt; </div>
<div class="memtemplate">
template&lt;class T &gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classripple_1_1hardened__hash.html#a0447c9ec0860439ed67f13cd9d01b732">result_type</a> <a class="el" href="classripple_1_1hardened__hash.html">ripple::hardened_hash</a>&lt; HashAlgorithm &gt;::operator() </td>
<td>(</td>
<td class="paramtype">T const &amp;&#160;</td>
<td class="paramname"><em>t</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">noexcept</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p class="definition">Definition at line <a class="el" href="hardened__hash_8h_source.html#l00110">110</a> of file <a class="el" href="hardened__hash_8h_source.html">hardened_hash.h</a>.</p>
</div>
</div>
<h2 class="groupheader">Member Data Documentation</h2>
<a id="a3765aed06bf6e6296439d0fc70c709a3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3765aed06bf6e6296439d0fc70c709a3">&#9670;&nbsp;</a></span>m_seeds</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class HashAlgorithm = beast::xxhasher&gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="namespaceripple_1_1detail.html#ab71dc38912727712056be6817a81bcd1">detail::seed_pair</a> <a class="el" href="classripple_1_1hardened__hash.html">ripple::hardened_hash</a>&lt; HashAlgorithm &gt;::m_seeds</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="hardened__hash_8h_source.html#l00099">99</a> of file <a class="el" href="hardened__hash_8h_source.html">hardened_hash.h</a>.</p>
</div>
</div>
</div><!-- contents -->
<div class="ttc" id="anamespacebeast_html_a4a9eebb8b68941c49b07763d7a95d456"><div class="ttname"><a href="namespacebeast.html#a4a9eebb8b68941c49b07763d7a95d456">beast::hash_append</a></div><div class="ttdeci">std::enable_if_t&lt; is_contiguously_hashable&lt; T, Hasher &gt;::value &gt; hash_append(Hasher &amp;h, T const &amp;t) noexcept</div><div class="ttdoc">Logically concatenate input data to a Hasher.</div><div class="ttdef"><b>Definition:</b> <a href="hash__append_8h_source.html#l00236">hash_append.h:236</a></div></div>
<div class="ttc" id="anamespaceripple_html_a9c3a01178261b6e8a98c0ea99f01d154"><div class="ttname"><a href="namespaceripple.html#a9c3a01178261b6e8a98c0ea99f01d154">ripple::hash_append</a></div><div class="ttdeci">void hash_append(Hasher &amp;h, ValidatorBlobInfo const &amp;blobInfo)</div><div class="ttdef"><b>Definition:</b> <a href="ValidatorList_8h_source.html#l00897">ValidatorList.h:897</a></div></div>
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.17
</small></address>
</body>
</html>