mirror of
https://github.com/aaru-dps/libaaruformat.git
synced 2026-07-09 02:16:24 +00:00
152 lines
14 KiB
HTML
152 lines
14 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.16.1"/>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
|
<title>libaaruformat: src/lib/reed_solomon.h Source File</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>
|
|
<script type="text/javascript" src="clipboard.js"></script>
|
|
<link href="navtree.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="navtreedata.js"></script>
|
|
<script type="text/javascript" src="navtree.js"></script>
|
|
<script type="text/javascript" src="cookie.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">libaaruformat<span id="projectnumber"> 1.0</span>
|
|
</div>
|
|
<div id="projectbrief">Aaru Data Preservation Suite - Format Library</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<!-- end header part -->
|
|
<!-- Generated by Doxygen 1.16.1 -->
|
|
<script type="text/javascript">
|
|
var searchBox = new SearchBox("searchBox", "search/",'.html');
|
|
</script>
|
|
<script type="text/javascript">
|
|
$(function() { codefold.init(); });
|
|
</script>
|
|
<script type="text/javascript" src="menudata.js"></script>
|
|
<script type="text/javascript" src="menu.js"></script>
|
|
<script type="text/javascript">
|
|
$(function() {
|
|
initMenu('',true,false,'search.php','Search',true);
|
|
$(function() { init_search(); });
|
|
});
|
|
</script>
|
|
<div id="main-nav"></div>
|
|
</div><!-- top -->
|
|
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
|
<div id="nav-tree">
|
|
<div id="nav-tree-contents">
|
|
<div id="nav-sync" class="sync"></div>
|
|
</div>
|
|
</div>
|
|
<div id="splitbar" style="-moz-user-select:none;"
|
|
class="ui-resizable-handle">
|
|
</div>
|
|
</div>
|
|
<script type="text/javascript">
|
|
$(function(){initNavTree('reed__solomon_8h_source.html','',''); });
|
|
</script>
|
|
<div id="container">
|
|
<div id="doc-content">
|
|
<!-- 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 class="header">
|
|
<div class="headertitle"><div class="title">reed_solomon.h</div></div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
<a href="reed__solomon_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="comment">/*</span></div>
|
|
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="comment"> * This file is part of the Aaru Data Preservation Suite.</span></div>
|
|
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="comment"> * Copyright (c) 2019-2026 Natalia Portillo.</span></div>
|
|
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span><span class="comment"> *</span></div>
|
|
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="comment"> * This library is free software; you can redistribute it and/or modify</span></div>
|
|
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span><span class="comment"> * it under the terms of the GNU Lesser General Public License as</span></div>
|
|
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="comment"> * published by the Free Software Foundation; either version 2.1 of the</span></div>
|
|
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span><span class="comment"> * License, or (at your option) any later version.</span></div>
|
|
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="comment"> *</span></div>
|
|
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="comment"> * This library is distributed in the hope that it will be useful, but</span></div>
|
|
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span><span class="comment"> * WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
|
|
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span><span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</span></div>
|
|
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span><span class="comment"> * Lesser General Public License for more details.</span></div>
|
|
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span><span class="comment"> *</span></div>
|
|
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span><span class="comment"> * You should have received a copy of the GNU Lesser General Public</span></div>
|
|
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span><span class="comment"> * License along with this library; if not, see <http://www.gnu.org/licenses/>.</span></div>
|
|
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span><span class="comment"> */</span></div>
|
|
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span> </div>
|
|
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span><span class="preprocessor">#ifndef LIBAARUFORMAT_REED_SOLOMON_H</span></div>
|
|
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span><span class="preprocessor">#define LIBAARUFORMAT_REED_SOLOMON_H</span></div>
|
|
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span> </div>
|
|
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span><span class="preprocessor">#include <stddef.h></span></div>
|
|
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span><span class="preprocessor">#include <stdint.h></span></div>
|
|
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span></div>
|
|
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"><a class="line" href="reed__solomon_8h.html#ace7e61e5a01187874383508c0c13a228"> 28</a></span><span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code hl_struct" href="structrs__context.html">rs_context</a> <a class="code hl_struct" href="structrs__context.html">rs_context</a>;</div>
|
|
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span></div>
|
|
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span><a class="code hl_struct" href="structrs__context.html">rs_context</a> *<a class="code hl_function" href="reed__solomon_8h.html#a68a7b13ef6443640abc2818a3bd7d5bf">rs_create</a>(uint16_t <a class="code hl_variable" href="sha256_8c.html#a22c6551e88df4c5c42fce3d0641adb64">K</a>, uint16_t <a class="code hl_variable" href="structrs__context.html#a99a1308586c359eb0a9e01013f747ce0">M</a>);</div>
|
|
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span></div>
|
|
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span><span class="keywordtype">void</span> <a class="code hl_function" href="reed__solomon_8h.html#a5eed1476ef3e8666f011b529337b8518">rs_free</a>(<a class="code hl_struct" href="structrs__context.html">rs_context</a> *ctx);</div>
|
|
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span></div>
|
|
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span>uint8_t <a class="code hl_function" href="reed__solomon_8h.html#ada549b6a6028807b96d975bba70bea2d">rs_get_coefficient</a>(<span class="keyword">const</span> <a class="code hl_struct" href="structrs__context.html">rs_context</a> *ctx, uint16_t m, uint16_t k);</div>
|
|
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span></div>
|
|
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span><span class="keywordtype">void</span> <a class="code hl_function" href="reed__solomon_8h.html#ab02dd67e8f4b96de007048f30649adb1">rs_encode_incremental</a>(uint8_t coeff, <span class="keyword">const</span> uint8_t *data, uint8_t *parity, <span class="keywordtype">size_t</span> shard_size);</div>
|
|
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span></div>
|
|
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span><span class="keywordtype">int</span> <a class="code hl_function" href="reed__solomon_8h.html#aea0122b72cfa6f77a4751d5466e73024">rs_decode</a>(<span class="keyword">const</span> <a class="code hl_struct" href="structrs__context.html">rs_context</a> *ctx, uint8_t **shards, <span class="keyword">const</span> uint8_t *present, <span class="keywordtype">size_t</span> shard_size);</div>
|
|
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span> </div>
|
|
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span><span class="preprocessor">#endif </span><span class="comment">/* LIBAARUFORMAT_REED_SOLOMON_H */</span><span class="preprocessor"></span></div>
|
|
<div class="ttc" id="areed__solomon_8h_html_a5eed1476ef3e8666f011b529337b8518"><div class="ttname"><a href="reed__solomon_8h.html#a5eed1476ef3e8666f011b529337b8518">rs_free</a></div><div class="ttdeci">void rs_free(rs_context *ctx)</div><div class="ttdoc">Free a Reed-Solomon codec context.</div><div class="ttdef"><b>Definition</b> <a href="reed__solomon_8c_source.html#l00201">reed_solomon.c:201</a></div></div>
|
|
<div class="ttc" id="areed__solomon_8h_html_a68a7b13ef6443640abc2818a3bd7d5bf"><div class="ttname"><a href="reed__solomon_8h.html#a68a7b13ef6443640abc2818a3bd7d5bf">rs_create</a></div><div class="ttdeci">rs_context * rs_create(uint16_t K, uint16_t M)</div><div class="ttdoc">Create a Reed-Solomon codec for RS(K, M) over GF(2^8).</div><div class="ttdef"><b>Definition</b> <a href="reed__solomon_8c_source.html#l00150">reed_solomon.c:150</a></div></div>
|
|
<div class="ttc" id="areed__solomon_8h_html_ab02dd67e8f4b96de007048f30649adb1"><div class="ttname"><a href="reed__solomon_8h.html#ab02dd67e8f4b96de007048f30649adb1">rs_encode_incremental</a></div><div class="ttdeci">void rs_encode_incremental(uint8_t coeff, const uint8_t *data, uint8_t *parity, size_t shard_size)</div><div class="ttdoc">Incrementally accumulate one data shard's contribution to one parity shard.</div><div class="ttdef"><b>Definition</b> <a href="reed__solomon_8c_source.html#l00213">reed_solomon.c:213</a></div></div>
|
|
<div class="ttc" id="areed__solomon_8h_html_ada549b6a6028807b96d975bba70bea2d"><div class="ttname"><a href="reed__solomon_8h.html#ada549b6a6028807b96d975bba70bea2d">rs_get_coefficient</a></div><div class="ttdeci">uint8_t rs_get_coefficient(const rs_context *ctx, uint16_t m, uint16_t k)</div><div class="ttdoc">Get the generator matrix coefficient for parity shard m, data shard k.</div><div class="ttdef"><b>Definition</b> <a href="reed__solomon_8c_source.html#l00208">reed_solomon.c:208</a></div></div>
|
|
<div class="ttc" id="areed__solomon_8h_html_aea0122b72cfa6f77a4751d5466e73024"><div class="ttname"><a href="reed__solomon_8h.html#aea0122b72cfa6f77a4751d5466e73024">rs_decode</a></div><div class="ttdeci">int rs_decode(const rs_context *ctx, uint8_t **shards, const uint8_t *present, size_t shard_size)</div><div class="ttdoc">Decode (reconstruct) erased shards.</div><div class="ttdef"><b>Definition</b> <a href="reed__solomon_8c_source.html#l00218">reed_solomon.c:218</a></div></div>
|
|
<div class="ttc" id="asha256_8c_html_a22c6551e88df4c5c42fce3d0641adb64"><div class="ttname"><a href="sha256_8c.html#a22c6551e88df4c5c42fce3d0641adb64">K</a></div><div class="ttdeci">static const uint32_t K[64]</div><div class="ttdef"><b>Definition</b> <a href="sha256_8c_source.html#l00031">sha256.c:31</a></div></div>
|
|
<div class="ttc" id="astructrs__context_html"><div class="ttname"><a href="structrs__context.html">rs_context</a></div><div class="ttdef"><b>Definition</b> <a href="reed__solomon_8c_source.html#l00043">reed_solomon.c:44</a></div></div>
|
|
<div class="ttc" id="astructrs__context_html_a99a1308586c359eb0a9e01013f747ce0"><div class="ttname"><a href="structrs__context.html#a99a1308586c359eb0a9e01013f747ce0">rs_context::M</a></div><div class="ttdeci">uint16_t M</div><div class="ttdoc">Number of parity shards.</div><div class="ttdef"><b>Definition</b> <a href="reed__solomon_8c_source.html#l00046">reed_solomon.c:46</a></div></div>
|
|
</div><!-- fragment --></div><!-- contents -->
|
|
</div><!-- doc-content -->
|
|
</div><!-- container -->
|
|
<!-- start footer part -->
|
|
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
|
<ul>
|
|
<li class="navelem"><a href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a href="dir_c85d3e3c5052e9ad9ce18c6863244a25.html">lib</a></li><li class="navelem"><a href="reed__solomon_8h.html">reed_solomon.h</a></li>
|
|
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.16.1 </li>
|
|
</ul>
|
|
</div>
|
|
</body>
|
|
</html>
|