Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
3a12ce01
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,发现更多精彩内容 >>
提交
3a12ce01
编写于
3月 05, 2001
作者:
B
Bodo Möller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Some declarations that outline what I intend to implement.
上级
9bd35f63
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
116 addition
and
0 deletion
+116
-0
crypto/ec/ec.h
crypto/ec/ec.h
+52
-0
crypto/ec/ec_lcl.h
crypto/ec/ec_lcl.h
+64
-0
未找到文件。
crypto/ec/ec.h
浏览文件 @
3a12ce01
...
...
@@ -64,6 +64,58 @@ extern "C" {
#endif
typedef
enum
{
POINT_CONVERSION_COMPRESSED
=
2
,
POINT_CONVERSION_UNCOMPRESSED
=
4
,
POINT_CONVERSION_HYBRID
=
6
}
point_conversion_form_t
;
typedef
struct
ec_method_st
EC_METHOD
;
typedef
struct
ec_group_st
/*
EC_METHOD *meth;
-- field definition
-- curve coefficients
-- optional generator with associated information (order, cofactor)
-- optional Lim/Lee precomputation table
*/
EC_GROUP
;
typedef
struct
ec_point_st
EC_POINT
;
/* EC_METHODs for curves over GF(p).
* EC_GFp_simple_method provides the basis for the optimized methods.
*/
const
EC_METHOD
*
EC_GFp_simple_method
(
void
);
const
EC_METHOD
*
EC_GFp_mont_method
(
void
);
const
EC_METHOD
*
EC_GFp_recp_method
(
void
);
const
EC_METHOD
*
EC_GFp_nist_method
(
void
);
EC_GROUP
*
EC_GROUP_new
(
const
EC_METHOD
*
);
/* We don't have types for field specifications and field elements in general.
* Otherwise we would declare
* int EC_GROUP_set(EC_GROUP *, .....);
*/
int
EC_GROUP_set_GFp
(
EC_GROUP
*
,
const
BIGNUM
*
p
,
const
BIGNUM
*
a
,
const
BIGNUM
*
b
);
void
EC_GROUP_free
(
EC_GROUP
*
);
EC_POINT
*
EC_POINT_new
(
const
EC_GROUP
*
);
void
EC_POINT_free
(
EC_POINT
*
);
int
EC_POINT_add
(
const
EC_GROUP
*
,
EC_POINT
*
r
,
EC_POINT
*
a
,
EC_POINT
*
b
);
int
EC_POINT_dbl
(
const
EC_GROUP
*
,
EC_POINT
*
r
,
EC_POINT
*
a
);
size_t
EC_POINT_point2oct
(
const
EC_GROUP
*
,
EC_POINT
*
,
unsigned
char
*
buf
,
size_t
len
,
point_conversion_form_t
form
);
int
EC_POINT_oct2point
(
const
EC_GROUP
*
,
EC_POINT
*
,
unsigned
char
*
buf
,
size_t
len
);
/* TODO: scalar multiplication */
...
...
crypto/ec/ec_lcl.h
浏览文件 @
3a12ce01
...
...
@@ -54,4 +54,68 @@
*
*/
#include <stdlib.h>
#include <openssl/ec.h>
/* Structure details are not part of the exported interface,
* so all this may change in future versions. */
struct
ec_method_st
{
/* used by EC_GROUP_new, EC_GROUP_set_GFp, EC_GROUP_free: */
int
(
*
group_init
)(
EC_GROUP
*
);
/* int (*group_set)(EC_GROUP *, .....); */
int
(
*
group_set_GFp
)(
EC_GROUP
*
,
BIGNUM
*
p
,
BIGNUM
*
a
,
BIGNUM
*
b
);
void
(
*
group_finish
)(
EC_GROUP
*
);
/* used by EC_POINT_new, EC_POINT_free: */
int
(
*
point_init
)(
EC_POINT
*
);
void
(
*
point_finish
)(
EC_POINT
*
);
/* used by EC_POINT_add, EC_POINT_dbl: */
int
(
*
add
)(
const
EC_GROUP
*
,
EC_POINT
*
r
,
EC_POINT
*
a
,
EC_POINT
*
b
);
int
(
*
dbl
)(
const
EC_GROUP
*
,
EC_POINT
*
r
,
EC_POINT
*
a
);
/* used by EC_POINT_add, EC_POINT_dbl: */
size_t
(
*
point2oct
)(
const
EC_GROUP
*
,
EC_POINT
*
,
unsigned
char
*
buf
,
size_t
len
,
point_conversion_form_t
form
);
int
(
*
oct2point
)(
const
EC_GROUP
*
,
EC_POINT
*
,
unsigned
char
*
buf
,
size_t
len
);
/* internal functions */
/* 'field_mult' and 'field_sqr' can be used by 'add' and 'dbl' so that
* the same implementations of point operations can be used with different
* implementations of field operations: */
int
(
*
field_mult
)(
const
EC_GROUP
*
,
BIGNUM
*
r
,
BIGNUM
*
a
,
BIGNUM
*
b
);
int
(
*
field_sqr
)(
const
EC_GROUP
*
,
BIGNUM
*
r
,
BIGNUM
*
a
);
}
/* EC_METHOD */
;
struct
ec_group_st
{
EC_METHOD
*
meth
;
BIGNUM
field
;
/* Field specification.
* For curves over GF(p), this is the modulus. */
void
*
field_data
;
/* method-specific (e.g., Montgomery structure) */
BIGNUM
a
,
b
;
/* Curve coefficients.
* (Here the assumption is that BIGNUMs can be used
* or abused for all kinds of fields, not just GF(p).) */
int
a_is_minus3
;
/* enable optimized point arithmetics for special case */
/* TODO: optional generator with associated information (order, cofactor) */
/* optional Lim/Lee precomputation table */
}
/* EC_GROUP */
;
struct
ec_point_st
{
EC_METHOD
*
meth
;
BIGNUM
x
;
BIGNUM
y
;
BIGNUM
z
;
/* Jacobian projective coordinates */
int
z_is_one
;
/* enable optimized point arithmetics for special case */
}
/* EC_POINT */
;
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录