Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
6386b1b3
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看板
提交
6386b1b3
编写于
4月 18, 2011
作者:
D
Dr. Stephen Henson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Compile ccm128.c, move some structures to modes_lcl.h add prototypes.
上级
3b4a8557
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
27 addition
and
10 deletion
+27
-10
crypto/modes/Makefile
crypto/modes/Makefile
+3
-2
crypto/modes/ccm128.c
crypto/modes/ccm128.c
+1
-8
crypto/modes/modes.h
crypto/modes/modes.h
+16
-0
crypto/modes/modes_lcl.h
crypto/modes/modes_lcl.h
+7
-0
未找到文件。
crypto/modes/Makefile
浏览文件 @
6386b1b3
...
@@ -21,9 +21,10 @@ TEST=
...
@@ -21,9 +21,10 @@ TEST=
APPS
=
APPS
=
LIB
=
$(TOP)
/libcrypto.a
LIB
=
$(TOP)
/libcrypto.a
LIBSRC
=
cbc128.c ctr128.c cts128.c cfb128.c ofb128.c gcm128.c xts128.c
LIBSRC
=
cbc128.c ctr128.c cts128.c cfb128.c ofb128.c gcm128.c
\
ccm128.c xts128.c
LIBOBJ
=
cbc128.o ctr128.o cts128.o cfb128.o ofb128.o gcm128.o
\
LIBOBJ
=
cbc128.o ctr128.o cts128.o cfb128.o ofb128.o gcm128.o
\
xts128.o
$(MODES_ASM_OBJ)
ccm128.o
xts128.o
$(MODES_ASM_OBJ)
SRC
=
$(LIBSRC)
SRC
=
$(LIBSRC)
...
...
crypto/modes/ccm128.c
浏览文件 @
6386b1b3
...
@@ -58,13 +58,6 @@
...
@@ -58,13 +58,6 @@
#endif
#endif
#include <assert.h>
#include <assert.h>
typedef
struct
{
union
{
u64
u
[
2
];
u8
c
[
16
];
}
nonce
,
cmac
;
u64
blocks
;
block128_f
block
;
void
*
key
;
}
CCM128_CONTEXT
;
/* First you setup M and L parameters and pass the key schedule */
/* First you setup M and L parameters and pass the key schedule */
void
CRYPTO_ccm128_init
(
CCM128_CONTEXT
*
ctx
,
void
CRYPTO_ccm128_init
(
CCM128_CONTEXT
*
ctx
,
unsigned
int
M
,
unsigned
int
L
,
void
*
key
,
block128_f
block
)
unsigned
int
M
,
unsigned
int
L
,
void
*
key
,
block128_f
block
)
...
@@ -251,7 +244,7 @@ int CRYPTO_ccm128_decrypt(CCM128_CONTEXT *ctx,
...
@@ -251,7 +244,7 @@ int CRYPTO_ccm128_decrypt(CCM128_CONTEXT *ctx,
size_t
n
;
size_t
n
;
unsigned
int
i
,
L
;
unsigned
int
i
,
L
;
unsigned
char
flags0
=
ctx
->
nonce
.
c
[
0
];
unsigned
char
flags0
=
ctx
->
nonce
.
c
[
0
];
block128_f
block
;
block128_f
block
=
ctx
->
block
;
union
{
u64
u
[
2
];
u8
c
[
16
];
}
scratch
;
union
{
u64
u
[
2
];
u8
c
[
16
];
}
scratch
;
if
(
!
(
flags0
&
0x40
))
if
(
!
(
flags0
&
0x40
))
...
...
crypto/modes/modes.h
浏览文件 @
6386b1b3
...
@@ -105,6 +105,22 @@ int CRYPTO_gcm128_finish(GCM128_CONTEXT *ctx,const unsigned char *tag,
...
@@ -105,6 +105,22 @@ int CRYPTO_gcm128_finish(GCM128_CONTEXT *ctx,const unsigned char *tag,
void
CRYPTO_gcm128_tag
(
GCM128_CONTEXT
*
ctx
,
unsigned
char
*
tag
,
size_t
len
);
void
CRYPTO_gcm128_tag
(
GCM128_CONTEXT
*
ctx
,
unsigned
char
*
tag
,
size_t
len
);
void
CRYPTO_gcm128_release
(
GCM128_CONTEXT
*
ctx
);
void
CRYPTO_gcm128_release
(
GCM128_CONTEXT
*
ctx
);
typedef
struct
ccm128_context
CCM128_CONTEXT
;
void
CRYPTO_ccm128_init
(
CCM128_CONTEXT
*
ctx
,
unsigned
int
M
,
unsigned
int
L
,
void
*
key
,
block128_f
block
);
int
CRYPTO_ccm128_setiv
(
CCM128_CONTEXT
*
ctx
,
const
unsigned
char
*
nonce
,
size_t
nlen
,
size_t
mlen
);
void
CRYPTO_ccm128_aad
(
CCM128_CONTEXT
*
ctx
,
const
unsigned
char
*
aad
,
size_t
alen
);
int
CRYPTO_ccm128_encrypt
(
CCM128_CONTEXT
*
ctx
,
const
unsigned
char
*
inp
,
unsigned
char
*
out
,
size_t
len
);
int
CRYPTO_ccm128_decrypt
(
CCM128_CONTEXT
*
ctx
,
const
unsigned
char
*
inp
,
unsigned
char
*
out
,
size_t
len
);
size_t
CRYPTO_ccm128_tag
(
CCM128_CONTEXT
*
ctx
,
unsigned
char
*
tag
,
size_t
len
);
typedef
struct
xts128_context
XTS128_CONTEXT
;
typedef
struct
xts128_context
XTS128_CONTEXT
;
int
CRYPTO_xts128_encrypt
(
const
XTS128_CONTEXT
*
ctx
,
const
unsigned
char
*
iv
,
int
CRYPTO_xts128_encrypt
(
const
XTS128_CONTEXT
*
ctx
,
const
unsigned
char
*
iv
,
...
...
crypto/modes/modes_lcl.h
浏览文件 @
6386b1b3
...
@@ -122,3 +122,10 @@ struct xts128_context {
...
@@ -122,3 +122,10 @@ struct xts128_context {
block128_f
block1
,
block2
;
block128_f
block1
,
block2
;
};
};
struct
ccm128_context
{
union
{
u64
u
[
2
];
u8
c
[
16
];
}
nonce
,
cmac
;
u64
blocks
;
block128_f
block
;
void
*
key
;
};
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录