Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
63d74075
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看板
提交
63d74075
编写于
5月 31, 2005
作者:
N
Nils Larsch
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
changes from 0.9.8
上级
6e04afb8
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
43 addition
and
2 deletion
+43
-2
apps/speed.c
apps/speed.c
+2
-0
crypto/engine/eng_padlock.c
crypto/engine/eng_padlock.c
+18
-1
crypto/evp/evp_test.c
crypto/evp/evp_test.c
+22
-0
crypto/rsa/rsa_x931.c
crypto/rsa/rsa_x931.c
+1
-1
未找到文件。
apps/speed.c
浏览文件 @
63d74075
...
@@ -527,6 +527,7 @@ int MAIN(int argc, char **argv)
...
@@ -527,6 +527,7 @@ int MAIN(int argc, char **argv)
static
const
unsigned
char
key16
[
16
]
=
static
const
unsigned
char
key16
[
16
]
=
{
0x12
,
0x34
,
0x56
,
0x78
,
0x9a
,
0xbc
,
0xde
,
0xf0
,
{
0x12
,
0x34
,
0x56
,
0x78
,
0x9a
,
0xbc
,
0xde
,
0xf0
,
0x34
,
0x56
,
0x78
,
0x9a
,
0xbc
,
0xde
,
0xf0
,
0x12
};
0x34
,
0x56
,
0x78
,
0x9a
,
0xbc
,
0xde
,
0xf0
,
0x12
};
#ifndef OPENSSL_NO_AES
static
const
unsigned
char
key24
[
24
]
=
static
const
unsigned
char
key24
[
24
]
=
{
0x12
,
0x34
,
0x56
,
0x78
,
0x9a
,
0xbc
,
0xde
,
0xf0
,
{
0x12
,
0x34
,
0x56
,
0x78
,
0x9a
,
0xbc
,
0xde
,
0xf0
,
0x34
,
0x56
,
0x78
,
0x9a
,
0xbc
,
0xde
,
0xf0
,
0x12
,
0x34
,
0x56
,
0x78
,
0x9a
,
0xbc
,
0xde
,
0xf0
,
0x12
,
...
@@ -536,6 +537,7 @@ int MAIN(int argc, char **argv)
...
@@ -536,6 +537,7 @@ int MAIN(int argc, char **argv)
0x34
,
0x56
,
0x78
,
0x9a
,
0xbc
,
0xde
,
0xf0
,
0x12
,
0x34
,
0x56
,
0x78
,
0x9a
,
0xbc
,
0xde
,
0xf0
,
0x12
,
0x56
,
0x78
,
0x9a
,
0xbc
,
0xde
,
0xf0
,
0x12
,
0x34
,
0x56
,
0x78
,
0x9a
,
0xbc
,
0xde
,
0xf0
,
0x12
,
0x34
,
0x78
,
0x9a
,
0xbc
,
0xde
,
0xf0
,
0x12
,
0x34
,
0x56
};
0x78
,
0x9a
,
0xbc
,
0xde
,
0xf0
,
0x12
,
0x34
,
0x56
};
#endif
#ifndef OPENSSL_NO_AES
#ifndef OPENSSL_NO_AES
#define MAX_BLOCK_SIZE 128
#define MAX_BLOCK_SIZE 128
#else
#else
...
...
crypto/engine/eng_padlock.c
浏览文件 @
63d74075
...
@@ -66,11 +66,14 @@
...
@@ -66,11 +66,14 @@
#include <stdio.h>
#include <stdio.h>
#include <string.h>
#include <string.h>
#include <openssl/opensslconf.h>
#include <openssl/crypto.h>
#include <openssl/crypto.h>
#include <openssl/dso.h>
#include <openssl/dso.h>
#include <openssl/engine.h>
#include <openssl/engine.h>
#include <openssl/evp.h>
#include <openssl/evp.h>
#ifndef OPENSSL_NO_AES
#include <openssl/aes.h>
#include <openssl/aes.h>
#endif
#include <openssl/rand.h>
#include <openssl/rand.h>
#ifndef OPENSSL_NO_HW
#ifndef OPENSSL_NO_HW
...
@@ -134,7 +137,9 @@ static int padlock_init(ENGINE *e);
...
@@ -134,7 +137,9 @@ static int padlock_init(ENGINE *e);
static
RAND_METHOD
padlock_rand
;
static
RAND_METHOD
padlock_rand
;
/* Cipher Stuff */
/* Cipher Stuff */
#ifndef OPENSSL_NO_AES
static
int
padlock_ciphers
(
ENGINE
*
e
,
const
EVP_CIPHER
**
cipher
,
const
int
**
nids
,
int
nid
);
static
int
padlock_ciphers
(
ENGINE
*
e
,
const
EVP_CIPHER
**
cipher
,
const
int
**
nids
,
int
nid
);
#endif
/* Engine names */
/* Engine names */
static
const
char
*
padlock_id
=
"padlock"
;
static
const
char
*
padlock_id
=
"padlock"
;
...
@@ -143,7 +148,9 @@ static char padlock_name[100];
...
@@ -143,7 +148,9 @@ static char padlock_name[100];
/* Available features */
/* Available features */
static
int
padlock_use_ace
=
0
;
/* Advanced Cryptography Engine */
static
int
padlock_use_ace
=
0
;
/* Advanced Cryptography Engine */
static
int
padlock_use_rng
=
0
;
/* Random Number Generator */
static
int
padlock_use_rng
=
0
;
/* Random Number Generator */
#ifndef OPENSSL_NO_AES
static
int
padlock_aes_align_required
=
1
;
static
int
padlock_aes_align_required
=
1
;
#endif
/* ===== Engine "management" functions ===== */
/* ===== Engine "management" functions ===== */
...
@@ -169,8 +176,9 @@ padlock_bind_helper(ENGINE *e)
...
@@ -169,8 +176,9 @@ padlock_bind_helper(ENGINE *e)
!
ENGINE_set_name
(
e
,
padlock_name
)
||
!
ENGINE_set_name
(
e
,
padlock_name
)
||
!
ENGINE_set_init_function
(
e
,
padlock_init
)
||
!
ENGINE_set_init_function
(
e
,
padlock_init
)
||
#ifndef OPENSSL_NO_AES
(
padlock_use_ace
&&
!
ENGINE_set_ciphers
(
e
,
padlock_ciphers
))
||
(
padlock_use_ace
&&
!
ENGINE_set_ciphers
(
e
,
padlock_ciphers
))
||
#endif
(
padlock_use_rng
&&
!
ENGINE_set_RAND
(
e
,
&
padlock_rand
)))
{
(
padlock_use_rng
&&
!
ENGINE_set_RAND
(
e
,
&
padlock_rand
)))
{
return
0
;
return
0
;
}
}
...
@@ -228,6 +236,7 @@ IMPLEMENT_DYNAMIC_BIND_FN (padlock_bind_fn);
...
@@ -228,6 +236,7 @@ IMPLEMENT_DYNAMIC_BIND_FN (padlock_bind_fn);
/* ===== Here comes the "real" engine ===== */
/* ===== Here comes the "real" engine ===== */
#ifndef OPENSSL_NO_AES
/* Some AES-related constants */
/* Some AES-related constants */
#define AES_BLOCK_SIZE 16
#define AES_BLOCK_SIZE 16
#define AES_KEY_SIZE_128 16
#define AES_KEY_SIZE_128 16
...
@@ -264,6 +273,7 @@ struct padlock_cipher_data
...
@@ -264,6 +273,7 @@ struct padlock_cipher_data
* so we accept the penatly...
* so we accept the penatly...
*/
*/
static
volatile
struct
padlock_cipher_data
*
padlock_saved_context
;
static
volatile
struct
padlock_cipher_data
*
padlock_saved_context
;
#endif
/*
/*
* =======================================================
* =======================================================
...
@@ -355,6 +365,7 @@ padlock_available(void)
...
@@ -355,6 +365,7 @@ padlock_available(void)
return
padlock_use_ace
+
padlock_use_rng
;
return
padlock_use_ace
+
padlock_use_rng
;
}
}
#ifndef OPENSSL_NO_AES
/* Our own htonl()/ntohl() */
/* Our own htonl()/ntohl() */
static
inline
void
static
inline
void
padlock_bswapl
(
AES_KEY
*
ks
)
padlock_bswapl
(
AES_KEY
*
ks
)
...
@@ -367,6 +378,7 @@ padlock_bswapl(AES_KEY *ks)
...
@@ -367,6 +378,7 @@ padlock_bswapl(AES_KEY *ks)
key
++
;
key
++
;
}
}
}
}
#endif
/* Force key reload from memory to the CPU microcode.
/* Force key reload from memory to the CPU microcode.
Loading EFLAGS from the stack clears EFLAGS[30]
Loading EFLAGS from the stack clears EFLAGS[30]
...
@@ -377,6 +389,7 @@ padlock_reload_key(void)
...
@@ -377,6 +389,7 @@ padlock_reload_key(void)
asm
volatile
(
"pushfl; popfl"
);
asm
volatile
(
"pushfl; popfl"
);
}
}
#ifndef OPENSSL_NO_AES
/*
/*
* This is heuristic key context tracing. At first one
* This is heuristic key context tracing. At first one
* believes that one should use atomic swap instructions,
* believes that one should use atomic swap instructions,
...
@@ -430,6 +443,7 @@ PADLOCK_XCRYPT_ASM(padlock_xcrypt_ecb, ".byte 0xf3,0x0f,0xa7,0xc8") /* rep xcryp
...
@@ -430,6 +443,7 @@ PADLOCK_XCRYPT_ASM(padlock_xcrypt_ecb, ".byte 0xf3,0x0f,0xa7,0xc8") /* rep xcryp
PADLOCK_XCRYPT_ASM
(
padlock_xcrypt_cbc
,
".byte 0xf3,0x0f,0xa7,0xd0"
)
/* rep xcryptcbc */
PADLOCK_XCRYPT_ASM
(
padlock_xcrypt_cbc
,
".byte 0xf3,0x0f,0xa7,0xd0"
)
/* rep xcryptcbc */
PADLOCK_XCRYPT_ASM
(
padlock_xcrypt_cfb
,
".byte 0xf3,0x0f,0xa7,0xe0"
)
/* rep xcryptcfb */
PADLOCK_XCRYPT_ASM
(
padlock_xcrypt_cfb
,
".byte 0xf3,0x0f,0xa7,0xe0"
)
/* rep xcryptcfb */
PADLOCK_XCRYPT_ASM
(
padlock_xcrypt_ofb
,
".byte 0xf3,0x0f,0xa7,0xe8"
)
/* rep xcryptofb */
PADLOCK_XCRYPT_ASM
(
padlock_xcrypt_ofb
,
".byte 0xf3,0x0f,0xa7,0xe8"
)
/* rep xcryptofb */
#endif
/* The RNG call itself */
/* The RNG call itself */
static
inline
unsigned
int
static
inline
unsigned
int
...
@@ -600,6 +614,7 @@ padlock_bswapl(void *key)
...
@@ -600,6 +614,7 @@ padlock_bswapl(void *key)
#endif
#endif
/* ===== AES encryption/decryption ===== */
/* ===== AES encryption/decryption ===== */
#ifndef OPENSSL_NO_AES
#if defined(NID_aes_128_cfb128) && ! defined (NID_aes_128_cfb)
#if defined(NID_aes_128_cfb128) && ! defined (NID_aes_128_cfb)
#define NID_aes_128_cfb NID_aes_128_cfb128
#define NID_aes_128_cfb NID_aes_128_cfb128
...
@@ -1030,6 +1045,8 @@ padlock_aes_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out_arg,
...
@@ -1030,6 +1045,8 @@ padlock_aes_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out_arg,
return
1
;
return
1
;
}
}
#endif
/* OPENSSL_NO_AES */
/* ===== Random Number Generator ===== */
/* ===== Random Number Generator ===== */
/*
/*
* This code is not engaged. The reason is that it does not comply
* This code is not engaged. The reason is that it does not comply
...
...
crypto/evp/evp_test.c
浏览文件 @
63d74075
...
@@ -52,6 +52,7 @@
...
@@ -52,6 +52,7 @@
#include "../e_os.h"
#include "../e_os.h"
#include <openssl/opensslconf.h>
#include <openssl/evp.h>
#include <openssl/evp.h>
#ifndef OPENSSL_NO_ENGINE
#ifndef OPENSSL_NO_ENGINE
#include <openssl/engine.h>
#include <openssl/engine.h>
...
@@ -395,6 +396,27 @@ int main(int argc,char **argv)
...
@@ -395,6 +396,27 @@ int main(int argc,char **argv)
if
(
!
test_cipher
(
cipher
,
key
,
kn
,
iv
,
in
,
plaintext
,
pn
,
ciphertext
,
cn
,
encdec
)
if
(
!
test_cipher
(
cipher
,
key
,
kn
,
iv
,
in
,
plaintext
,
pn
,
ciphertext
,
cn
,
encdec
)
&&
!
test_digest
(
cipher
,
plaintext
,
pn
,
ciphertext
,
cn
))
&&
!
test_digest
(
cipher
,
plaintext
,
pn
,
ciphertext
,
cn
))
{
{
#ifdef OPENSSL_NO_AES
if
(
strstr
(
cipher
,
"AES"
)
==
cipher
)
{
fprintf
(
stdout
,
"Cipher disabled, skipping %s
\n
"
,
cipher
);
continue
;
}
#endif
#ifdef OPENSSL_NO_DES
if
(
strstr
(
cipher
,
"DES"
)
==
cipher
)
{
fprintf
(
stdout
,
"Cipher disabled, skipping %s
\n
"
,
cipher
);
continue
;
}
#endif
#ifdef OPENSSL_NO_RC4
if
(
strstr
(
cipher
,
"RC4"
)
==
cipher
)
{
fprintf
(
stdout
,
"Cipher disabled, skipping %s
\n
"
,
cipher
);
continue
;
}
#endif
fprintf
(
stderr
,
"Can't find %s
\n
"
,
cipher
);
fprintf
(
stderr
,
"Can't find %s
\n
"
,
cipher
);
EXIT
(
3
);
EXIT
(
3
);
}
}
...
...
crypto/rsa/rsa_x931.c
浏览文件 @
63d74075
...
@@ -105,7 +105,7 @@ int RSA_padding_add_X931(unsigned char *to, int tlen,
...
@@ -105,7 +105,7 @@ int RSA_padding_add_X931(unsigned char *to, int tlen,
int
RSA_padding_check_X931
(
unsigned
char
*
to
,
int
tlen
,
int
RSA_padding_check_X931
(
unsigned
char
*
to
,
int
tlen
,
const
unsigned
char
*
from
,
int
flen
,
int
num
)
const
unsigned
char
*
from
,
int
flen
,
int
num
)
{
{
int
i
,
j
;
int
i
=
0
,
j
;
const
unsigned
char
*
p
;
const
unsigned
char
*
p
;
p
=
from
;
p
=
from
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录