Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
1bbea403
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
1bbea403
编写于
12月 02, 2015
作者:
A
Andy Polyakov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
modes/ocb128.c: fix sanitizer warning.
Reviewed-by:
N
Rich Salz
<
rsalz@openssl.org
>
上级
16b6081e
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
7 addition
and
7 deletion
+7
-7
crypto/modes/ocb128.c
crypto/modes/ocb128.c
+7
-7
未找到文件。
crypto/modes/ocb128.c
浏览文件 @
1bbea403
...
...
@@ -78,7 +78,8 @@ static u32 ocb_ntz(u64 n)
/*
* Shift a block of 16 bytes left by shift bits
*/
static
void
ocb_block_lshift
(
OCB_BLOCK
*
in
,
size_t
shift
,
OCB_BLOCK
*
out
)
static
void
ocb_block_lshift
(
const
unsigned
char
*
in
,
size_t
shift
,
unsigned
char
*
out
)
{
unsigned
char
shift_mask
;
int
i
;
...
...
@@ -88,13 +89,13 @@ static void ocb_block_lshift(OCB_BLOCK *in, size_t shift, OCB_BLOCK *out)
shift_mask
<<=
(
8
-
shift
);
for
(
i
=
15
;
i
>=
0
;
i
--
)
{
if
(
i
>
0
)
{
mask
[
i
-
1
]
=
in
->
c
[
i
]
&
shift_mask
;
mask
[
i
-
1
]
=
in
[
i
]
&
shift_mask
;
mask
[
i
-
1
]
>>=
8
-
shift
;
}
out
->
c
[
i
]
=
in
->
c
[
i
]
<<
shift
;
out
[
i
]
=
in
[
i
]
<<
shift
;
if
(
i
!=
15
)
{
out
->
c
[
i
]
^=
mask
[
i
];
out
[
i
]
^=
mask
[
i
];
}
}
}
...
...
@@ -114,7 +115,7 @@ static void ocb_double(OCB_BLOCK *in, OCB_BLOCK *out)
mask
>>=
7
;
mask
*=
135
;
ocb_block_lshift
(
in
,
1
,
out
);
ocb_block_lshift
(
in
->
c
,
1
,
out
->
c
);
out
->
c
[
15
]
^=
mask
;
}
...
...
@@ -307,8 +308,7 @@ int CRYPTO_ocb128_setiv(OCB128_CONTEXT *ctx, const unsigned char *iv,
/* Offset_0 = Stretch[1+bottom..128+bottom] */
shift
=
bottom
%
8
;
ocb_block_lshift
((
OCB_BLOCK
*
)(
stretch
+
(
bottom
/
8
)),
shift
,
&
ctx
->
offset
);
ocb_block_lshift
(
stretch
+
(
bottom
/
8
),
shift
,
ctx
->
offset
.
c
);
mask
=
0xff
;
mask
<<=
8
-
shift
;
ctx
->
offset
.
c
[
15
]
|=
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录