Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
90ba7e21
T
Third Party Openssl
项目概览
OpenHarmony
/
Third Party Openssl
1 年多 前同步成功
通知
10
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看板
提交
90ba7e21
编写于
5月 13, 1999
作者:
B
Ben Laurie
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Avoid shadowing, and a bit of constification while I'm at it.
上级
224551f7
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
30 addition
and
26 deletion
+30
-26
crypto/cast/c_cfb64.c
crypto/cast/c_cfb64.c
+9
-8
crypto/cast/c_ecb.c
crypto/cast/c_ecb.c
+3
-3
crypto/cast/c_enc.c
crypto/cast/c_enc.c
+3
-3
crypto/cast/c_ofb64.c
crypto/cast/c_ofb64.c
+5
-4
crypto/cast/cast.h
crypto/cast/cast.h
+10
-8
未找到文件。
crypto/cast/c_cfb64.c
浏览文件 @
90ba7e21
...
@@ -64,8 +64,9 @@
...
@@ -64,8 +64,9 @@
* 64bit block we have used is contained in *num;
* 64bit block we have used is contained in *num;
*/
*/
void
CAST_cfb64_encrypt
(
unsigned
char
*
in
,
unsigned
char
*
out
,
long
length
,
void
CAST_cfb64_encrypt
(
const
unsigned
char
*
in
,
unsigned
char
*
out
,
CAST_KEY
*
schedule
,
unsigned
char
*
ivec
,
int
*
num
,
int
encrypt
)
long
length
,
CAST_KEY
*
schedule
,
unsigned
char
*
ivec
,
int
*
num
,
int
_encrypt
)
{
{
register
CAST_LONG
v0
,
v1
,
t
;
register
CAST_LONG
v0
,
v1
,
t
;
register
int
n
=
*
num
;
register
int
n
=
*
num
;
...
@@ -73,8 +74,8 @@ void CAST_cfb64_encrypt(unsigned char *in, unsigned char *out, long length,
...
@@ -73,8 +74,8 @@ void CAST_cfb64_encrypt(unsigned char *in, unsigned char *out, long length,
CAST_LONG
ti
[
2
];
CAST_LONG
ti
[
2
];
unsigned
char
*
iv
,
c
,
cc
;
unsigned
char
*
iv
,
c
,
cc
;
iv
=
(
unsigned
char
*
)
ivec
;
iv
=
ivec
;
if
(
encrypt
)
if
(
_
encrypt
)
{
{
while
(
l
--
)
while
(
l
--
)
{
{
...
@@ -83,10 +84,10 @@ void CAST_cfb64_encrypt(unsigned char *in, unsigned char *out, long length,
...
@@ -83,10 +84,10 @@ void CAST_cfb64_encrypt(unsigned char *in, unsigned char *out, long length,
n2l
(
iv
,
v0
);
ti
[
0
]
=
v0
;
n2l
(
iv
,
v0
);
ti
[
0
]
=
v0
;
n2l
(
iv
,
v1
);
ti
[
1
]
=
v1
;
n2l
(
iv
,
v1
);
ti
[
1
]
=
v1
;
CAST_encrypt
((
CAST_LONG
*
)
ti
,
schedule
);
CAST_encrypt
((
CAST_LONG
*
)
ti
,
schedule
);
iv
=
(
unsigned
char
*
)
ivec
;
iv
=
ivec
;
t
=
ti
[
0
];
l2n
(
t
,
iv
);
t
=
ti
[
0
];
l2n
(
t
,
iv
);
t
=
ti
[
1
];
l2n
(
t
,
iv
);
t
=
ti
[
1
];
l2n
(
t
,
iv
);
iv
=
(
unsigned
char
*
)
ivec
;
iv
=
ivec
;
}
}
c
=
*
(
in
++
)
^
iv
[
n
];
c
=
*
(
in
++
)
^
iv
[
n
];
*
(
out
++
)
=
c
;
*
(
out
++
)
=
c
;
...
@@ -103,10 +104,10 @@ void CAST_cfb64_encrypt(unsigned char *in, unsigned char *out, long length,
...
@@ -103,10 +104,10 @@ void CAST_cfb64_encrypt(unsigned char *in, unsigned char *out, long length,
n2l
(
iv
,
v0
);
ti
[
0
]
=
v0
;
n2l
(
iv
,
v0
);
ti
[
0
]
=
v0
;
n2l
(
iv
,
v1
);
ti
[
1
]
=
v1
;
n2l
(
iv
,
v1
);
ti
[
1
]
=
v1
;
CAST_encrypt
((
CAST_LONG
*
)
ti
,
schedule
);
CAST_encrypt
((
CAST_LONG
*
)
ti
,
schedule
);
iv
=
(
unsigned
char
*
)
ivec
;
iv
=
ivec
;
t
=
ti
[
0
];
l2n
(
t
,
iv
);
t
=
ti
[
0
];
l2n
(
t
,
iv
);
t
=
ti
[
1
];
l2n
(
t
,
iv
);
t
=
ti
[
1
];
l2n
(
t
,
iv
);
iv
=
(
unsigned
char
*
)
ivec
;
iv
=
ivec
;
}
}
cc
=
*
(
in
++
);
cc
=
*
(
in
++
);
c
=
iv
[
n
];
c
=
iv
[
n
];
...
...
crypto/cast/c_ecb.c
浏览文件 @
90ba7e21
...
@@ -62,14 +62,14 @@
...
@@ -62,14 +62,14 @@
char
*
CAST_version
=
"CAST"
OPENSSL_VERSION_PTEXT
;
char
*
CAST_version
=
"CAST"
OPENSSL_VERSION_PTEXT
;
void
CAST_ecb_encrypt
(
unsigned
char
*
in
,
unsigned
char
*
out
,
CAST_KEY
*
ks
,
void
CAST_ecb_encrypt
(
const
unsigned
char
*
in
,
unsigned
char
*
out
,
int
encrypt
)
CAST_KEY
*
ks
,
int
_
encrypt
)
{
{
CAST_LONG
l
,
d
[
2
];
CAST_LONG
l
,
d
[
2
];
n2l
(
in
,
l
);
d
[
0
]
=
l
;
n2l
(
in
,
l
);
d
[
0
]
=
l
;
n2l
(
in
,
l
);
d
[
1
]
=
l
;
n2l
(
in
,
l
);
d
[
1
]
=
l
;
if
(
encrypt
)
if
(
_
encrypt
)
CAST_encrypt
(
d
,
ks
);
CAST_encrypt
(
d
,
ks
);
else
else
CAST_decrypt
(
d
,
ks
);
CAST_decrypt
(
d
,
ks
);
...
...
crypto/cast/c_enc.c
浏览文件 @
90ba7e21
...
@@ -123,15 +123,15 @@ void CAST_decrypt(CAST_LONG *data, CAST_KEY *key)
...
@@ -123,15 +123,15 @@ void CAST_decrypt(CAST_LONG *data, CAST_KEY *key)
data
[
0
]
=
r
&
0xffffffffL
;
data
[
0
]
=
r
&
0xffffffffL
;
}
}
void
CAST_cbc_encrypt
(
unsigned
char
*
in
,
unsigned
char
*
out
,
long
length
,
void
CAST_cbc_encrypt
(
const
unsigned
char
*
in
,
unsigned
char
*
out
,
long
length
,
CAST_KEY
*
ks
,
unsigned
char
*
iv
,
int
encrypt
)
CAST_KEY
*
ks
,
unsigned
char
*
iv
,
int
_
encrypt
)
{
{
register
CAST_LONG
tin0
,
tin1
;
register
CAST_LONG
tin0
,
tin1
;
register
CAST_LONG
tout0
,
tout1
,
xor0
,
xor1
;
register
CAST_LONG
tout0
,
tout1
,
xor0
,
xor1
;
register
long
l
=
length
;
register
long
l
=
length
;
CAST_LONG
tin
[
2
];
CAST_LONG
tin
[
2
];
if
(
encrypt
)
if
(
_
encrypt
)
{
{
n2l
(
iv
,
tout0
);
n2l
(
iv
,
tout0
);
n2l
(
iv
,
tout1
);
n2l
(
iv
,
tout1
);
...
...
crypto/cast/c_ofb64.c
浏览文件 @
90ba7e21
...
@@ -63,8 +63,9 @@
...
@@ -63,8 +63,9 @@
* used. The extra state information to record how much of the
* used. The extra state information to record how much of the
* 64bit block we have used is contained in *num;
* 64bit block we have used is contained in *num;
*/
*/
void
CAST_ofb64_encrypt
(
unsigned
char
*
in
,
unsigned
char
*
out
,
long
length
,
void
CAST_ofb64_encrypt
(
const
unsigned
char
*
in
,
unsigned
char
*
out
,
CAST_KEY
*
schedule
,
unsigned
char
*
ivec
,
int
*
num
)
long
length
,
CAST_KEY
*
schedule
,
unsigned
char
*
ivec
,
int
*
num
)
{
{
register
CAST_LONG
v0
,
v1
,
t
;
register
CAST_LONG
v0
,
v1
,
t
;
register
int
n
=
*
num
;
register
int
n
=
*
num
;
...
@@ -75,7 +76,7 @@ void CAST_ofb64_encrypt(unsigned char *in, unsigned char *out, long length,
...
@@ -75,7 +76,7 @@ void CAST_ofb64_encrypt(unsigned char *in, unsigned char *out, long length,
unsigned
char
*
iv
;
unsigned
char
*
iv
;
int
save
=
0
;
int
save
=
0
;
iv
=
(
unsigned
char
*
)
ivec
;
iv
=
ivec
;
n2l
(
iv
,
v0
);
n2l
(
iv
,
v0
);
n2l
(
iv
,
v1
);
n2l
(
iv
,
v1
);
ti
[
0
]
=
v0
;
ti
[
0
]
=
v0
;
...
@@ -100,7 +101,7 @@ void CAST_ofb64_encrypt(unsigned char *in, unsigned char *out, long length,
...
@@ -100,7 +101,7 @@ void CAST_ofb64_encrypt(unsigned char *in, unsigned char *out, long length,
{
{
v0
=
ti
[
0
];
v0
=
ti
[
0
];
v1
=
ti
[
1
];
v1
=
ti
[
1
];
iv
=
(
unsigned
char
*
)
ivec
;
iv
=
ivec
;
l2n
(
v0
,
iv
);
l2n
(
v0
,
iv
);
l2n
(
v1
,
iv
);
l2n
(
v1
,
iv
);
}
}
...
...
crypto/cast/cast.h
浏览文件 @
90ba7e21
...
@@ -83,16 +83,18 @@ typedef struct cast_key_st
...
@@ -83,16 +83,18 @@ typedef struct cast_key_st
void
CAST_set_key
(
CAST_KEY
*
key
,
int
len
,
unsigned
char
*
data
);
void
CAST_set_key
(
CAST_KEY
*
key
,
int
len
,
unsigned
char
*
data
);
void
CAST_ecb_encrypt
(
unsigned
char
*
in
,
unsigned
char
*
out
,
CAST_KEY
*
key
,
void
CAST_ecb_encrypt
(
const
unsigned
char
*
in
,
unsigned
char
*
out
,
CAST_KEY
*
key
,
int
enc
);
int
enc
);
void
CAST_encrypt
(
CAST_LONG
*
data
,
CAST_KEY
*
key
);
void
CAST_encrypt
(
CAST_LONG
*
data
,
CAST_KEY
*
key
);
void
CAST_decrypt
(
CAST_LONG
*
data
,
CAST_KEY
*
key
);
void
CAST_decrypt
(
CAST_LONG
*
data
,
CAST_KEY
*
key
);
void
CAST_cbc_encrypt
(
unsigned
char
*
in
,
unsigned
char
*
out
,
long
length
,
void
CAST_cbc_encrypt
(
const
unsigned
char
*
in
,
unsigned
char
*
out
,
long
length
,
CAST_KEY
*
ks
,
unsigned
char
*
iv
,
int
enc
);
CAST_KEY
*
ks
,
unsigned
char
*
iv
,
int
enc
);
void
CAST_cfb64_encrypt
(
unsigned
char
*
in
,
unsigned
char
*
out
,
long
length
,
void
CAST_cfb64_encrypt
(
const
unsigned
char
*
in
,
unsigned
char
*
out
,
CAST_KEY
*
schedule
,
unsigned
char
*
ivec
,
int
*
num
,
int
enc
);
long
length
,
CAST_KEY
*
schedule
,
unsigned
char
*
ivec
,
void
CAST_ofb64_encrypt
(
unsigned
char
*
in
,
unsigned
char
*
out
,
long
length
,
int
*
num
,
int
enc
);
CAST_KEY
*
schedule
,
unsigned
char
*
ivec
,
int
*
num
);
void
CAST_ofb64_encrypt
(
const
unsigned
char
*
in
,
unsigned
char
*
out
,
long
length
,
CAST_KEY
*
schedule
,
unsigned
char
*
ivec
,
int
*
num
);
#ifdef __cplusplus
#ifdef __cplusplus
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录