Sophie

Sophie

distrib > Fedora > 14 > x86_64 > by-pkgid > 2aa62c5bbb658df1fece777472a7bcf2 > files > 2395

barry-devel-docs-0.17-0.3.20100730git.fc14.noarch.rpm

<!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"/>
<title>Barry: sha1.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.6.2-20100208 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li><a href="dirs.html"><span>Directories</span></a></li>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="files.html"><span>File&nbsp;List</span></a></li>
    </ul>
  </div>
  <div class="navpath"><a class="el" href="dir_65781e9408669bb8d7d9c025fdb5fe86.html">src</a>
  </div>
</div>
<div class="contents">
<h1>sha1.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> * The contents of this file are subject to the Mozilla Public</span>
<a name="l00003"></a>00003 <span class="comment"> * License Version 1.1 (the &quot;License&quot;); you may not use this file</span>
<a name="l00004"></a>00004 <span class="comment"> * except in compliance with the License. You may obtain a copy of</span>
<a name="l00005"></a>00005 <span class="comment"> * the License at http://www.mozilla.org/MPL/</span>
<a name="l00006"></a>00006 <span class="comment"> *</span>
<a name="l00007"></a>00007 <span class="comment"> * Software distributed under the License is distributed on an &quot;AS</span>
<a name="l00008"></a>00008 <span class="comment"> * IS&quot; basis, WITHOUT WARRANTY OF ANY KIND, either express or</span>
<a name="l00009"></a>00009 <span class="comment"> * implied. See the License for the specific language governing</span>
<a name="l00010"></a>00010 <span class="comment"> * rights and limitations under the License.</span>
<a name="l00011"></a>00011 <span class="comment"> *</span>
<a name="l00012"></a>00012 <span class="comment"> * The Original Code is SHA 180-1 Header File</span>
<a name="l00013"></a>00013 <span class="comment"> *</span>
<a name="l00014"></a>00014 <span class="comment"> * The Initial Developer of the Original Code is Paul Kocher of</span>
<a name="l00015"></a>00015 <span class="comment"> * Cryptography Research.  Portions created by Paul Kocher are</span>
<a name="l00016"></a>00016 <span class="comment"> * Copyright (C) 1995-9 by Cryptography Research, Inc.  All</span>
<a name="l00017"></a>00017 <span class="comment"> * Rights Reserved.</span>
<a name="l00018"></a>00018 <span class="comment"> *</span>
<a name="l00019"></a>00019 <span class="comment"> * Contributor(s):</span>
<a name="l00020"></a>00020 <span class="comment"> *</span>
<a name="l00021"></a>00021 <span class="comment"> *     Paul Kocher</span>
<a name="l00022"></a>00022 <span class="comment"> *</span>
<a name="l00023"></a>00023 <span class="comment"> * Alternatively, the contents of this file may be used under the</span>
<a name="l00024"></a>00024 <span class="comment"> * terms of the GNU General Public License Version 2 or later (the</span>
<a name="l00025"></a>00025 <span class="comment"> * &quot;GPL&quot;), in which case the provisions of the GPL are applicable</span>
<a name="l00026"></a>00026 <span class="comment"> * instead of those above.  If you wish to allow use of your</span>
<a name="l00027"></a>00027 <span class="comment"> * version of this file only under the terms of the GPL and not to</span>
<a name="l00028"></a>00028 <span class="comment"> * allow others to use your version of this file under the MPL,</span>
<a name="l00029"></a>00029 <span class="comment"> * indicate your decision by deleting the provisions above and</span>
<a name="l00030"></a>00030 <span class="comment"> * replace them with the notice and other provisions required by</span>
<a name="l00031"></a>00031 <span class="comment"> * the GPL.  If you do not delete the provisions above, a recipient</span>
<a name="l00032"></a>00032 <span class="comment"> * may use your version of this file under either the MPL or the</span>
<a name="l00033"></a>00033 <span class="comment"> * GPL.</span>
<a name="l00034"></a>00034 <span class="comment"> */</span>
<a name="l00035"></a>00035 
<a name="l00036"></a>00036 <span class="comment">/*</span>
<a name="l00037"></a>00037 <span class="comment">Copied from the git sources, with the following revision history:</span>
<a name="l00038"></a>00038 <span class="comment">commit 77ab8798d3f8df39877235be17bb6e70077aaba2</span>
<a name="l00039"></a>00039 <span class="comment">Author: Junio C Hamano &lt;junkio@cox.net&gt;</span>
<a name="l00040"></a>00040 <span class="comment">Date:   Tue Nov 1 10:56:03 2005 -0800</span>
<a name="l00041"></a>00041 <span class="comment"></span>
<a name="l00042"></a>00042 <span class="comment">    Fix constness of input in mozilla-sha1/sha1.c::SHA1_Update().</span>
<a name="l00043"></a>00043 <span class="comment"></span>
<a name="l00044"></a>00044 <span class="comment">    Among the three of our own implementations, only this one lacked</span>
<a name="l00045"></a>00045 <span class="comment">    &quot;const&quot; from the second argument.</span>
<a name="l00046"></a>00046 <span class="comment"></span>
<a name="l00047"></a>00047 <span class="comment">    Signed-off-by: Junio C Hamano &lt;junkio@cox.net&gt;</span>
<a name="l00048"></a>00048 <span class="comment"></span>
<a name="l00049"></a>00049 <span class="comment">commit cef661fc799a3a13ffdea4a3f69f1acd295de53d</span>
<a name="l00050"></a>00050 <span class="comment">Author: Linus Torvalds &lt;torvalds@ppc970.osdl.org&gt;</span>
<a name="l00051"></a>00051 <span class="comment">Date:   Thu Apr 21 12:33:22 2005 -0700</span>
<a name="l00052"></a>00052 <span class="comment"></span>
<a name="l00053"></a>00053 <span class="comment">    Add support for alternate SHA1 library implementations.</span>
<a name="l00054"></a>00054 <span class="comment"></span>
<a name="l00055"></a>00055 <span class="comment">    This one includes the Mozilla SHA1 implementation sent in by Edgar Toernig.</span>
<a name="l00056"></a>00056 <span class="comment">    It&#39;s dual-licenced under MPL-1.1 or GPL, so in the context of git, we</span>
<a name="l00057"></a>00057 <span class="comment">    obviously use the GPL version.</span>
<a name="l00058"></a>00058 <span class="comment"></span>
<a name="l00059"></a>00059 <span class="comment">    Side note: the Mozilla SHA1 implementation is about twice as fast as the</span>
<a name="l00060"></a>00060 <span class="comment">    default openssl one on my G5, but the default openssl one has optimized</span>
<a name="l00061"></a>00061 <span class="comment">    x86 assembly language on x86. So choose wisely.</span>
<a name="l00062"></a>00062 <span class="comment"></span>
<a name="l00063"></a>00063 <span class="comment">*/</span>
<a name="l00064"></a>00064 
<a name="l00065"></a>00065 <span class="preprocessor">#ifndef __BARRY_SHA1_H__</span>
<a name="l00066"></a>00066 <span class="preprocessor"></span><span class="preprocessor">#define __BARRY_SHA1_H__</span>
<a name="l00067"></a>00067 <span class="preprocessor"></span>
<a name="l00068"></a>00068 <span class="preprocessor">#include &quot;<a class="code" href="dll_8h.html" title="Macros for handling DLL/library API visibility.">dll.h</a>&quot;</span>
<a name="l00069"></a>00069 
<a name="l00070"></a>00070 <span class="preprocessor">#define SHA_DIGEST_LENGTH 20</span>
<a name="l00071"></a>00071 <span class="preprocessor"></span>
<a name="l00072"></a>00072 <span class="keyword">namespace </span>Barry {
<a name="l00073"></a>00073 
<a name="l00074"></a><a class="code" href="structBarry_1_1SHA__CTX.html">00074</a> <span class="keyword">struct </span>BXEXPORT <a class="code" href="structBarry_1_1SHA__CTX.html">SHA_CTX</a> {
<a name="l00075"></a>00075   <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> H[5];
<a name="l00076"></a>00076   <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> W[80];
<a name="l00077"></a>00077   <span class="keywordtype">int</span> lenW;
<a name="l00078"></a>00078   <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> sizeHi,sizeLo;
<a name="l00079"></a>00079 };
<a name="l00080"></a>00080 
<a name="l00081"></a>00081 BXEXPORT <span class="keywordtype">void</span> SHA1(<span class="keyword">const</span> <span class="keywordtype">void</span> *dataIn, <span class="keywordtype">int</span> len, <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *hashout);
<a name="l00082"></a>00082 BXEXPORT <span class="keywordtype">void</span> SHA1_Init(<a class="code" href="structBarry_1_1SHA__CTX.html">SHA_CTX</a> *ctx);
<a name="l00083"></a>00083 BXEXPORT <span class="keywordtype">void</span> SHA1_Update(<a class="code" href="structBarry_1_1SHA__CTX.html">SHA_CTX</a> *ctx, <span class="keyword">const</span> <span class="keywordtype">void</span> *dataIn, <span class="keywordtype">int</span> len);
<a name="l00084"></a>00084 BXEXPORT <span class="keywordtype">void</span> SHA1_Final(<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> hashout[20], <a class="code" href="structBarry_1_1SHA__CTX.html">SHA_CTX</a> *ctx);
<a name="l00085"></a>00085 
<a name="l00086"></a>00086 }
<a name="l00087"></a>00087 
<a name="l00088"></a>00088 <span class="preprocessor">#endif</span>
<a name="l00089"></a>00089 <span class="preprocessor"></span>
</pre></div></div>
<hr class="footer"/><address style="text-align: right;"><small>Generated by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2-20100208 </small></address>
</body>
</html>