Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
9e0aad9f
T
Third Party Openssl
项目概览
OpenHarmony
/
Third Party Openssl
1 年多 前同步成功
通知
9
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看板
提交
9e0aad9f
编写于
5月 15, 2004
作者:
A
Andy Polyakov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
size_t-fication of message digest APIs. We should size_t-fy more APIs...
上级
1c7a0e28
变更
39
隐藏空白更改
内联
并排
Showing
39 changed file
with
82 addition
and
82 deletion
+82
-82
crypto/engine/eng_openssl.c
crypto/engine/eng_openssl.c
+1
-1
crypto/evp/digest.c
crypto/evp/digest.c
+3
-3
crypto/evp/evp.h
crypto/evp/evp.h
+3
-3
crypto/evp/m_dss.c
crypto/evp/m_dss.c
+1
-1
crypto/evp/m_dss1.c
crypto/evp/m_dss1.c
+1
-1
crypto/evp/m_ecdsa.c
crypto/evp/m_ecdsa.c
+1
-1
crypto/evp/m_md2.c
crypto/evp/m_md2.c
+1
-1
crypto/evp/m_md4.c
crypto/evp/m_md4.c
+1
-1
crypto/evp/m_md5.c
crypto/evp/m_md5.c
+1
-1
crypto/evp/m_mdc2.c
crypto/evp/m_mdc2.c
+1
-1
crypto/evp/m_null.c
crypto/evp/m_null.c
+1
-1
crypto/evp/m_ripemd.c
crypto/evp/m_ripemd.c
+1
-1
crypto/evp/m_sha.c
crypto/evp/m_sha.c
+1
-1
crypto/evp/m_sha1.c
crypto/evp/m_sha1.c
+1
-1
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
+3
-3
crypto/md2/md2_one.c
crypto/md2/md2_one.c
+1
-1
crypto/md32_common.h
crypto/md32_common.h
+4
-4
crypto/md4/md4.h
crypto/md4/md4.h
+2
-2
crypto/md4/md4_dgst.c
crypto/md4/md4_dgst.c
+2
-2
crypto/md4/md4_locl.h
crypto/md4/md4_locl.h
+2
-2
crypto/md4/md4_one.c
crypto/md4/md4_one.c
+1
-1
crypto/md5/md5.h
crypto/md5/md5.h
+2
-2
crypto/md5/md5_dgst.c
crypto/md5/md5_dgst.c
+2
-2
crypto/md5/md5_locl.h
crypto/md5/md5_locl.h
+3
-3
crypto/md5/md5_one.c
crypto/md5/md5_one.c
+1
-1
crypto/mdc2/mdc2.h
crypto/mdc2/mdc2.h
+2
-2
crypto/mdc2/mdc2_one.c
crypto/mdc2/mdc2_one.c
+1
-1
crypto/mdc2/mdc2dgst.c
crypto/mdc2/mdc2dgst.c
+9
-9
crypto/ripemd/ripemd.h
crypto/ripemd/ripemd.h
+2
-2
crypto/ripemd/rmd_dgst.c
crypto/ripemd/rmd_dgst.c
+4
-4
crypto/ripemd/rmd_locl.h
crypto/ripemd/rmd_locl.h
+2
-2
crypto/ripemd/rmd_one.c
crypto/ripemd/rmd_one.c
+1
-1
crypto/sha/sha.h
crypto/sha/sha.h
+4
-4
crypto/sha/sha1_one.c
crypto/sha/sha1_one.c
+1
-1
crypto/sha/sha_locl.h
crypto/sha/sha_locl.h
+8
-8
crypto/sha/sha_one.c
crypto/sha/sha_one.c
+1
-1
未找到文件。
crypto/engine/eng_openssl.c
浏览文件 @
9e0aad9f
...
...
@@ -305,7 +305,7 @@ static int test_sha1_init(EVP_MD_CTX *ctx)
#endif
return
SHA1_Init
(
ctx
->
md_data
);
}
static
int
test_sha1_update
(
EVP_MD_CTX
*
ctx
,
const
void
*
data
,
unsigned
long
count
)
static
int
test_sha1_update
(
EVP_MD_CTX
*
ctx
,
const
void
*
data
,
size_t
count
)
{
#ifdef TEST_ENG_OPENSSL_SHA_P_UPDATE
fprintf
(
stderr
,
"(TEST_ENG_OPENSSL_SHA) test_sha1_update() called
\n
"
);
...
...
crypto/evp/digest.c
浏览文件 @
9e0aad9f
...
...
@@ -208,9 +208,9 @@ skip_to_init:
}
int
EVP_DigestUpdate
(
EVP_MD_CTX
*
ctx
,
const
void
*
data
,
unsigned
in
t
count
)
size_
t
count
)
{
return
ctx
->
digest
->
update
(
ctx
,
data
,
(
unsigned
long
)
count
);
return
ctx
->
digest
->
update
(
ctx
,
data
,
count
);
}
/* The caller can assume that this removes any secret data from the context */
...
...
@@ -285,7 +285,7 @@ int EVP_MD_CTX_copy_ex(EVP_MD_CTX *out, const EVP_MD_CTX *in)
return
1
;
}
int
EVP_Digest
(
const
void
*
data
,
unsigned
in
t
count
,
int
EVP_Digest
(
const
void
*
data
,
size_
t
count
,
unsigned
char
*
md
,
unsigned
int
*
size
,
const
EVP_MD
*
type
,
ENGINE
*
impl
)
{
EVP_MD_CTX
ctx
;
...
...
crypto/evp/evp.h
浏览文件 @
9e0aad9f
...
...
@@ -227,7 +227,7 @@ struct env_md_st
int
md_size
;
unsigned
long
flags
;
int
(
*
init
)(
EVP_MD_CTX
*
ctx
);
int
(
*
update
)(
EVP_MD_CTX
*
ctx
,
const
void
*
data
,
unsigned
long
count
);
int
(
*
update
)(
EVP_MD_CTX
*
ctx
,
const
void
*
data
,
size_t
count
);
int
(
*
final
)(
EVP_MD_CTX
*
ctx
,
unsigned
char
*
md
);
int
(
*
copy
)(
EVP_MD_CTX
*
to
,
const
EVP_MD_CTX
*
from
);
int
(
*
cleanup
)(
EVP_MD_CTX
*
ctx
);
...
...
@@ -490,9 +490,9 @@ int EVP_MD_CTX_copy_ex(EVP_MD_CTX *out,const EVP_MD_CTX *in);
#define EVP_MD_CTX_test_flags(ctx,flgs) ((ctx)->flags&(flgs))
int
EVP_DigestInit_ex
(
EVP_MD_CTX
*
ctx
,
const
EVP_MD
*
type
,
ENGINE
*
impl
);
int
EVP_DigestUpdate
(
EVP_MD_CTX
*
ctx
,
const
void
*
d
,
unsigned
in
t
cnt
);
size_
t
cnt
);
int
EVP_DigestFinal_ex
(
EVP_MD_CTX
*
ctx
,
unsigned
char
*
md
,
unsigned
int
*
s
);
int
EVP_Digest
(
const
void
*
data
,
unsigned
in
t
count
,
int
EVP_Digest
(
const
void
*
data
,
size_
t
count
,
unsigned
char
*
md
,
unsigned
int
*
size
,
const
EVP_MD
*
type
,
ENGINE
*
impl
);
int
EVP_MD_CTX_copy
(
EVP_MD_CTX
*
out
,
const
EVP_MD_CTX
*
in
);
...
...
crypto/evp/m_dss.c
浏览文件 @
9e0aad9f
...
...
@@ -67,7 +67,7 @@
static
int
init
(
EVP_MD_CTX
*
ctx
)
{
return
SHA1_Init
(
ctx
->
md_data
);
}
static
int
update
(
EVP_MD_CTX
*
ctx
,
const
void
*
data
,
unsigned
long
count
)
static
int
update
(
EVP_MD_CTX
*
ctx
,
const
void
*
data
,
size_t
count
)
{
return
SHA1_Update
(
ctx
->
md_data
,
data
,
count
);
}
static
int
final
(
EVP_MD_CTX
*
ctx
,
unsigned
char
*
md
)
...
...
crypto/evp/m_dss1.c
浏览文件 @
9e0aad9f
...
...
@@ -69,7 +69,7 @@
static
int
init
(
EVP_MD_CTX
*
ctx
)
{
return
SHA1_Init
(
ctx
->
md_data
);
}
static
int
update
(
EVP_MD_CTX
*
ctx
,
const
void
*
data
,
unsigned
long
count
)
static
int
update
(
EVP_MD_CTX
*
ctx
,
const
void
*
data
,
size_t
count
)
{
return
SHA1_Update
(
ctx
->
md_data
,
data
,
count
);
}
static
int
final
(
EVP_MD_CTX
*
ctx
,
unsigned
char
*
md
)
...
...
crypto/evp/m_ecdsa.c
浏览文件 @
9e0aad9f
...
...
@@ -119,7 +119,7 @@
static
int
init
(
EVP_MD_CTX
*
ctx
)
{
return
SHA1_Init
(
ctx
->
md_data
);
}
static
int
update
(
EVP_MD_CTX
*
ctx
,
const
void
*
data
,
unsigned
long
count
)
static
int
update
(
EVP_MD_CTX
*
ctx
,
const
void
*
data
,
size_t
count
)
{
return
SHA1_Update
(
ctx
->
md_data
,
data
,
count
);
}
static
int
final
(
EVP_MD_CTX
*
ctx
,
unsigned
char
*
md
)
...
...
crypto/evp/m_md2.c
浏览文件 @
9e0aad9f
...
...
@@ -70,7 +70,7 @@
static
int
init
(
EVP_MD_CTX
*
ctx
)
{
return
MD2_Init
(
ctx
->
md_data
);
}
static
int
update
(
EVP_MD_CTX
*
ctx
,
const
void
*
data
,
unsigned
long
count
)
static
int
update
(
EVP_MD_CTX
*
ctx
,
const
void
*
data
,
size_t
count
)
{
return
MD2_Update
(
ctx
->
md_data
,
data
,
count
);
}
static
int
final
(
EVP_MD_CTX
*
ctx
,
unsigned
char
*
md
)
...
...
crypto/evp/m_md4.c
浏览文件 @
9e0aad9f
...
...
@@ -70,7 +70,7 @@
static
int
init
(
EVP_MD_CTX
*
ctx
)
{
return
MD4_Init
(
ctx
->
md_data
);
}
static
int
update
(
EVP_MD_CTX
*
ctx
,
const
void
*
data
,
unsigned
long
count
)
static
int
update
(
EVP_MD_CTX
*
ctx
,
const
void
*
data
,
size_t
count
)
{
return
MD4_Update
(
ctx
->
md_data
,
data
,
count
);
}
static
int
final
(
EVP_MD_CTX
*
ctx
,
unsigned
char
*
md
)
...
...
crypto/evp/m_md5.c
浏览文件 @
9e0aad9f
...
...
@@ -70,7 +70,7 @@
static
int
init
(
EVP_MD_CTX
*
ctx
)
{
return
MD5_Init
(
ctx
->
md_data
);
}
static
int
update
(
EVP_MD_CTX
*
ctx
,
const
void
*
data
,
unsigned
long
count
)
static
int
update
(
EVP_MD_CTX
*
ctx
,
const
void
*
data
,
size_t
count
)
{
return
MD5_Update
(
ctx
->
md_data
,
data
,
count
);
}
static
int
final
(
EVP_MD_CTX
*
ctx
,
unsigned
char
*
md
)
...
...
crypto/evp/m_mdc2.c
浏览文件 @
9e0aad9f
...
...
@@ -70,7 +70,7 @@
static
int
init
(
EVP_MD_CTX
*
ctx
)
{
return
MDC2_Init
(
ctx
->
md_data
);
}
static
int
update
(
EVP_MD_CTX
*
ctx
,
const
void
*
data
,
unsigned
long
count
)
static
int
update
(
EVP_MD_CTX
*
ctx
,
const
void
*
data
,
size_t
count
)
{
return
MDC2_Update
(
ctx
->
md_data
,
data
,
count
);
}
static
int
final
(
EVP_MD_CTX
*
ctx
,
unsigned
char
*
md
)
...
...
crypto/evp/m_null.c
浏览文件 @
9e0aad9f
...
...
@@ -65,7 +65,7 @@
static
int
init
(
EVP_MD_CTX
*
ctx
)
{
return
1
;
}
static
int
update
(
EVP_MD_CTX
*
ctx
,
const
void
*
data
,
unsigned
long
count
)
static
int
update
(
EVP_MD_CTX
*
ctx
,
const
void
*
data
,
size_t
count
)
{
return
1
;
}
static
int
final
(
EVP_MD_CTX
*
ctx
,
unsigned
char
*
md
)
...
...
crypto/evp/m_ripemd.c
浏览文件 @
9e0aad9f
...
...
@@ -70,7 +70,7 @@
static
int
init
(
EVP_MD_CTX
*
ctx
)
{
return
RIPEMD160_Init
(
ctx
->
md_data
);
}
static
int
update
(
EVP_MD_CTX
*
ctx
,
const
void
*
data
,
unsigned
long
count
)
static
int
update
(
EVP_MD_CTX
*
ctx
,
const
void
*
data
,
size_t
count
)
{
return
RIPEMD160_Update
(
ctx
->
md_data
,
data
,
count
);
}
static
int
final
(
EVP_MD_CTX
*
ctx
,
unsigned
char
*
md
)
...
...
crypto/evp/m_sha.c
浏览文件 @
9e0aad9f
...
...
@@ -69,7 +69,7 @@
static
int
init
(
EVP_MD_CTX
*
ctx
)
{
return
SHA_Init
(
ctx
->
md_data
);
}
static
int
update
(
EVP_MD_CTX
*
ctx
,
const
void
*
data
,
unsigned
long
count
)
static
int
update
(
EVP_MD_CTX
*
ctx
,
const
void
*
data
,
size_t
count
)
{
return
SHA_Update
(
ctx
->
md_data
,
data
,
count
);
}
static
int
final
(
EVP_MD_CTX
*
ctx
,
unsigned
char
*
md
)
...
...
crypto/evp/m_sha1.c
浏览文件 @
9e0aad9f
...
...
@@ -69,7 +69,7 @@
static
int
init
(
EVP_MD_CTX
*
ctx
)
{
return
SHA1_Init
(
ctx
->
md_data
);
}
static
int
update
(
EVP_MD_CTX
*
ctx
,
const
void
*
data
,
unsigned
long
count
)
static
int
update
(
EVP_MD_CTX
*
ctx
,
const
void
*
data
,
size_t
count
)
{
return
SHA1_Update
(
ctx
->
md_data
,
data
,
count
);
}
static
int
final
(
EVP_MD_CTX
*
ctx
,
unsigned
char
*
md
)
...
...
crypto/hmac/hmac.c
浏览文件 @
9e0aad9f
...
...
@@ -121,7 +121,7 @@ void HMAC_Init(HMAC_CTX *ctx, const void *key, int len,
HMAC_Init_ex
(
ctx
,
key
,
len
,
md
,
NULL
);
}
void
HMAC_Update
(
HMAC_CTX
*
ctx
,
const
unsigned
char
*
data
,
in
t
len
)
void
HMAC_Update
(
HMAC_CTX
*
ctx
,
const
unsigned
char
*
data
,
size_
t
len
)
{
EVP_DigestUpdate
(
&
ctx
->
md_ctx
,
data
,
len
);
}
...
...
@@ -156,7 +156,7 @@ void HMAC_CTX_cleanup(HMAC_CTX *ctx)
}
unsigned
char
*
HMAC
(
const
EVP_MD
*
evp_md
,
const
void
*
key
,
int
key_len
,
const
unsigned
char
*
d
,
in
t
n
,
unsigned
char
*
md
,
const
unsigned
char
*
d
,
size_
t
n
,
unsigned
char
*
md
,
unsigned
int
*
md_len
)
{
HMAC_CTX
c
;
...
...
crypto/hmac/hmac.h
浏览文件 @
9e0aad9f
...
...
@@ -94,10 +94,10 @@ void HMAC_Init(HMAC_CTX *ctx, const void *key, int len,
const
EVP_MD
*
md
);
/* deprecated */
void
HMAC_Init_ex
(
HMAC_CTX
*
ctx
,
const
void
*
key
,
int
len
,
const
EVP_MD
*
md
,
ENGINE
*
impl
);
void
HMAC_Update
(
HMAC_CTX
*
ctx
,
const
unsigned
char
*
data
,
in
t
len
);
void
HMAC_Update
(
HMAC_CTX
*
ctx
,
const
unsigned
char
*
data
,
size_
t
len
);
void
HMAC_Final
(
HMAC_CTX
*
ctx
,
unsigned
char
*
md
,
unsigned
int
*
len
);
unsigned
char
*
HMAC
(
const
EVP_MD
*
evp_md
,
const
void
*
key
,
int
key_len
,
const
unsigned
char
*
d
,
in
t
n
,
unsigned
char
*
md
,
const
unsigned
char
*
d
,
size_
t
n
,
unsigned
char
*
md
,
unsigned
int
*
md_len
);
...
...
crypto/md2/md2.h
浏览文件 @
9e0aad9f
...
...
@@ -81,9 +81,9 @@ typedef struct MD2state_st
const
char
*
MD2_options
(
void
);
int
MD2_Init
(
MD2_CTX
*
c
);
int
MD2_Update
(
MD2_CTX
*
c
,
const
unsigned
char
*
data
,
unsigned
long
len
);
int
MD2_Update
(
MD2_CTX
*
c
,
const
unsigned
char
*
data
,
size_t
len
);
int
MD2_Final
(
unsigned
char
*
md
,
MD2_CTX
*
c
);
unsigned
char
*
MD2
(
const
unsigned
char
*
d
,
unsigned
long
n
,
unsigned
char
*
md
);
unsigned
char
*
MD2
(
const
unsigned
char
*
d
,
size_t
n
,
unsigned
char
*
md
);
#ifdef __cplusplus
}
#endif
...
...
crypto/md2/md2_dgst.c
浏览文件 @
9e0aad9f
...
...
@@ -125,7 +125,7 @@ int MD2_Init(MD2_CTX *c)
return
1
;
}
int
MD2_Update
(
MD2_CTX
*
c
,
const
unsigned
char
*
data
,
unsigned
long
len
)
int
MD2_Update
(
MD2_CTX
*
c
,
const
unsigned
char
*
data
,
size_t
len
)
{
register
UCHAR
*
p
;
...
...
@@ -145,7 +145,7 @@ int MD2_Update(MD2_CTX *c, const unsigned char *data, unsigned long len)
}
else
{
memcpy
(
&
(
p
[
c
->
num
]),
data
,
(
int
)
len
);
memcpy
(
&
(
p
[
c
->
num
]),
data
,
len
);
/* data+=len; */
c
->
num
+=
(
int
)
len
;
return
1
;
...
...
@@ -159,7 +159,7 @@ int MD2_Update(MD2_CTX *c, const unsigned char *data, unsigned long len)
data
+=
MD2_BLOCK
;
len
-=
MD2_BLOCK
;
}
memcpy
(
p
,
data
,
(
int
)
len
);
memcpy
(
p
,
data
,
len
);
c
->
num
=
(
int
)
len
;
return
1
;
}
...
...
crypto/md2/md2_one.c
浏览文件 @
9e0aad9f
...
...
@@ -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
(
const
unsigned
char
*
d
,
unsigned
long
n
,
unsigned
char
*
md
)
unsigned
char
*
MD2
(
const
unsigned
char
*
d
,
size_t
n
,
unsigned
char
*
md
)
{
MD2_CTX
c
;
static
unsigned
char
m
[
MD2_DIGEST_LENGTH
];
...
...
crypto/md32_common.h
浏览文件 @
9e0aad9f
...
...
@@ -410,21 +410,21 @@
* Time for some action:-)
*/
int
HASH_UPDATE
(
HASH_CTX
*
c
,
const
void
*
data_
,
unsigned
long
len
)
int
HASH_UPDATE
(
HASH_CTX
*
c
,
const
void
*
data_
,
size_t
len
)
{
const
unsigned
char
*
data
=
data_
;
register
HASH_LONG
*
p
;
register
unsigned
long
l
;
register
HASH_LONG
l
;
int
sw
,
sc
,
ew
,
ec
;
if
(
len
==
0
)
return
1
;
l
=
(
c
->
Nl
+
(
len
<<
3
))
&
0xffffffff
L
;
l
=
(
c
->
Nl
+
(
((
HASH_LONG
)
len
)
<<
3
))
&
0xffffffffU
L
;
/* 95-05-24 eay Fixed a bug with the overflow handling, thanks to
* Wei Dai <weidai@eskimo.com> for pointing it out. */
if
(
l
<
c
->
Nl
)
/* overflow */
c
->
Nh
++
;
c
->
Nh
+=
(
len
>>
29
);
c
->
Nh
+=
(
len
>>
29
);
/* might cause compiler warning on 16-bit */
c
->
Nl
=
l
;
if
(
c
->
num
!=
0
)
...
...
crypto/md4/md4.h
浏览文件 @
9e0aad9f
...
...
@@ -105,9 +105,9 @@ typedef struct MD4state_st
}
MD4_CTX
;
int
MD4_Init
(
MD4_CTX
*
c
);
int
MD4_Update
(
MD4_CTX
*
c
,
const
void
*
data
,
unsigned
long
len
);
int
MD4_Update
(
MD4_CTX
*
c
,
const
void
*
data
,
size_t
len
);
int
MD4_Final
(
unsigned
char
*
md
,
MD4_CTX
*
c
);
unsigned
char
*
MD4
(
const
unsigned
char
*
d
,
unsigned
long
n
,
unsigned
char
*
md
);
unsigned
char
*
MD4
(
const
unsigned
char
*
d
,
size_t
n
,
unsigned
char
*
md
);
void
MD4_Transform
(
MD4_CTX
*
c
,
const
unsigned
char
*
b
);
#ifdef __cplusplus
}
...
...
crypto/md4/md4_dgst.c
浏览文件 @
9e0aad9f
...
...
@@ -83,7 +83,7 @@ int MD4_Init(MD4_CTX *c)
}
#ifndef md4_block_host_order
void
md4_block_host_order
(
MD4_CTX
*
c
,
const
void
*
data
,
in
t
num
)
void
md4_block_host_order
(
MD4_CTX
*
c
,
const
void
*
data
,
size_
t
num
)
{
const
MD4_LONG
*
X
=
data
;
register
unsigned
MD32_REG_T
A
,
B
,
C
,
D
;
...
...
@@ -159,7 +159,7 @@ void md4_block_host_order (MD4_CTX *c, const void *data, int num)
#ifdef X
#undef X
#endif
void
md4_block_data_order
(
MD4_CTX
*
c
,
const
void
*
data_
,
in
t
num
)
void
md4_block_data_order
(
MD4_CTX
*
c
,
const
void
*
data_
,
size_
t
num
)
{
const
unsigned
char
*
data
=
data_
;
register
unsigned
MD32_REG_T
A
,
B
,
C
,
D
,
l
;
...
...
crypto/md4/md4_locl.h
浏览文件 @
9e0aad9f
...
...
@@ -65,8 +65,8 @@
#define MD4_LONG_LOG2 2
/* default to 32 bits */
#endif
void
md4_block_host_order
(
MD4_CTX
*
c
,
const
void
*
p
,
in
t
num
);
void
md4_block_data_order
(
MD4_CTX
*
c
,
const
void
*
p
,
in
t
num
);
void
md4_block_host_order
(
MD4_CTX
*
c
,
const
void
*
p
,
size_
t
num
);
void
md4_block_data_order
(
MD4_CTX
*
c
,
const
void
*
p
,
size_
t
num
);
#if defined(__i386) || defined(__i386__) || defined(_M_IX86) || defined(__INTEL__)
/*
...
...
crypto/md4/md4_one.c
浏览文件 @
9e0aad9f
...
...
@@ -65,7 +65,7 @@
#include <openssl/ebcdic.h>
#endif
unsigned
char
*
MD4
(
const
unsigned
char
*
d
,
unsigned
long
n
,
unsigned
char
*
md
)
unsigned
char
*
MD4
(
const
unsigned
char
*
d
,
size_t
n
,
unsigned
char
*
md
)
{
MD4_CTX
c
;
static
unsigned
char
m
[
MD4_DIGEST_LENGTH
];
...
...
crypto/md5/md5.h
浏览文件 @
9e0aad9f
...
...
@@ -105,9 +105,9 @@ typedef struct MD5state_st
}
MD5_CTX
;
int
MD5_Init
(
MD5_CTX
*
c
);
int
MD5_Update
(
MD5_CTX
*
c
,
const
void
*
data
,
unsigned
long
len
);
int
MD5_Update
(
MD5_CTX
*
c
,
const
void
*
data
,
size_t
len
);
int
MD5_Final
(
unsigned
char
*
md
,
MD5_CTX
*
c
);
unsigned
char
*
MD5
(
const
unsigned
char
*
d
,
unsigned
long
n
,
unsigned
char
*
md
);
unsigned
char
*
MD5
(
const
unsigned
char
*
d
,
size_t
n
,
unsigned
char
*
md
);
void
MD5_Transform
(
MD5_CTX
*
c
,
const
unsigned
char
*
b
);
#ifdef __cplusplus
}
...
...
crypto/md5/md5_dgst.c
浏览文件 @
9e0aad9f
...
...
@@ -83,7 +83,7 @@ int MD5_Init(MD5_CTX *c)
}
#ifndef md5_block_host_order
void
md5_block_host_order
(
MD5_CTX
*
c
,
const
void
*
data
,
in
t
num
)
void
md5_block_host_order
(
MD5_CTX
*
c
,
const
void
*
data
,
size_
t
num
)
{
const
MD5_LONG
*
X
=
data
;
register
unsigned
MD32_REG_T
A
,
B
,
C
,
D
;
...
...
@@ -176,7 +176,7 @@ void md5_block_host_order (MD5_CTX *c, const void *data, int num)
#ifdef X
#undef X
#endif
void
md5_block_data_order
(
MD5_CTX
*
c
,
const
void
*
data_
,
in
t
num
)
void
md5_block_data_order
(
MD5_CTX
*
c
,
const
void
*
data_
,
size_
t
num
)
{
const
unsigned
char
*
data
=
data_
;
register
unsigned
MD32_REG_T
A
,
B
,
C
,
D
,
l
;
...
...
crypto/md5/md5_locl.h
浏览文件 @
9e0aad9f
...
...
@@ -69,13 +69,13 @@
# if defined(__i386) || defined(__i386__) || defined(_M_IX86) || defined(__INTEL__)
# define md5_block_host_order md5_block_asm_host_order
# elif defined(__sparc) && defined(OPENSSL_SYS_ULTRASPARC)
void
md5_block_asm_data_order_aligned
(
MD5_CTX
*
c
,
const
MD5_LONG
*
p
,
in
t
num
);
void
md5_block_asm_data_order_aligned
(
MD5_CTX
*
c
,
const
MD5_LONG
*
p
,
size_
t
num
);
# define HASH_BLOCK_DATA_ORDER_ALIGNED md5_block_asm_data_order_aligned
# endif
#endif
void
md5_block_host_order
(
MD5_CTX
*
c
,
const
void
*
p
,
in
t
num
);
void
md5_block_data_order
(
MD5_CTX
*
c
,
const
void
*
p
,
in
t
num
);
void
md5_block_host_order
(
MD5_CTX
*
c
,
const
void
*
p
,
size_
t
num
);
void
md5_block_data_order
(
MD5_CTX
*
c
,
const
void
*
p
,
size_
t
num
);
#if defined(__i386) || defined(__i386__) || defined(_M_IX86) || defined(__INTEL__)
/*
...
...
crypto/md5/md5_one.c
浏览文件 @
9e0aad9f
...
...
@@ -65,7 +65,7 @@
#include <openssl/ebcdic.h>
#endif
unsigned
char
*
MD5
(
const
unsigned
char
*
d
,
unsigned
long
n
,
unsigned
char
*
md
)
unsigned
char
*
MD5
(
const
unsigned
char
*
d
,
size_t
n
,
unsigned
char
*
md
)
{
MD5_CTX
c
;
static
unsigned
char
m
[
MD5_DIGEST_LENGTH
];
...
...
crypto/mdc2/mdc2.h
浏览文件 @
9e0aad9f
...
...
@@ -82,9 +82,9 @@ typedef struct mdc2_ctx_st
int
MDC2_Init
(
MDC2_CTX
*
c
);
int
MDC2_Update
(
MDC2_CTX
*
c
,
const
unsigned
char
*
data
,
unsigned
long
len
);
int
MDC2_Update
(
MDC2_CTX
*
c
,
const
unsigned
char
*
data
,
size_t
len
);
int
MDC2_Final
(
unsigned
char
*
md
,
MDC2_CTX
*
c
);
unsigned
char
*
MDC2
(
const
unsigned
char
*
d
,
unsigned
long
n
,
unsigned
char
*
MDC2
(
const
unsigned
char
*
d
,
size_t
n
,
unsigned
char
*
md
);
#ifdef __cplusplus
...
...
crypto/mdc2/mdc2_one.c
浏览文件 @
9e0aad9f
...
...
@@ -60,7 +60,7 @@
#include "cryptlib.h"
#include <openssl/mdc2.h>
unsigned
char
*
MDC2
(
const
unsigned
char
*
d
,
unsigned
long
n
,
unsigned
char
*
md
)
unsigned
char
*
MDC2
(
const
unsigned
char
*
d
,
size_t
n
,
unsigned
char
*
md
)
{
MDC2_CTX
c
;
static
unsigned
char
m
[
MDC2_DIGEST_LENGTH
];
...
...
crypto/mdc2/mdc2dgst.c
浏览文件 @
9e0aad9f
...
...
@@ -74,7 +74,7 @@
*((c)++)=(unsigned char)(((l)>>16L)&0xff), \
*((c)++)=(unsigned char)(((l)>>24L)&0xff))
static
void
mdc2_body
(
MDC2_CTX
*
c
,
const
unsigned
char
*
in
,
unsigned
in
t
len
);
static
void
mdc2_body
(
MDC2_CTX
*
c
,
const
unsigned
char
*
in
,
size_
t
len
);
int
MDC2_Init
(
MDC2_CTX
*
c
)
{
c
->
num
=
0
;
...
...
@@ -84,9 +84,9 @@ int MDC2_Init(MDC2_CTX *c)
return
1
;
}
int
MDC2_Update
(
MDC2_CTX
*
c
,
const
unsigned
char
*
in
,
unsigned
long
len
)
int
MDC2_Update
(
MDC2_CTX
*
c
,
const
unsigned
char
*
in
,
size_t
len
)
{
in
t
i
,
j
;
size_
t
i
,
j
;
i
=
c
->
num
;
if
(
i
!=
0
)
...
...
@@ -94,7 +94,7 @@ int MDC2_Update(MDC2_CTX *c, const unsigned char *in, unsigned long len)
if
(
i
+
len
<
MDC2_BLOCK
)
{
/* partial block */
memcpy
(
&
(
c
->
data
[
i
]),
in
,
(
int
)
len
);
memcpy
(
&
(
c
->
data
[
i
]),
in
,
len
);
c
->
num
+=
(
int
)
len
;
return
1
;
}
...
...
@@ -109,25 +109,25 @@ int MDC2_Update(MDC2_CTX *c, const unsigned char *in, unsigned long len)
mdc2_body
(
c
,
&
(
c
->
data
[
0
]),
MDC2_BLOCK
);
}
}
i
=
(
int
)(
len
&
(
unsigned
long
)
~
(
MDC2_BLOCK
-
1
)
);
i
=
len
&~
((
size_t
)
MDC2_BLOCK
-
1
);
if
(
i
>
0
)
mdc2_body
(
c
,
in
,
i
);
j
=
(
int
)
len
-
i
;
j
=
len
-
i
;
if
(
j
>
0
)
{
memcpy
(
&
(
c
->
data
[
0
]),
&
(
in
[
i
]),
j
);
c
->
num
=
j
;
c
->
num
=
(
int
)
j
;
}
return
1
;
}
static
void
mdc2_body
(
MDC2_CTX
*
c
,
const
unsigned
char
*
in
,
unsigned
in
t
len
)
static
void
mdc2_body
(
MDC2_CTX
*
c
,
const
unsigned
char
*
in
,
size_
t
len
)
{
register
DES_LONG
tin0
,
tin1
;
register
DES_LONG
ttin0
,
ttin1
;
DES_LONG
d
[
2
],
dd
[
2
];
DES_key_schedule
k
;
unsigned
char
*
p
;
unsigned
in
t
i
;
size_
t
i
;
for
(
i
=
0
;
i
<
len
;
i
+=
8
)
{
...
...
crypto/ripemd/ripemd.h
浏览文件 @
9e0aad9f
...
...
@@ -91,9 +91,9 @@ typedef struct RIPEMD160state_st
}
RIPEMD160_CTX
;
int
RIPEMD160_Init
(
RIPEMD160_CTX
*
c
);
int
RIPEMD160_Update
(
RIPEMD160_CTX
*
c
,
const
void
*
data
,
unsigned
long
len
);
int
RIPEMD160_Update
(
RIPEMD160_CTX
*
c
,
const
void
*
data
,
size_t
len
);
int
RIPEMD160_Final
(
unsigned
char
*
md
,
RIPEMD160_CTX
*
c
);
unsigned
char
*
RIPEMD160
(
const
unsigned
char
*
d
,
unsigned
long
n
,
unsigned
char
*
RIPEMD160
(
const
unsigned
char
*
d
,
size_t
n
,
unsigned
char
*
md
);
void
RIPEMD160_Transform
(
RIPEMD160_CTX
*
c
,
const
unsigned
char
*
b
);
#ifdef __cplusplus
...
...
crypto/ripemd/rmd_dgst.c
浏览文件 @
9e0aad9f
...
...
@@ -63,10 +63,10 @@
const
char
*
RMD160_version
=
"RIPE-MD160"
OPENSSL_VERSION_PTEXT
;
# ifdef RMD160_ASM
void
ripemd160_block_x86
(
RIPEMD160_CTX
*
c
,
unsigned
long
*
p
,
in
t
num
);
void
ripemd160_block_x86
(
RIPEMD160_CTX
*
c
,
unsigned
long
*
p
,
size_
t
num
);
# define ripemd160_block ripemd160_block_x86
# else
void
ripemd160_block
(
RIPEMD160_CTX
*
c
,
unsigned
long
*
p
,
in
t
num
);
void
ripemd160_block
(
RIPEMD160_CTX
*
c
,
unsigned
long
*
p
,
size_
t
num
);
# endif
int
RIPEMD160_Init
(
RIPEMD160_CTX
*
c
)
...
...
@@ -87,7 +87,7 @@ int RIPEMD160_Init(RIPEMD160_CTX *c)
#undef X
#endif
#define X(i) XX[i]
void
ripemd160_block_host_order
(
RIPEMD160_CTX
*
ctx
,
const
void
*
p
,
in
t
num
)
void
ripemd160_block_host_order
(
RIPEMD160_CTX
*
ctx
,
const
void
*
p
,
size_
t
num
)
{
const
RIPEMD160_LONG
*
XX
=
p
;
register
unsigned
MD32_REG_T
A
,
B
,
C
,
D
,
E
;
...
...
@@ -287,7 +287,7 @@ void ripemd160_block_host_order (RIPEMD160_CTX *ctx, const void *p, int num)
#ifdef X
#undef X
#endif
void
ripemd160_block_data_order
(
RIPEMD160_CTX
*
ctx
,
const
void
*
p
,
in
t
num
)
void
ripemd160_block_data_order
(
RIPEMD160_CTX
*
ctx
,
const
void
*
p
,
size_
t
num
)
{
const
unsigned
char
*
data
=
p
;
register
unsigned
MD32_REG_T
A
,
B
,
C
,
D
,
E
;
...
...
crypto/ripemd/rmd_locl.h
浏览文件 @
9e0aad9f
...
...
@@ -76,8 +76,8 @@
# endif
#endif
void
ripemd160_block_host_order
(
RIPEMD160_CTX
*
c
,
const
void
*
p
,
in
t
num
);
void
ripemd160_block_data_order
(
RIPEMD160_CTX
*
c
,
const
void
*
p
,
in
t
num
);
void
ripemd160_block_host_order
(
RIPEMD160_CTX
*
c
,
const
void
*
p
,
size_
t
num
);
void
ripemd160_block_data_order
(
RIPEMD160_CTX
*
c
,
const
void
*
p
,
size_
t
num
);
#if defined(__i386) || defined(__i386__) || defined(_M_IX86) || defined(__INTEL__)
#define ripemd160_block_data_order ripemd160_block_host_order
...
...
crypto/ripemd/rmd_one.c
浏览文件 @
9e0aad9f
...
...
@@ -61,7 +61,7 @@
#include <openssl/ripemd.h>
#include <openssl/crypto.h>
unsigned
char
*
RIPEMD160
(
const
unsigned
char
*
d
,
unsigned
long
n
,
unsigned
char
*
RIPEMD160
(
const
unsigned
char
*
d
,
size_t
n
,
unsigned
char
*
md
)
{
RIPEMD160_CTX
c
;
...
...
crypto/sha/sha.h
浏览文件 @
9e0aad9f
...
...
@@ -102,16 +102,16 @@ typedef struct SHAstate_st
#ifndef OPENSSL_NO_SHA0
int
SHA_Init
(
SHA_CTX
*
c
);
int
SHA_Update
(
SHA_CTX
*
c
,
const
void
*
data
,
unsigned
long
len
);
int
SHA_Update
(
SHA_CTX
*
c
,
const
void
*
data
,
size_t
len
);
int
SHA_Final
(
unsigned
char
*
md
,
SHA_CTX
*
c
);
unsigned
char
*
SHA
(
const
unsigned
char
*
d
,
unsigned
long
n
,
unsigned
char
*
md
);
unsigned
char
*
SHA
(
const
unsigned
char
*
d
,
size_t
n
,
unsigned
char
*
md
);
void
SHA_Transform
(
SHA_CTX
*
c
,
const
unsigned
char
*
data
);
#endif
#ifndef OPENSSL_NO_SHA1
int
SHA1_Init
(
SHA_CTX
*
c
);
int
SHA1_Update
(
SHA_CTX
*
c
,
const
void
*
data
,
unsigned
long
len
);
int
SHA1_Update
(
SHA_CTX
*
c
,
const
void
*
data
,
size_t
len
);
int
SHA1_Final
(
unsigned
char
*
md
,
SHA_CTX
*
c
);
unsigned
char
*
SHA1
(
const
unsigned
char
*
d
,
unsigned
long
n
,
unsigned
char
*
md
);
unsigned
char
*
SHA1
(
const
unsigned
char
*
d
,
size_t
n
,
unsigned
char
*
md
);
void
SHA1_Transform
(
SHA_CTX
*
c
,
const
unsigned
char
*
data
);
#endif
...
...
crypto/sha/sha1_one.c
浏览文件 @
9e0aad9f
...
...
@@ -62,7 +62,7 @@
#include <openssl/crypto.h>
#ifndef OPENSSL_NO_SHA1
unsigned
char
*
SHA1
(
const
unsigned
char
*
d
,
unsigned
long
n
,
unsigned
char
*
md
)
unsigned
char
*
SHA1
(
const
unsigned
char
*
d
,
size_t
n
,
unsigned
char
*
md
)
{
SHA_CTX
c
;
static
unsigned
char
m
[
SHA_DIGEST_LENGTH
];
...
...
crypto/sha/sha_locl.h
浏览文件 @
9e0aad9f
...
...
@@ -92,8 +92,8 @@
# define HASH_BLOCK_DATA_ORDER sha_block_data_order
# define Xupdate(a,ix,ia,ib,ic,id) (ix=(a)=(ia^ib^ic^id))
void
sha_block_host_order
(
SHA_CTX
*
c
,
const
void
*
p
,
in
t
num
);
void
sha_block_data_order
(
SHA_CTX
*
c
,
const
void
*
p
,
in
t
num
);
void
sha_block_host_order
(
SHA_CTX
*
c
,
const
void
*
p
,
size_
t
num
);
void
sha_block_data_order
(
SHA_CTX
*
c
,
const
void
*
p
,
size_
t
num
);
#elif defined(SHA_1)
...
...
@@ -123,8 +123,8 @@
# define HASH_BLOCK_DATA_ORDER_ALIGNED sha1_block_asm_data_order
# endif
# endif
void
sha1_block_host_order
(
SHA_CTX
*
c
,
const
void
*
p
,
in
t
num
);
void
sha1_block_data_order
(
SHA_CTX
*
c
,
const
void
*
p
,
in
t
num
);
void
sha1_block_host_order
(
SHA_CTX
*
c
,
const
void
*
p
,
size_
t
num
);
void
sha1_block_data_order
(
SHA_CTX
*
c
,
const
void
*
p
,
size_
t
num
);
#else
# error "Either SHA_0 or SHA_1 must be defined."
...
...
@@ -223,7 +223,7 @@ int HASH_INIT (SHA_CTX *c)
#endif
#ifndef DONT_IMPLEMENT_BLOCK_HOST_ORDER
void
HASH_BLOCK_HOST_ORDER
(
SHA_CTX
*
c
,
const
void
*
d
,
in
t
num
)
void
HASH_BLOCK_HOST_ORDER
(
SHA_CTX
*
c
,
const
void
*
d
,
size_
t
num
)
{
const
SHA_LONG
*
W
=
d
;
register
unsigned
MD32_REG_T
A
,
B
,
C
,
D
,
E
,
T
;
...
...
@@ -348,7 +348,7 @@ void HASH_BLOCK_HOST_ORDER (SHA_CTX *c, const void *d, int num)
#endif
#ifndef DONT_IMPLEMENT_BLOCK_DATA_ORDER
void
HASH_BLOCK_DATA_ORDER
(
SHA_CTX
*
c
,
const
void
*
p
,
in
t
num
)
void
HASH_BLOCK_DATA_ORDER
(
SHA_CTX
*
c
,
const
void
*
p
,
size_
t
num
)
{
const
unsigned
char
*
data
=
p
;
register
unsigned
MD32_REG_T
A
,
B
,
C
,
D
,
E
,
T
,
l
;
...
...
@@ -505,7 +505,7 @@ void HASH_BLOCK_DATA_ORDER (SHA_CTX *c, const void *p, int num)
A=ROTATE(A,5)+T+xa; } while(0)
#ifndef DONT_IMPLEMENT_BLOCK_HOST_ORDER
void
HASH_BLOCK_HOST_ORDER
(
SHA_CTX
*
c
,
const
void
*
d
,
in
t
num
)
void
HASH_BLOCK_HOST_ORDER
(
SHA_CTX
*
c
,
const
void
*
d
,
size_
t
num
)
{
const
SHA_LONG
*
W
=
d
;
register
unsigned
MD32_REG_T
A
,
B
,
C
,
D
,
E
,
T
;
...
...
@@ -551,7 +551,7 @@ void HASH_BLOCK_HOST_ORDER (SHA_CTX *c, const void *d, int num)
#endif
#ifndef DONT_IMPLEMENT_BLOCK_DATA_ORDER
void
HASH_BLOCK_DATA_ORDER
(
SHA_CTX
*
c
,
const
void
*
p
,
in
t
num
)
void
HASH_BLOCK_DATA_ORDER
(
SHA_CTX
*
c
,
const
void
*
p
,
size_
t
num
)
{
const
unsigned
char
*
data
=
p
;
register
unsigned
MD32_REG_T
A
,
B
,
C
,
D
,
E
,
T
,
l
;
...
...
crypto/sha/sha_one.c
浏览文件 @
9e0aad9f
...
...
@@ -62,7 +62,7 @@
#include <openssl/crypto.h>
#ifndef OPENSSL_NO_SHA0
unsigned
char
*
SHA
(
const
unsigned
char
*
d
,
unsigned
long
n
,
unsigned
char
*
md
)
unsigned
char
*
SHA
(
const
unsigned
char
*
d
,
size_t
n
,
unsigned
char
*
md
)
{
SHA_CTX
c
;
static
unsigned
char
m
[
SHA_DIGEST_LENGTH
];
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录