Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
4a47f556
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,发现更多精彩内容 >>
提交
4a47f556
编写于
12月 16, 2005
作者:
A
Andy Polyakov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Eliminate warning induced by
http://cvs.openssl.org/chngview?cn=14690
and
keep disclaiming narrower than 32-bit support.
上级
b884556e
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
13 addition
and
124 deletion
+13
-124
crypto/bn/bn.h
crypto/bn/bn.h
+11
-55
crypto/bn/bn_gf2m.c
crypto/bn/bn_gf2m.c
+0
-62
crypto/bn/bn_lib.c
crypto/bn/bn_lib.c
+1
-1
crypto/bn/bntest.c
crypto/bn/bntest.c
+1
-1
crypto/opensslconf.h.in
crypto/opensslconf.h.in
+0
-5
未找到文件。
crypto/bn/bn.h
浏览文件 @
4a47f556
...
...
@@ -139,6 +139,8 @@ extern "C" {
#define BN_DEC_FMT1 "%lu"
#define BN_DEC_FMT2 "%019lu"
#define BN_DEC_NUM 19
#define BN_HEX_FMT1 "%lX"
#define BN_HEX_FMT2 "%08lX"
#endif
/* This is where the long long data type is 64 bits, but long is 32.
...
...
@@ -164,14 +166,18 @@ extern "C" {
#define BN_DEC_FMT1 "%llu"
#define BN_DEC_FMT2 "%019llu"
#define BN_DEC_NUM 19
#define BN_HEX_FMT1 "%llX"
#define BN_HEX_FMT2 "%08llX"
#endif
#ifdef THIRTY_TWO_BIT
#ifdef BN_LLONG
# if defined(
OPENSSL_SYS
_WIN32) && !defined(__GNUC__)
# if defined(_WIN32) && !defined(__GNUC__)
# define BN_ULLONG unsigned __int64
# define BN_MASK (0xffffffffffffffffI64)
# else
# define BN_ULLONG unsigned long long
# define BN_MASK (0xffffffffffffffffLL)
# endif
#endif
#define BN_ULONG unsigned int
...
...
@@ -180,67 +186,17 @@ extern "C" {
#define BN_BYTES 4
#define BN_BITS2 32
#define BN_BITS4 16
#ifdef OPENSSL_SYS_WIN32
/* VC++ doesn't like the LL suffix */
#define BN_MASK (0xffffffffffffffffL)
#else
#define BN_MASK (0xffffffffffffffffLL)
#endif
#define BN_MASK2 (0xffffffffL)
#define BN_MASK2l (0xffff)
#define BN_MASK2h1 (0xffff8000L)
#define BN_MASK2h (0xffff0000L)
#define BN_TBIT (0x80000000L)
#define BN_DEC_CONV (1000000000L)
#define BN_DEC_FMT1 "%lu"
#define BN_DEC_FMT2 "%09lu"
#define BN_DEC_NUM 9
#endif
#ifdef SIXTEEN_BIT
#ifndef BN_DIV2W
#define BN_DIV2W
#endif
#define BN_ULLONG unsigned long
#define BN_ULONG unsigned short
#define BN_LONG short
#define BN_BITS 32
#define BN_BYTES 2
#define BN_BITS2 16
#define BN_BITS4 8
#define BN_MASK (0xffffffff)
#define BN_MASK2 (0xffff)
#define BN_MASK2l (0xff)
#define BN_MASK2h1 (0xff80)
#define BN_MASK2h (0xff00)
#define BN_TBIT (0x8000)
#define BN_DEC_CONV (100000)
#define BN_DEC_FMT1 "%u"
#define BN_DEC_FMT2 "%05u"
#define BN_DEC_NUM 5
#endif
#ifdef EIGHT_BIT
#ifndef BN_DIV2W
#define BN_DIV2W
#endif
#define BN_ULLONG unsigned short
#define BN_ULONG unsigned char
#define BN_LONG char
#define BN_BITS 16
#define BN_BYTES 1
#define BN_BITS2 8
#define BN_BITS4 4
#define BN_MASK (0xffff)
#define BN_MASK2 (0xff)
#define BN_MASK2l (0xf)
#define BN_MASK2h1 (0xf8)
#define BN_MASK2h (0xf0)
#define BN_TBIT (0x80)
#define BN_DEC_CONV (100)
#define BN_DEC_FMT1 "%u"
#define BN_DEC_FMT2 "%02u"
#define BN_DEC_NUM 2
#define BN_DEC_FMT2 "%09u"
#define BN_DEC_NUM 9
#define BN_HEX_FMT1 "%X"
#define BN_HEX_FMT2 "%04X"
#endif
#define BN_DEFAULT_BITS 1280
...
...
crypto/bn/bn_gf2m.c
浏览文件 @
4a47f556
...
...
@@ -121,74 +121,12 @@ static const BN_ULONG SQR_tb[16] =
SQR_tb[(w) >> 12 & 0xF] << 24 | SQR_tb[(w) >> 8 & 0xF] << 16 | \
SQR_tb[(w) >> 4 & 0xF] << 8 | SQR_tb[(w) & 0xF]
#endif
#ifdef SIXTEEN_BIT
#define SQR1(w) \
SQR_tb[(w) >> 12 & 0xF] << 8 | SQR_tb[(w) >> 8 & 0xF]
#define SQR0(w) \
SQR_tb[(w) >> 4 & 0xF] << 8 | SQR_tb[(w) & 0xF]
#endif
#ifdef EIGHT_BIT
#define SQR1(w) \
SQR_tb[(w) >> 4 & 0xF]
#define SQR0(w) \
SQR_tb[(w) & 15]
#endif
/* Product of two polynomials a, b each with degree < BN_BITS2 - 1,
* result is a polynomial r with degree < 2 * BN_BITS - 1
* The caller MUST ensure that the variables have the right amount
* of space allocated.
*/
#ifdef EIGHT_BIT
static
void
bn_GF2m_mul_1x1
(
BN_ULONG
*
r1
,
BN_ULONG
*
r0
,
const
BN_ULONG
a
,
const
BN_ULONG
b
)
{
register
BN_ULONG
h
,
l
,
s
;
BN_ULONG
tab
[
4
],
top1b
=
a
>>
7
;
register
BN_ULONG
a1
,
a2
;
a1
=
a
&
(
0x7F
);
a2
=
a1
<<
1
;
tab
[
0
]
=
0
;
tab
[
1
]
=
a1
;
tab
[
2
]
=
a2
;
tab
[
3
]
=
a1
^
a2
;
s
=
tab
[
b
&
0x3
];
l
=
s
;
s
=
tab
[
b
>>
2
&
0x3
];
l
^=
s
<<
2
;
h
=
s
>>
6
;
s
=
tab
[
b
>>
4
&
0x3
];
l
^=
s
<<
4
;
h
^=
s
>>
4
;
s
=
tab
[
b
>>
6
];
l
^=
s
<<
6
;
h
^=
s
>>
2
;
/* compensate for the top bit of a */
if
(
top1b
&
01
)
{
l
^=
b
<<
7
;
h
^=
b
>>
1
;
}
*
r1
=
h
;
*
r0
=
l
;
}
#endif
#ifdef SIXTEEN_BIT
static
void
bn_GF2m_mul_1x1
(
BN_ULONG
*
r1
,
BN_ULONG
*
r0
,
const
BN_ULONG
a
,
const
BN_ULONG
b
)
{
register
BN_ULONG
h
,
l
,
s
;
BN_ULONG
tab
[
4
],
top1b
=
a
>>
15
;
register
BN_ULONG
a1
,
a2
;
a1
=
a
&
(
0x7FFF
);
a2
=
a1
<<
1
;
tab
[
0
]
=
0
;
tab
[
1
]
=
a1
;
tab
[
2
]
=
a2
;
tab
[
3
]
=
a1
^
a2
;
s
=
tab
[
b
&
0x3
];
l
=
s
;
s
=
tab
[
b
>>
2
&
0x3
];
l
^=
s
<<
2
;
h
=
s
>>
14
;
s
=
tab
[
b
>>
4
&
0x3
];
l
^=
s
<<
4
;
h
^=
s
>>
12
;
s
=
tab
[
b
>>
6
&
0x3
];
l
^=
s
<<
6
;
h
^=
s
>>
10
;
s
=
tab
[
b
>>
8
&
0x3
];
l
^=
s
<<
8
;
h
^=
s
>>
8
;
s
=
tab
[
b
>>
10
&
0x3
];
l
^=
s
<<
10
;
h
^=
s
>>
6
;
s
=
tab
[
b
>>
12
&
0x3
];
l
^=
s
<<
12
;
h
^=
s
>>
4
;
s
=
tab
[
b
>>
14
];
l
^=
s
<<
14
;
h
^=
s
>>
2
;
/* compensate for the top bit of a */
if
(
top1b
&
01
)
{
l
^=
b
<<
15
;
h
^=
b
>>
1
;
}
*
r1
=
h
;
*
r0
=
l
;
}
#endif
#ifdef THIRTY_TWO_BIT
static
void
bn_GF2m_mul_1x1
(
BN_ULONG
*
r1
,
BN_ULONG
*
r0
,
const
BN_ULONG
a
,
const
BN_ULONG
b
)
{
...
...
crypto/bn/bn_lib.c
浏览文件 @
4a47f556
...
...
@@ -235,7 +235,7 @@ int BN_num_bits_word(BN_ULONG l)
else
#endif
{
#if defined(
SIXTEEN_BIT) || defined(
THIRTY_TWO_BIT) || defined(SIXTY_FOUR_BIT) || defined(SIXTY_FOUR_BIT_LONG)
#if defined(THIRTY_TWO_BIT) || defined(SIXTY_FOUR_BIT) || defined(SIXTY_FOUR_BIT_LONG)
if
(
l
&
0xff00L
)
return
(
bits
[(
int
)(
l
>>
8
)]
+
8
);
else
...
...
crypto/bn/bntest.c
浏览文件 @
4a47f556
...
...
@@ -486,7 +486,7 @@ static void print_word(BIO *bp,BN_ULONG w)
return
;
}
#endif
BIO_printf
(
bp
,
"%lX"
,
w
);
BIO_printf
(
bp
,
BN_HEX_FMT1
,
w
);
}
int
test_div_word
(
BIO
*
bp
)
...
...
crypto/opensslconf.h.in
浏览文件 @
4a47f556
...
...
@@ -63,14 +63,9 @@
/* Should we define BN_DIV2W here? */
/* Only one for the following should be defined */
/* The prime number generation stuff may not work when
* EIGHT_BIT but I don't care since I've only used this mode
* for debuging the bignum libraries */
#undef SIXTY_FOUR_BIT_LONG
#undef SIXTY_FOUR_BIT
#define THIRTY_TWO_BIT
#undef SIXTEEN_BIT
#undef EIGHT_BIT
#endif
#if defined(HEADER_RC4_LOCL_H) && !defined(CONFIG_HEADER_RC4_LOCL_H)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录