Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
9dbc41d7
T
Third Party Openssl
项目概览
OpenHarmony
/
Third Party Openssl
9 个月 前同步成功
通知
8
Star
18
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Third Party Openssl
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
9dbc41d7
编写于
2月 03, 2000
作者:
U
Ulf Möller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Document hash functions.
上级
82fc1d9c
变更
20
隐藏空白更改
内联
并排
Showing
20 changed file
with
302 addition
and
22 deletion
+302
-22
crypto/hmac/hmac.c
crypto/hmac/hmac.c
+2
-2
crypto/hmac/hmac.h
crypto/hmac/hmac.h
+2
-2
crypto/md2/md2.h
crypto/md2/md2.h
+2
-2
crypto/md2/md2_dgst.c
crypto/md2/md2_dgst.c
+1
-1
crypto/md2/md2_one.c
crypto/md2/md2_one.c
+1
-1
crypto/md5/md5.h
crypto/md5/md5.h
+1
-1
crypto/md5/md5_one.c
crypto/md5/md5_one.c
+1
-1
crypto/mdc2/mdc2.h
crypto/mdc2/mdc2.h
+3
-2
crypto/mdc2/mdc2_one.c
crypto/mdc2/mdc2_one.c
+1
-1
crypto/mdc2/mdc2dgst.c
crypto/mdc2/mdc2dgst.c
+3
-3
crypto/ripemd/ripemd.h
crypto/ripemd/ripemd.h
+2
-1
crypto/ripemd/rmd_one.c
crypto/ripemd/rmd_one.c
+1
-1
doc/crypto/DSA_generate_parameters.pod
doc/crypto/DSA_generate_parameters.pod
+1
-1
doc/crypto/dsa.pod
doc/crypto/dsa.pod
+1
-1
doc/crypto/err.pod
doc/crypto/err.pod
+1
-1
doc/crypto/hmac.pod
doc/crypto/hmac.pod
+75
-0
doc/crypto/md5.pod
doc/crypto/md5.pod
+81
-0
doc/crypto/mdc2.pod
doc/crypto/mdc2.pod
+60
-0
doc/crypto/ripemd.pod
doc/crypto/ripemd.pod
+62
-0
doc/crypto/sha.pod
doc/crypto/sha.pod
+1
-1
未找到文件。
crypto/hmac/hmac.c
浏览文件 @
9dbc41d7
...
...
@@ -109,7 +109,7 @@ void HMAC_Init(HMAC_CTX *ctx, const void *key, int len,
memcpy
(
&
ctx
->
md_ctx
,
&
ctx
->
i_ctx
,
sizeof
(
ctx
->
i_ctx
));
}
void
HMAC_Update
(
HMAC_CTX
*
ctx
,
unsigned
char
*
data
,
int
len
)
void
HMAC_Update
(
HMAC_CTX
*
ctx
,
const
unsigned
char
*
data
,
int
len
)
{
EVP_DigestUpdate
(
&
(
ctx
->
md_ctx
),
data
,
len
);
}
...
...
@@ -134,7 +134,7 @@ void HMAC_cleanup(HMAC_CTX *ctx)
}
unsigned
char
*
HMAC
(
const
EVP_MD
*
evp_md
,
const
void
*
key
,
int
key_len
,
unsigned
char
*
d
,
int
n
,
unsigned
char
*
md
,
const
unsigned
char
*
d
,
int
n
,
unsigned
char
*
md
,
unsigned
int
*
md_len
)
{
HMAC_CTX
c
;
...
...
crypto/hmac/hmac.h
浏览文件 @
9dbc41d7
...
...
@@ -85,11 +85,11 @@ typedef struct hmac_ctx_st
void
HMAC_Init
(
HMAC_CTX
*
ctx
,
const
void
*
key
,
int
len
,
const
EVP_MD
*
md
);
void
HMAC_Update
(
HMAC_CTX
*
ctx
,
unsigned
char
*
key
,
int
len
);
void
HMAC_Update
(
HMAC_CTX
*
ctx
,
const
unsigned
char
*
data
,
int
len
);
void
HMAC_Final
(
HMAC_CTX
*
ctx
,
unsigned
char
*
md
,
unsigned
int
*
len
);
void
HMAC_cleanup
(
HMAC_CTX
*
ctx
);
unsigned
char
*
HMAC
(
const
EVP_MD
*
evp_md
,
const
void
*
key
,
int
key_len
,
unsigned
char
*
d
,
int
n
,
unsigned
char
*
md
,
const
unsigned
char
*
d
,
int
n
,
unsigned
char
*
md
,
unsigned
int
*
md_len
);
...
...
crypto/md2/md2.h
浏览文件 @
9dbc41d7
...
...
@@ -81,9 +81,9 @@ typedef struct MD2state_st
const
char
*
MD2_options
(
void
);
void
MD2_Init
(
MD2_CTX
*
c
);
void
MD2_Update
(
MD2_CTX
*
c
,
register
unsigned
char
*
data
,
unsigned
long
len
);
void
MD2_Update
(
MD2_CTX
*
c
,
const
unsigned
char
*
data
,
unsigned
long
len
);
void
MD2_Final
(
unsigned
char
*
md
,
MD2_CTX
*
c
);
unsigned
char
*
MD2
(
unsigned
char
*
d
,
unsigned
long
n
,
unsigned
char
*
md
);
unsigned
char
*
MD2
(
const
unsigned
char
*
d
,
unsigned
long
n
,
unsigned
char
*
md
);
#ifdef __cplusplus
}
#endif
...
...
crypto/md2/md2_dgst.c
浏览文件 @
9dbc41d7
...
...
@@ -123,7 +123,7 @@ void MD2_Init(MD2_CTX *c)
memset
(
c
->
data
,
0
,
MD2_BLOCK
);
}
void
MD2_Update
(
MD2_CTX
*
c
,
register
unsigned
char
*
data
,
unsigned
long
len
)
void
MD2_Update
(
MD2_CTX
*
c
,
const
unsigned
char
*
data
,
unsigned
long
len
)
{
register
UCHAR
*
p
;
...
...
crypto/md2/md2_one.c
浏览文件 @
9dbc41d7
...
...
@@ -63,7 +63,7 @@
/* This is a separate file so that #defines in cryptlib.h can
* map my MD functions to different names */
unsigned
char
*
MD2
(
unsigned
char
*
d
,
unsigned
long
n
,
unsigned
char
*
md
)
unsigned
char
*
MD2
(
const
unsigned
char
*
d
,
unsigned
long
n
,
unsigned
char
*
md
)
{
MD2_CTX
c
;
static
unsigned
char
m
[
MD2_DIGEST_LENGTH
];
...
...
crypto/md5/md5.h
浏览文件 @
9dbc41d7
...
...
@@ -105,7 +105,7 @@ typedef struct MD5state_st
void
MD5_Init
(
MD5_CTX
*
c
);
void
MD5_Update
(
MD5_CTX
*
c
,
const
unsigned
char
*
data
,
unsigned
long
len
);
void
MD5_Final
(
unsigned
char
*
md
,
MD5_CTX
*
c
);
unsigned
char
*
MD5
(
unsigned
char
*
d
,
unsigned
long
n
,
unsigned
char
*
md
);
unsigned
char
*
MD5
(
const
unsigned
char
*
d
,
unsigned
long
n
,
unsigned
char
*
md
);
void
MD5_Transform
(
MD5_CTX
*
c
,
const
unsigned
char
*
b
);
#ifdef __cplusplus
}
...
...
crypto/md5/md5_one.c
浏览文件 @
9dbc41d7
...
...
@@ -64,7 +64,7 @@
#include <openssl/ebcdic.h>
#endif
unsigned
char
*
MD5
(
unsigned
char
*
d
,
unsigned
long
n
,
unsigned
char
*
md
)
unsigned
char
*
MD5
(
const
unsigned
char
*
d
,
unsigned
long
n
,
unsigned
char
*
md
)
{
MD5_CTX
c
;
static
unsigned
char
m
[
MD5_DIGEST_LENGTH
];
...
...
crypto/mdc2/mdc2.h
浏览文件 @
9dbc41d7
...
...
@@ -82,9 +82,10 @@ typedef struct mdc2_ctx_st
void
MDC2_Init
(
MDC2_CTX
*
c
);
void
MDC2_Update
(
MDC2_CTX
*
c
,
unsigned
char
*
data
,
unsigned
long
len
);
void
MDC2_Update
(
MDC2_CTX
*
c
,
const
unsigned
char
*
data
,
unsigned
long
len
);
void
MDC2_Final
(
unsigned
char
*
md
,
MDC2_CTX
*
c
);
unsigned
char
*
MDC2
(
unsigned
char
*
d
,
unsigned
long
n
,
unsigned
char
*
md
);
unsigned
char
*
MDC2
(
const
unsigned
char
*
d
,
unsigned
long
n
,
unsigned
char
*
md
);
#ifdef __cplusplus
}
...
...
crypto/mdc2/mdc2_one.c
浏览文件 @
9dbc41d7
...
...
@@ -60,7 +60,7 @@
#include "cryptlib.h"
#include <openssl/mdc2.h>
unsigned
char
*
MDC2
(
unsigned
char
*
d
,
unsigned
long
n
,
unsigned
char
*
md
)
unsigned
char
*
MDC2
(
const
unsigned
char
*
d
,
unsigned
long
n
,
unsigned
char
*
md
)
{
MDC2_CTX
c
;
static
unsigned
char
m
[
MDC2_DIGEST_LENGTH
];
...
...
crypto/mdc2/mdc2dgst.c
浏览文件 @
9dbc41d7
...
...
@@ -74,7 +74,7 @@
*((c)++)=(unsigned char)(((l)>>16L)&0xff), \
*((c)++)=(unsigned char)(((l)>>24L)&0xff))
static
void
mdc2_body
(
MDC2_CTX
*
c
,
unsigned
char
*
in
,
unsigned
int
len
);
static
void
mdc2_body
(
MDC2_CTX
*
c
,
const
unsigned
char
*
in
,
unsigned
int
len
);
void
MDC2_Init
(
MDC2_CTX
*
c
)
{
c
->
num
=
0
;
...
...
@@ -83,7 +83,7 @@ void MDC2_Init(MDC2_CTX *c)
memset
(
&
(
c
->
hh
[
0
]),
0x25
,
MDC2_BLOCK
);
}
void
MDC2_Update
(
MDC2_CTX
*
c
,
register
unsigned
char
*
in
,
unsigned
long
len
)
void
MDC2_Update
(
MDC2_CTX
*
c
,
const
unsigned
char
*
in
,
unsigned
long
len
)
{
int
i
,
j
;
...
...
@@ -118,7 +118,7 @@ void MDC2_Update(MDC2_CTX *c, register unsigned char *in, unsigned long len)
}
}
static
void
mdc2_body
(
MDC2_CTX
*
c
,
unsigned
char
*
in
,
unsigned
int
len
)
static
void
mdc2_body
(
MDC2_CTX
*
c
,
const
unsigned
char
*
in
,
unsigned
int
len
)
{
register
DES_LONG
tin0
,
tin1
;
register
DES_LONG
ttin0
,
ttin1
;
...
...
crypto/ripemd/ripemd.h
浏览文件 @
9dbc41d7
...
...
@@ -91,7 +91,8 @@ typedef struct RIPEMD160state_st
void
RIPEMD160_Init
(
RIPEMD160_CTX
*
c
);
void
RIPEMD160_Update
(
RIPEMD160_CTX
*
c
,
const
unsigned
char
*
data
,
unsigned
long
len
);
void
RIPEMD160_Final
(
unsigned
char
*
md
,
RIPEMD160_CTX
*
c
);
unsigned
char
*
RIPEMD160
(
unsigned
char
*
d
,
unsigned
long
n
,
unsigned
char
*
md
);
unsigned
char
*
RIPEMD160
(
const
unsigned
char
*
d
,
unsigned
long
n
,
unsigned
char
*
md
);
void
RIPEMD160_Transform
(
RIPEMD160_CTX
*
c
,
const
unsigned
char
*
b
);
#ifdef __cplusplus
}
...
...
crypto/ripemd/rmd_one.c
浏览文件 @
9dbc41d7
...
...
@@ -60,7 +60,7 @@
#include <string.h>
#include <openssl/ripemd.h>
unsigned
char
*
RIPEMD160
(
unsigned
char
*
d
,
unsigned
long
n
,
unsigned
char
*
RIPEMD160
(
const
unsigned
char
*
d
,
unsigned
long
n
,
unsigned
char
*
md
)
{
RIPEMD160_CTX
c
;
...
...
doc/crypto/DSA_generate_parameters.pod
浏览文件 @
9dbc41d7
...
...
@@ -10,7 +10,7 @@ DSA_generate_parameters - Generate DSA parameters
DSA *DSA_generate_parameters(int bits, unsigned char *seed,
int seed_len, int *counter_ret, unsigned long *h_ret,
void (*callback)(), void *cb_arg);
void (*callback)(
int, int, void *
), void *cb_arg);
=head1 DESCRIPTION
...
...
doc/crypto/dsa.pod
浏览文件 @
9dbc41d7
...
...
@@ -15,7 +15,7 @@ dsa - Digital Signature Algorithm
DSA * DSA_generate_parameters(int bits, unsigned char *seed,
int seed_len, int *counter_ret, unsigned long *h_ret,
void (*callback)(), void *cb_arg);
void (*callback)(
int, int, void *
), void *cb_arg);
DH * DSA_dup_DH(DSA *r);
...
...
doc/crypto/err.pod
浏览文件 @
9dbc41d7
...
...
@@ -91,7 +91,7 @@ for an appropriate function name, if none is found it just uses
the capitalized form such as "SSL23_READ" in the above example.
The trailing section of a reason code (after the "_R_") is translated
into lower case and
and
underscores changed to spaces.
into lower case and underscores changed to spaces.
When you are using new function or reason codes, run B<make errors>.
The necessary B<#define>s will then automatically be added to the
...
...
doc/crypto/hmac.pod
0 → 100644
浏览文件 @
9dbc41d7
=pod
=head1 NAME
HMAC, HMAC_Init, HMAC_Update, HMAC_Final - HMAC message authentication code
=head1 SYNOPSIS
#include <openssl/hmac.h>
unsigned char *HMAC(const EVP_MD *evp_md, const void *key,
int key_len, const unsigned char *d, int n,
unsigned char *md, unsigned int *md_len);
void HMAC_Init(HMAC_CTX *ctx, const void *key, int key_len,
const EVP_MD *md);
void HMAC_Update(HMAC_CTX *ctx, const unsigned char *data, int len);
void HMAC_Final(HMAC_CTX *ctx, unsigned char *md, unsigned int *len);
void HMAC_cleanup(HMAC_CTX *ctx);
=head1 DESCRIPTION
HMAC is a MAC (message authentication code), i.e. a keyed hash
function used for message authentication, which is based on a hash
function.
HMAC() computes the message authentication code of the B<n> bytes at
B<d> using the hash function B<evp_md> and the key B<key> which is
B<key_len> bytes long.
It places the result in B<md> (which must have space for the output of
the hash function, which is no more than B<EVP_MAX_MD_SIZE> bytes).
If B<md> is NULL, the digest is placed in a static array. The size of
the output is placed in B<md_len>, unless it is B<NULL>.
B<evp_md> can be EVP_sha1(), EVP_ripemd160() etc.
B<key> and B<evp_md> may be B<NULL> if a key and hash function have
been set in a previous call to HMAC_Init() for that B<HMAC_CTX>.
HMAC_cleanup() erases the key and other data from the B<HMAC_CTX>.
The following functions may be used if the message is not completely
stored in memory:
HMAC_Init() initializes a B<HMAC_CTX> structure to use the hash
function B<evp_md> and the key B<key> which is B<key_len> bytes long.
HMAC_Update() can be called repeatedly with chunks of the message to
be authenticated (B<len> bytes at B<data>).
HMAC_Final() places the message authentication code in B<md>, which
must have space for the hash function output.
=head1 RETURN VALUES
HMAC() returns a pointer to the message authentication code.
HMAC_Init(), HMAC_Update(), HMAC_Final() and HMAC_cleanup() do not
return values.
=head1 CONFORMING TO
RFC 2104
=head1 SEE ALSO
L<sha(3)|sha(3)>, L<evp(3)|evp(3)>
=head1 HISTORY
HMAC(), HMAC_Init(), HMAC_Update(), HMAC_Final() and HMAC_cleanup()
are available since SSLeay 0.9.0.
=cut
doc/crypto/md5.pod
0 → 100644
浏览文件 @
9dbc41d7
=pod
=head1 NAME
MD2, MD5, MD2_Init, MD2_Update, MD2_Final, MD5_Init, MD5_Update,
MD5_Final - MD2 and MD5 hash functions
=head1 SYNOPSIS
#include <openssl/md2.h>
unsigned char *MD2(const unsigned char *d, unsigned long n,
unsigned char *md);
void MD2_Init(MD2_CTX *c);
void MD2_Update(MD2_CTX *c, const unsigned char *data,
unsigned long len);
void MD2_Final(unsigned char *md, MD2_CTX *c);
#include <openssl/md5.h>
unsigned char *MD5(const unsigned char *d, unsigned long n,
unsigned char *md);
void MD5_Init(MD5_CTX *c);
void MD5_Update(MD5_CTX *c, const unsigned char *data,
unsigned long len);
void MD5_Final(unsigned char *md, MD5_CTX *c);
=head1 DESCRIPTION
MD2 and MD5 are cryptographic hashs function with a 128 bit output.
MD2() and MD5() compute the MD2 and MD5 message digest of the B<n>
bytes at B<d> and place it in B<md> (which must have space for
MD2_DIGEST_LENGTH == MD5_DIGEST_LENGTH == 16 bytes of output). If
B<md> is NULL, the digest is placed in a static array.
The following functions may be used if the message is not completely
stored in memory:
MD2_Init() initializes a B<MD2_CTX> structure.
MD2_Update() can be called repeatedly with chunks of the message to
be hashed (B<len> bytes at B<data>).
MD2_Final() places the message digest in B<md>, which must have space
for MD2_DIGEST_LENGTH == 16 bytes of output, and erases the B<MD2_CTX>.
MD5_Init(), MD5_Update() and MD5_Final() are analogous using an
B<MD5_CTX> structure.
=head1 NOTE
MD2 and MD5 are recommended only for compatibility with existing
applications. In new applications, SHA-1 or RIPEMD-160 should be
preferred.
=head1 RETURN VALUES
MD2() and MD5() return pointers to the hash value.
MD2_Init(), MD2_Update() MD2_Final(), MD5_Init(), MD5_Update() and
MD5_Final() do not return values.
=head1 CONFORMING TO
RFC 1319, RFC 1321
=head1 SEE ALSO
L<sha(3)|sha(3)>, L<ripemd(3)|ripemd(3)>
=head1 HISTORY
MD2(), MD2_Init(), MD2_Update() MD2_Final(), MD5(), MD5_Init(),
MD5_Update() and MD5_Final() are available in all versions of SSLeay
and OpenSSL.
=cut
doc/crypto/mdc2.pod
0 → 100644
浏览文件 @
9dbc41d7
=pod
=head1 NAME
MDC2, MDC2_Init, MDC2_Update, MDC2_Final - MDC2 hash function
=head1 SYNOPSIS
#include <openssl/mdc2.h>
unsigned char *MDC2(const unsigned char *d, unsigned long n,
unsigned char *md);
void MDC2_Init(MDC2_CTX *c);
void MDC2_Update(MDC2_CTX *c, const unsigned char *data,
unsigned long len);
void MDC2_Final(unsigned char *md, MDC2_CTX *c);
=head1 DESCRIPTION
MDC2 is a method to construct hash functions with 128 bit output from
block ciphers. These functions are an implementation of MDC2 with
DES.
MDC2() computes the MDC2 message digest of the B<n>
bytes at B<d> and places it in B<md> (which must have space for
MDC2_DIGEST_LENGTH == 16 bytes of output). If B<md> is NULL, the digest
is placed in a static array.
The following functions may be used if the message is not completely
stored in memory:
MDC2_Init() initializes a B<MDC2_CTX> structure.
MDC2_Update() can be called repeatedly with chunks of the message to
be hashed (B<len> bytes at B<data>).
MDC2_Final() places the message digest in B<md>, which must have space
for MDC2_DIGEST_LENGTH == 16 bytes of output, and erases the B<MDC2_CTX>.
=head1 RETURN VALUES
MDC2() returns a pointer to the hash value.
MDC2_Init(), MDC2_Update() and MDC2_Final() do not return values.
=head1 CONFORMING TO
ISO/IEC 10118-2, with DES
=head1 SEE ALSO
L<sha(3)|sha(3)>
=head1 HISTORY
MDC2(), MDC2_Init(), MDC2_Update() and MDC2_Final() are available since
SSLeay 0.8.
=cut
doc/crypto/ripemd.pod
0 → 100644
浏览文件 @
9dbc41d7
=pod
=head1 NAME
RIPEMD160, RIPEMD160_Init, RIPEMD160_Update, RIPEMD160_Final -
RIPEMD-160 hash function
=head1 SYNOPSIS
#include <openssl/ripemd.h>
unsigned char *RIPEMD160(const unsigned char *d, unsigned long n,
unsigned char *md);
void RIPEMD160_Init(RIPEMD160_CTX *c);
void RIPEMD160_Update(RIPEMD_CTX *c, const unsigned char *data,
unsigned long len);
void RIPEMD160_Final(unsigned char *md, RIPEMD160_CTX *c);
=head1 DESCRIPTION
RIPEMD-160 is a cryptographic hash function with a
160 bit output.
RIPEMD160() computes the RIPEMD-160 message digest of the B<n>
bytes at B<d> and places it in B<md> (which must have space for
RIPEMD160_DIGEST_LENGTH == 20 bytes of output). If B<md> is NULL, the digest
is placed in a static array.
The following functions may be used if the message is not completely
stored in memory:
RIPEMD160_Init() initializes a B<RIPEMD160_CTX> structure.
RIPEMD160_Update() can be called repeatedly with chunks of the message to
be hashed (B<len> bytes at B<data>).
RIPEMD160_Final() places the message digest in B<md>, which must have
space for RIPEMD160_DIGEST_LENGTH == 20 bytes of output, and erases
the B<RIPEMD160_CTX>.
=head1 RETURN VALUES
RIPEMD160() returns a pointer to the hash value.
RIPEMD160_Init(), RIPEMD160_Update() and RIPEMD160_Final() do not
return values.
=head1 CONFORMING TO
ISO/IEC 10118-3 (draft) (??)
=head1 SEE ALSO
L<sha(3)|sha(3)>, L<hmac(3)|hmac(3)>
=head1 HISTORY
RIPEMD160(), RIPEMD160_Init(), RIPEMD160_Update() and
RIPEMD160_Final() are available since SSLeay 0.9.0.
=cut
doc/crypto/sha.pod
浏览文件 @
9dbc41d7
...
...
@@ -56,7 +56,7 @@ ANSI X9.30
=head1 SEE ALSO
L<ripemd(3)|ripemd(3)>
L<ripemd(3)|ripemd(3)>
, L<hmac(3)|hmac(3)>
=head1 HISTORY
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录