Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
dda81999
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看板
提交
dda81999
编写于
2月 11, 2015
作者:
A
Andy Polyakov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add Camellia CTR mode.
Reviewed-by:
N
Rich Salz
<
rsalz@openssl.org
>
上级
c79e1773
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
70 addition
and
6 deletion
+70
-6
crypto/evp/c_allc.c
crypto/evp/c_allc.c
+3
-0
crypto/evp/e_camellia.c
crypto/evp/e_camellia.c
+3
-6
crypto/evp/evptests.txt
crypto/evp/evptests.txt
+64
-0
未找到文件。
crypto/evp/c_allc.c
浏览文件 @
dda81999
...
...
@@ -245,5 +245,8 @@ void OpenSSL_add_all_ciphers(void)
EVP_add_cipher
(
EVP_camellia_256_ofb
());
EVP_add_cipher_alias
(
SN_camellia_256_cbc
,
"CAMELLIA256"
);
EVP_add_cipher_alias
(
SN_camellia_256_cbc
,
"camellia256"
);
EVP_add_cipher
(
EVP_camellia_128_ctr
());
EVP_add_cipher
(
EVP_camellia_192_ctr
());
EVP_add_cipher
(
EVP_camellia_256_ctr
());
#endif
}
crypto/evp/e_camellia.c
浏览文件 @
dda81999
...
...
@@ -248,10 +248,9 @@ const EVP_CIPHER *EVP_camellia_##keylen##_##mode(void) \
BLOCK_CIPHER_generic(nid,keylen,1,16,ofb128,ofb,OFB,flags|EVP_CIPH_FLAG_DEFAULT_ASN1) \
BLOCK_CIPHER_generic(nid,keylen,1,16,cfb128,cfb,CFB,flags|EVP_CIPH_FLAG_DEFAULT_ASN1) \
BLOCK_CIPHER_generic(nid,keylen,1,16,cfb1,cfb1,CFB,flags) \
BLOCK_CIPHER_generic(nid,keylen,1,16,cfb8,cfb8,CFB,flags)
# if 0
/* not yet, missing NID */
BLOCK_CIPHER_generic
(
nid
,
keylen
,
1
,
16
,
ctr
,
ctr
,
CTR
,
flags
)
# endif
BLOCK_CIPHER_generic(nid,keylen,1,16,cfb8,cfb8,CFB,flags) \
BLOCK_CIPHER_generic(nid, keylen, 1, 16, ctr, ctr, CTR, flags)
/* The subkey for Camellia is generated. */
static
int
camellia_init_key
(
EVP_CIPHER_CTX
*
ctx
,
const
unsigned
char
*
key
,
const
unsigned
char
*
iv
,
int
enc
)
...
...
@@ -364,7 +363,6 @@ static int camellia_cfb1_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
return
1
;
}
# if 0
/* not yet, missing NID */
static
int
camellia_ctr_cipher
(
EVP_CIPHER_CTX
*
ctx
,
unsigned
char
*
out
,
const
unsigned
char
*
in
,
size_t
len
)
{
...
...
@@ -380,7 +378,6 @@ static int camellia_ctr_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
ctx
->
num
=
(
size_t
)
num
;
return
1
;
}
# endif
BLOCK_CIPHER_generic_pack
(
NID_camellia
,
128
,
0
)
BLOCK_CIPHER_generic_pack
(
NID_camellia
,
192
,
0
)
...
...
crypto/evp/evptests.txt
浏览文件 @
dda81999
...
...
@@ -1297,6 +1297,70 @@ Plaintext = F69F2445DF4F9B17AD2B417BE66C3710
Ciphertext = 0A4A0404E26AA78A27CB271E8BF3CF20
# Camellia test vectors from RFC5528
Cipher = CAMELLIA-128-CTR
Key = AE6852F8121067CC4BF7A5765577F39E
IV = 00000030000000000000000000000001
Operation = ENCRYPT
Plaintext = 53696E676C6520626C6F636B206D7367
Ciphertext = D09DC29A8214619A20877C76DB1F0B3F
Cipher = CAMELLIA-128-CTR
Key = 7E24067817FAE0D743D6CE1F32539163
IV = 006CB6DBC0543B59DA48D90B00000001
Operation = ENCRYPT
Plaintext = 000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F
Ciphertext = DBF3C78DC08396D4DA7C907765BBCB442B8E8E0F31F0DCA72C7417E35360E048
Cipher = CAMELLIA-128-CTR
Key = 7691BE035E5020A8AC6E618529F9A0DC
IV = 00E0017B27777F3F4A1786F000000001
Operation = ENCRYPT
Plaintext = 000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F20212223
Ciphertext = B19D1FCDCB75EB882F849CE24D85CF739CE64B2B5C9D73F14F2D5D9DCE9889CDDF508696
Cipher = CAMELLIA-192-CTR
Key = 16AF5B145FC9F579C175F93E3BFB0EED863D06CCFDB78515
IV = 0000004836733C147D6D93CB00000001
Operation = ENCRYPT
Plaintext = 53696E676C6520626C6F636B206D7367
Ciphertext = 2379399E8A8D2B2B16702FC78B9E9696
Cipher = CAMELLIA-192-CTR
Key = 7C5CB2401B3DC33C19E7340819E0F69C678C3DB8E6F6A91A
IV = 0096B03B020C6EADC2CB500D00000001
Operation = ENCRYPT
Plaintext = 000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F
Ciphertext = 7DEF34F7A5D0E415674B7FFCAE67C75DD018B86FF23051E056392A99F35A4CED
Cipher = CAMELLIA-192-CTR
Key = 02BF391EE8ECB159B959617B0965279BF59B60A786D3E0FE
IV = 0007BDFD5CBD60278DCC091200000001
Operation = ENCRYPT
Plaintext = 000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F20212223
Ciphertext = 5710E556E1487A20B5AC0E73F19E4E7876F37FDC91B1EF4D4DADE8E666A64D0ED557AB57
Cipher = CAMELLIA-256-CTR
Key = 776BEFF2851DB06F4C8A0542C8696F6C6A81AF1EEC96B4D37FC1D689E6C1C104
IV = 00000060DB5672C97AA8F0B200000001
Operation = ENCRYPT
Plaintext = 53696E676C6520626C6F636B206D7367
Ciphertext = 3401F9C8247EFFCEBD6994714C1BBB11
Cipher = CAMELLIA-256-CTR
Key = F6D66D6BD52D59BB0796365879EFF886C66DD51A5B6A99744B50590C87A23884
IV = 00FAAC24C1585EF15A43D87500000001
Operation = ENCRYPT
Plaintext = 000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F
Ciphertext = D6C30392246F7808A83C2B22A8839E45E51CD48A1CDF406EBC9CC2D3AB834108
Cipher = CAMELLIA-256-CTR
Key = FF7A617CE69148E4F1726E2F43581DE2AA62D9F805532EDFF1EED687FB54153D
IV = 001CC5B751A51D70A1C1114800000001
Operation = ENCRYPT
Plaintext = 000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F20212223
Ciphertext = A4DA23FCE6A5FFAA6D64AE9A0652A42CD161A34B65F9679F75C01F101F71276F15EF0D8D
# SEED test vectors from RFC4269
Cipher = SEED-ECB
Key = 00000000000000000000000000000000
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录