⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sha2_8h-source.html

📁 apr函数库使用手册
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>Apache Portable Runtime: sha2.h Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.7 -->
<div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related&nbsp;Pages</a></div>
<h1>sha2.h</h1><pre class="fragment"><div>00001 <span class="comment">/* Copyright 2003-2005 The Apache Software Foundation or its licensors, as</span>
00002 <span class="comment"> * applicable.</span>
00003 <span class="comment"> *</span>
00004 <span class="comment"> * Licensed under the Apache License, Version 2.0 (the "License");</span>
00005 <span class="comment"> * you may not use this file except in compliance with the License.</span>
00006 <span class="comment"> * You may obtain a copy of the License at</span>
00007 <span class="comment"> *</span>
00008 <span class="comment"> *     http://www.apache.org/licenses/LICENSE-2.0</span>
00009 <span class="comment"> *</span>
00010 <span class="comment"> * Unless required by applicable law or agreed to in writing, software</span>
00011 <span class="comment"> * distributed under the License is distributed on an "AS IS" BASIS,</span>
00012 <span class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span>
00013 <span class="comment"> * See the License for the specific language governing permissions and</span>
00014 <span class="comment"> * limitations under the License.</span>
00015 <span class="comment"> */</span>
00016 <span class="comment">/*</span>
00017 <span class="comment"> * FILE:        sha2.h</span>
00018 <span class="comment"> * AUTHOR:      Aaron D. Gifford &lt;me@aarongifford.com&gt;</span>
00019 <span class="comment"> * </span>
00020 <span class="comment"> * A licence was granted to the ASF by Aaron on 4 November 2003.</span>
00021 <span class="comment"> */</span>
00022 
00023 <span class="preprocessor">#ifndef __SHA2_H__</span>
00024 <span class="preprocessor"></span><span class="preprocessor">#define __SHA2_H__</span>
00025 <span class="preprocessor"></span>
00026 <span class="preprocessor">#ifdef __cplusplus</span>
00027 <span class="preprocessor"></span><span class="keyword">extern</span> <span class="stringliteral">"C"</span> {
00028 <span class="preprocessor">#endif</span>
00029 <span class="preprocessor"></span>
00030 <span class="preprocessor">#include "apr.h"</span>
00031 
00032 <span class="comment">/*** SHA-256/384/512 Various Length Definitions ***********************/</span>
00033 <span class="preprocessor">#define SHA256_BLOCK_LENGTH             64</span>
00034 <span class="preprocessor"></span><span class="preprocessor">#define SHA256_DIGEST_LENGTH            32</span>
00035 <span class="preprocessor"></span><span class="preprocessor">#define SHA256_DIGEST_STRING_LENGTH     (SHA256_DIGEST_LENGTH * 2 + 1)</span>
00036 <span class="preprocessor"></span><span class="preprocessor">#define SHA384_BLOCK_LENGTH             128</span>
00037 <span class="preprocessor"></span><span class="preprocessor">#define SHA384_DIGEST_LENGTH            48</span>
00038 <span class="preprocessor"></span><span class="preprocessor">#define SHA384_DIGEST_STRING_LENGTH     (SHA384_DIGEST_LENGTH * 2 + 1)</span>
00039 <span class="preprocessor"></span><span class="preprocessor">#define SHA512_BLOCK_LENGTH             128</span>
00040 <span class="preprocessor"></span><span class="preprocessor">#define SHA512_DIGEST_LENGTH            64</span>
00041 <span class="preprocessor"></span><span class="preprocessor">#define SHA512_DIGEST_STRING_LENGTH     (SHA512_DIGEST_LENGTH * 2 + 1)</span>
00042 <span class="preprocessor"></span>
00043 
00044 <span class="comment">/*** SHA-256/384/512 Context Structures *******************************/</span>
00045 <span class="keyword">typedef</span> <span class="keyword">struct </span>_SHA256_CTX {
00046         apr_uint32_t    state[8];
00047         apr_uint64_t    bitcount;
00048         apr_byte_t      buffer[SHA256_BLOCK_LENGTH];
00049 } SHA256_CTX;
00050 <span class="keyword">typedef</span> <span class="keyword">struct </span>_SHA512_CTX {
00051         apr_uint64_t    state[8];
00052         apr_uint64_t    bitcount[2];
00053         apr_byte_t      buffer[SHA512_BLOCK_LENGTH];
00054 } SHA512_CTX;
00055 
00056 <span class="keyword">typedef</span> SHA512_CTX SHA384_CTX;
00057 
00058 
00059 <span class="comment">/*** SHA-256/384/512 Function Prototypes ******************************/</span>
00060 <span class="keywordtype">void</span> SHA256_Init(SHA256_CTX *);
00061 <span class="keywordtype">void</span> SHA256_Update(SHA256_CTX *, <span class="keyword">const</span> apr_byte_t *, size_t);
00062 <span class="keywordtype">void</span> SHA256_Final(apr_byte_t [SHA256_DIGEST_LENGTH], SHA256_CTX *);
00063 <span class="keywordtype">char</span>* SHA256_End(SHA256_CTX *, <span class="keywordtype">char</span> [SHA256_DIGEST_STRING_LENGTH]);
00064 <span class="keywordtype">char</span>* SHA256_Data(<span class="keyword">const</span> apr_byte_t *, size_t,
00065                   <span class="keywordtype">char</span> [SHA256_DIGEST_STRING_LENGTH]);
00066 
00067 <span class="keywordtype">void</span> SHA384_Init(SHA384_CTX *);
00068 <span class="keywordtype">void</span> SHA384_Update(SHA384_CTX *, <span class="keyword">const</span> apr_byte_t *, size_t);
00069 <span class="keywordtype">void</span> SHA384_Final(apr_byte_t [SHA384_DIGEST_LENGTH], SHA384_CTX *);
00070 <span class="keywordtype">char</span>* SHA384_End(SHA384_CTX *, <span class="keywordtype">char</span> [SHA384_DIGEST_STRING_LENGTH]);
00071 <span class="keywordtype">char</span>* SHA384_Data(<span class="keyword">const</span> apr_byte_t *, size_t,
00072                   <span class="keywordtype">char</span> [SHA384_DIGEST_STRING_LENGTH]);
00073 
00074 <span class="keywordtype">void</span> SHA512_Init(SHA512_CTX *);
00075 <span class="keywordtype">void</span> SHA512_Update(SHA512_CTX *, <span class="keyword">const</span> apr_byte_t *, size_t);
00076 <span class="keywordtype">void</span> SHA512_Final(apr_byte_t [SHA512_DIGEST_LENGTH], SHA512_CTX *);
00077 <span class="keywordtype">char</span>* SHA512_End(SHA512_CTX *, <span class="keywordtype">char</span> [SHA512_DIGEST_STRING_LENGTH]);
00078 <span class="keywordtype">char</span>* SHA512_Data(<span class="keyword">const</span> apr_byte_t *, size_t,
00079                   <span class="keywordtype">char</span> [SHA512_DIGEST_STRING_LENGTH]);
00080 
00081 <span class="preprocessor">#ifdef  __cplusplus</span>
00082 <span class="preprocessor"></span>}
00083 <span class="preprocessor">#endif </span><span class="comment">/* __cplusplus */</span>
00084 
00085 <span class="preprocessor">#endif </span><span class="comment">/* __SHA2_H__ */</span>
00086 
</div></pre><hr size="1"><address style="align: right;"><small>Generated on Mon Feb 7 13:18:25 2005 for Apache Portable Runtime by
<a href="../../../www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 ></a> 1.3.7 </small></address>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -