Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
081464fa
T
Third Party Openssl
项目概览
OpenHarmony
/
Third Party Openssl
接近 2 年 前同步成功
通知
12
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看板
提交
081464fa
编写于
7月 28, 2010
作者:
D
Dr. Stephen Henson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Make ctr mode behaviour consistent with other modes.
上级
ee2ffc27
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
8 addition
and
14 deletion
+8
-14
crypto/evp/e_aes.c
crypto/evp/e_aes.c
+3
-13
crypto/evp/evp.h
crypto/evp/evp.h
+1
-0
crypto/evp/evp_enc.c
crypto/evp/evp_enc.c
+4
-1
未找到文件。
crypto/evp/e_aes.c
浏览文件 @
081464fa
...
...
@@ -122,7 +122,7 @@ static int aes_counter (EVP_CIPHER_CTX *ctx, unsigned char *out,
static
const
EVP_CIPHER
aes_128_ctr_cipher
=
{
NID_aes_128_ctr
,
1
,
16
,
16
,
EVP_CIPH_C
USTOM_IV
,
EVP_CIPH_C
TR_MODE
,
aes_init_key
,
aes_counter
,
NULL
,
...
...
@@ -139,7 +139,7 @@ const EVP_CIPHER *EVP_aes_128_ctr (void)
static
const
EVP_CIPHER
aes_192_ctr_cipher
=
{
NID_aes_192_ctr
,
1
,
24
,
16
,
EVP_CIPH_C
USTOM_IV
,
EVP_CIPH_C
TR_MODE
,
aes_init_key
,
aes_counter
,
NULL
,
...
...
@@ -156,7 +156,7 @@ const EVP_CIPHER *EVP_aes_192_ctr (void)
static
const
EVP_CIPHER
aes_256_ctr_cipher
=
{
NID_aes_256_ctr
,
1
,
32
,
16
,
EVP_CIPH_C
USTOM_IV
,
EVP_CIPH_C
TR_MODE
,
aes_init_key
,
aes_counter
,
NULL
,
...
...
@@ -188,16 +188,6 @@ static int aes_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
return
0
;
}
if
(
ctx
->
cipher
->
flags
&
EVP_CIPH_CUSTOM_IV
)
{
if
(
iv
!=
NULL
)
memcpy
(
ctx
->
iv
,
iv
,
ctx
->
cipher
->
iv_len
);
else
{
EVPerr
(
EVP_F_AES_INIT_KEY
,
EVP_R_AES_IV_SETUP_FAILED
);
return
0
;
}
}
return
1
;
}
...
...
crypto/evp/evp.h
浏览文件 @
081464fa
...
...
@@ -326,6 +326,7 @@ struct evp_cipher_st
#define EVP_CIPH_CBC_MODE 0x2
#define EVP_CIPH_CFB_MODE 0x3
#define EVP_CIPH_OFB_MODE 0x4
#define EVP_CIPH_CTR_MODE 0x5
#define EVP_CIPH_MODE 0xF0007
/* Set if variable length cipher */
#define EVP_CIPH_VARIABLE_LENGTH 0x8
...
...
crypto/evp/evp_enc.c
浏览文件 @
081464fa
...
...
@@ -206,11 +206,14 @@ skip_to_init:
ctx
->
num
=
0
;
case
EVP_CIPH_CBC_MODE
:
case
EVP_CIPH_CTR_MODE
:
OPENSSL_assert
(
EVP_CIPHER_CTX_iv_length
(
ctx
)
<=
(
int
)
sizeof
(
ctx
->
iv
));
if
(
iv
)
memcpy
(
ctx
->
oiv
,
iv
,
EVP_CIPHER_CTX_iv_length
(
ctx
));
memcpy
(
ctx
->
iv
,
ctx
->
oiv
,
EVP_CIPHER_CTX_iv_length
(
ctx
));
/* Don't reuse IV for CTR mode */
if
(
EVP_CIPHER_CTX_mode
(
ctx
)
!=
EVP_CIPH_CTR_MODE
)
memcpy
(
ctx
->
iv
,
ctx
->
oiv
,
EVP_CIPHER_CTX_iv_length
(
ctx
));
break
;
default:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录