Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
02c9b66a
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看板
提交
02c9b66a
编写于
8月 31, 2006
作者:
D
Dr. Stephen Henson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix C++ style comments, change assert to OPENSSL_assert, stop warning with
pedantic mode.
上级
539d4c10
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
50 addition
and
44 deletion
+50
-44
crypto/aes/aes_ige.c
crypto/aes/aes_ige.c
+44
-44
crypto/evp/e_camellia.c
crypto/evp/e_camellia.c
+6
-0
未找到文件。
crypto/aes/aes_ige.c
浏览文件 @
02c9b66a
...
...
@@ -49,7 +49,7 @@
*
*/
#include
<assert.h>
#include
"cryptlib.h"
#include <openssl/aes.h>
#include "aes_locl.h"
...
...
@@ -84,9 +84,9 @@ void AES_ige_encrypt(const unsigned char *in, unsigned char *out,
const
unsigned
char
*
iv
=
ivec
;
const
unsigned
char
*
iv2
=
ivec
+
AES_BLOCK_SIZE
;
assert
(
in
&&
out
&&
key
&&
ivec
);
assert
((
AES_ENCRYPT
==
enc
)
||
(
AES_DECRYPT
==
enc
));
assert
((
length
%
AES_BLOCK_SIZE
)
==
0
);
OPENSSL_
assert
(
in
&&
out
&&
key
&&
ivec
);
OPENSSL_
assert
((
AES_ENCRYPT
==
enc
)
||
(
AES_DECRYPT
==
enc
));
OPENSSL_
assert
((
length
%
AES_BLOCK_SIZE
)
==
0
);
if
(
AES_ENCRYPT
==
enc
)
{
...
...
@@ -94,17 +94,17 @@ void AES_ige_encrypt(const unsigned char *in, unsigned char *out,
check for overlap, too) */
while
(
len
>=
AES_BLOCK_SIZE
)
{
/
/ hexdump(stdout, "in", in, AES_BLOCK_SIZE);
/
/ hexdump(stdout, "iv", iv, AES_BLOCK_SIZE);
/
* hexdump(stdout, "in", in, AES_BLOCK_SIZE); */
/
* hexdump(stdout, "iv", iv, AES_BLOCK_SIZE); */
for
(
n
=
0
;
n
<
AES_BLOCK_SIZE
;
++
n
)
out
[
n
]
=
in
[
n
]
^
iv
[
n
];
/
/ hexdump(stdout, "in ^ iv", out, AES_BLOCK_SIZE);
/
* hexdump(stdout, "in ^ iv", out, AES_BLOCK_SIZE); */
AES_encrypt
(
out
,
out
,
key
);
/
/ hexdump(stdout,"enc", out, AES_BLOCK_SIZE);
/
/ hexdump(stdout,"iv2", iv2, AES_BLOCK_SIZE);
/
* hexdump(stdout,"enc", out, AES_BLOCK_SIZE); */
/
* hexdump(stdout,"iv2", iv2, AES_BLOCK_SIZE); */
for
(
n
=
0
;
n
<
AES_BLOCK_SIZE
;
++
n
)
out
[
n
]
^=
iv2
[
n
];
/
/ hexdump(stdout,"out", out, AES_BLOCK_SIZE);
/
* hexdump(stdout,"out", out, AES_BLOCK_SIZE); */
iv
=
out
;
memcpy
(
prev
,
in
,
AES_BLOCK_SIZE
);
iv2
=
prev
;
...
...
@@ -121,17 +121,17 @@ void AES_ige_encrypt(const unsigned char *in, unsigned char *out,
{
memcpy
(
tmp
,
in
,
AES_BLOCK_SIZE
);
memcpy
(
tmp2
,
in
,
AES_BLOCK_SIZE
);
/
/ hexdump(stdout, "in", in, AES_BLOCK_SIZE);
/
/ hexdump(stdout, "iv2", iv2, AES_BLOCK_SIZE);
/
* hexdump(stdout, "in", in, AES_BLOCK_SIZE); */
/
* hexdump(stdout, "iv2", iv2, AES_BLOCK_SIZE); */
for
(
n
=
0
;
n
<
AES_BLOCK_SIZE
;
++
n
)
tmp
[
n
]
^=
iv2
[
n
];
/
/ hexdump(stdout, "in ^ iv2", tmp, AES_BLOCK_SIZE);
/
* hexdump(stdout, "in ^ iv2", tmp, AES_BLOCK_SIZE); */
AES_decrypt
(
tmp
,
out
,
key
);
/
/ hexdump(stdout, "dec", out, AES_BLOCK_SIZE);
/
/ hexdump(stdout, "iv", ivec, AES_BLOCK_SIZE);
/
* hexdump(stdout, "dec", out, AES_BLOCK_SIZE); */
/
* hexdump(stdout, "iv", ivec, AES_BLOCK_SIZE); */
for
(
n
=
0
;
n
<
AES_BLOCK_SIZE
;
++
n
)
out
[
n
]
^=
ivec
[
n
];
/
/ hexdump(stdout, "out", out, AES_BLOCK_SIZE);
/
* hexdump(stdout, "out", out, AES_BLOCK_SIZE); */
memcpy
(
ivec
,
tmp2
,
AES_BLOCK_SIZE
);
iv2
=
out
;
len
-=
AES_BLOCK_SIZE
;
...
...
@@ -163,9 +163,9 @@ void AES_bi_ige_encrypt(const unsigned char *in, unsigned char *out,
const
unsigned
char
*
iv
;
const
unsigned
char
*
iv2
;
assert
(
in
&&
out
&&
key
&&
ivec
);
assert
((
AES_ENCRYPT
==
enc
)
||
(
AES_DECRYPT
==
enc
));
assert
((
length
%
AES_BLOCK_SIZE
)
==
0
);
OPENSSL_
assert
(
in
&&
out
&&
key
&&
ivec
);
OPENSSL_
assert
((
AES_ENCRYPT
==
enc
)
||
(
AES_DECRYPT
==
enc
));
OPENSSL_
assert
((
length
%
AES_BLOCK_SIZE
)
==
0
);
if
(
AES_ENCRYPT
==
enc
)
{
...
...
@@ -177,17 +177,17 @@ void AES_bi_ige_encrypt(const unsigned char *in, unsigned char *out,
iv2
=
ivec
+
AES_BLOCK_SIZE
;
while
(
len
>=
AES_BLOCK_SIZE
)
{
/
/ hexdump(stdout, "in", in, AES_BLOCK_SIZE);
/
/ hexdump(stdout, "iv", iv, AES_BLOCK_SIZE);
/
* hexdump(stdout, "in", in, AES_BLOCK_SIZE); */
/
* hexdump(stdout, "iv", iv, AES_BLOCK_SIZE); */
for
(
n
=
0
;
n
<
AES_BLOCK_SIZE
;
++
n
)
out
[
n
]
=
in
[
n
]
^
iv
[
n
];
/
/ hexdump(stdout, "in ^ iv", out, AES_BLOCK_SIZE);
/
* hexdump(stdout, "in ^ iv", out, AES_BLOCK_SIZE); */
AES_encrypt
(
out
,
out
,
key
);
/
/ hexdump(stdout,"enc", out, AES_BLOCK_SIZE);
/
/ hexdump(stdout,"iv2", iv2, AES_BLOCK_SIZE);
/
* hexdump(stdout,"enc", out, AES_BLOCK_SIZE); */
/
* hexdump(stdout,"iv2", iv2, AES_BLOCK_SIZE); */
for
(
n
=
0
;
n
<
AES_BLOCK_SIZE
;
++
n
)
out
[
n
]
^=
iv2
[
n
];
/
/ hexdump(stdout,"out", out, AES_BLOCK_SIZE);
/
* hexdump(stdout,"out", out, AES_BLOCK_SIZE); */
iv
=
out
;
memcpy
(
prev
,
in
,
AES_BLOCK_SIZE
);
iv2
=
prev
;
...
...
@@ -203,19 +203,19 @@ void AES_bi_ige_encrypt(const unsigned char *in, unsigned char *out,
while
(
len
>=
AES_BLOCK_SIZE
)
{
out
-=
AES_BLOCK_SIZE
;
/
/ hexdump(stdout, "intermediate", out, AES_BLOCK_SIZE);
/
/ hexdump(stdout, "iv", iv, AES_BLOCK_SIZE);
/
/ XXX: reduce copies by alternating between buffers
/
* hexdump(stdout, "intermediate", out, AES_BLOCK_SIZE); */
/
* hexdump(stdout, "iv", iv, AES_BLOCK_SIZE); */
/
* XXX: reduce copies by alternating between buffers */
memcpy
(
tmp
,
out
,
AES_BLOCK_SIZE
);
for
(
n
=
0
;
n
<
AES_BLOCK_SIZE
;
++
n
)
out
[
n
]
^=
iv
[
n
];
/
/ hexdump(stdout, "out ^ iv", out, AES_BLOCK_SIZE);
/
* hexdump(stdout, "out ^ iv", out, AES_BLOCK_SIZE); */
AES_encrypt
(
out
,
out
,
key
);
/
/ hexdump(stdout,"enc", out, AES_BLOCK_SIZE);
/
/ hexdump(stdout,"iv2", iv2, AES_BLOCK_SIZE);
/
* hexdump(stdout,"enc", out, AES_BLOCK_SIZE); */
/
* hexdump(stdout,"iv2", iv2, AES_BLOCK_SIZE); */
for
(
n
=
0
;
n
<
AES_BLOCK_SIZE
;
++
n
)
out
[
n
]
^=
iv2
[
n
];
/
/ hexdump(stdout,"out", out, AES_BLOCK_SIZE);
/
* hexdump(stdout,"out", out, AES_BLOCK_SIZE); */
iv
=
out
;
memcpy
(
prev
,
tmp
,
AES_BLOCK_SIZE
);
iv2
=
prev
;
...
...
@@ -235,17 +235,17 @@ void AES_bi_ige_encrypt(const unsigned char *in, unsigned char *out,
out
-=
AES_BLOCK_SIZE
;
memcpy
(
tmp
,
in
,
AES_BLOCK_SIZE
);
memcpy
(
tmp2
,
in
,
AES_BLOCK_SIZE
);
/
/ hexdump(stdout, "in", in, AES_BLOCK_SIZE);
/
/ hexdump(stdout, "iv2", iv2, AES_BLOCK_SIZE);
/
* hexdump(stdout, "in", in, AES_BLOCK_SIZE); */
/
* hexdump(stdout, "iv2", iv2, AES_BLOCK_SIZE); */
for
(
n
=
0
;
n
<
AES_BLOCK_SIZE
;
++
n
)
tmp
[
n
]
^=
iv2
[
n
];
/
/ hexdump(stdout, "in ^ iv2", tmp, AES_BLOCK_SIZE);
/
* hexdump(stdout, "in ^ iv2", tmp, AES_BLOCK_SIZE); */
AES_decrypt
(
tmp
,
out
,
key
);
/
/ hexdump(stdout, "dec", out, AES_BLOCK_SIZE);
/
/ hexdump(stdout, "iv", iv, AES_BLOCK_SIZE);
/
* hexdump(stdout, "dec", out, AES_BLOCK_SIZE); */
/
* hexdump(stdout, "iv", iv, AES_BLOCK_SIZE); */
for
(
n
=
0
;
n
<
AES_BLOCK_SIZE
;
++
n
)
out
[
n
]
^=
iv
[
n
];
/
/ hexdump(stdout, "out", out, AES_BLOCK_SIZE);
/
* hexdump(stdout, "out", out, AES_BLOCK_SIZE); */
memcpy
(
tmp3
,
tmp2
,
AES_BLOCK_SIZE
);
iv
=
tmp3
;
iv2
=
out
;
...
...
@@ -260,17 +260,17 @@ void AES_bi_ige_encrypt(const unsigned char *in, unsigned char *out,
{
memcpy
(
tmp
,
out
,
AES_BLOCK_SIZE
);
memcpy
(
tmp2
,
out
,
AES_BLOCK_SIZE
);
/
/ hexdump(stdout, "intermediate", out, AES_BLOCK_SIZE);
/
/ hexdump(stdout, "iv2", iv2, AES_BLOCK_SIZE);
/
* hexdump(stdout, "intermediate", out, AES_BLOCK_SIZE); */
/
* hexdump(stdout, "iv2", iv2, AES_BLOCK_SIZE); */
for
(
n
=
0
;
n
<
AES_BLOCK_SIZE
;
++
n
)
tmp
[
n
]
^=
iv2
[
n
];
/
/ hexdump(stdout, "out ^ iv2", tmp, AES_BLOCK_SIZE);
/
* hexdump(stdout, "out ^ iv2", tmp, AES_BLOCK_SIZE); */
AES_decrypt
(
tmp
,
out
,
key
);
/
/ hexdump(stdout, "dec", out, AES_BLOCK_SIZE);
/
/ hexdump(stdout, "iv", ivec, AES_BLOCK_SIZE);
/
* hexdump(stdout, "dec", out, AES_BLOCK_SIZE); */
/
* hexdump(stdout, "iv", ivec, AES_BLOCK_SIZE); */
for
(
n
=
0
;
n
<
AES_BLOCK_SIZE
;
++
n
)
out
[
n
]
^=
iv
[
n
];
/
/ hexdump(stdout, "out", out, AES_BLOCK_SIZE);
/
* hexdump(stdout, "out", out, AES_BLOCK_SIZE); */
memcpy
(
tmp3
,
tmp2
,
AES_BLOCK_SIZE
);
iv
=
tmp3
;
iv2
=
out
;
...
...
crypto/evp/e_camellia.c
浏览文件 @
02c9b66a
...
...
@@ -122,4 +122,10 @@ static int camellia_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
return
1
;
}
#else
# ifdef PEDANTIC
static
void
*
dummy
=&
dummy
;
# endif
#endif
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录