summaryrefslogtreecommitdiffstats
path: root/crypto/ec/ecp_mont.c
diff options
context:
space:
mode:
authorBodo Möller <bodo@openssl.org>2001-03-07 19:54:35 +0000
committerBodo Möller <bodo@openssl.org>2001-03-07 19:54:35 +0000
commit60428dbf0aa0dbacb2e18f7cf846af8d5ebafc82 (patch)
treeb3e3431d789223a55b90afab39d68c36f22b9772 /crypto/ec/ecp_mont.c
parent70d70a3c81c7affbda6b626ff49097aa1714298c (diff)
Some actual method functions (not enough yet to use the EC library, though),
including EC arithmetics derived from Lenka Fibikova's code (with some additional optimizations).
Diffstat (limited to 'crypto/ec/ecp_mont.c')
-rw-r--r--crypto/ec/ecp_mont.c47
1 files changed, 44 insertions, 3 deletions
diff --git a/crypto/ec/ecp_mont.c b/crypto/ec/ecp_mont.c
index 407175fd9a..04d21e5c40 100644
--- a/crypto/ec/ecp_mont.c
+++ b/crypto/ec/ecp_mont.c
@@ -1,4 +1,3 @@
-/* TODO */
/* crypto/ec/ecp_mont.c */
/* ====================================================================
* Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved.
@@ -64,7 +63,7 @@ const EC_METHOD *EC_GFp_mont_method(void)
ec_GFp_mont_group_set_curve_GFp,
ec_GFp_mont_group_finish,
ec_GFp_mont_group_clear_finish,
- ec_GFp_simple_group_copy,
+ ec_GFp_mont_group_copy,
ec_GFp_simple_group_set_generator,
/* TODO: 'set' and 'get' functions for EC_GROUPs */
ec_GFp_simple_point_init,
@@ -79,10 +78,52 @@ const EC_METHOD *EC_GFp_mont_method(void)
ec_GFp_simple_is_at_infinity,
ec_GFp_simple_is_on_curve,
ec_GFp_simple_make_affine,
- ec_GFp_mont_field_mult,
+ ec_GFp_mont_field_mul,
ec_GFp_mont_field_sqr,
ec_GFp_mont_field_encode,
ec_GFp_mont_field_decode };
return &ret;
}
+
+
+int ec_GFp_mont_group_init(EC_GROUP *group)
+ {
+ int ok;
+
+ ok = ec_GFp_simple_group_init(group);
+ group->field_data = NULL;
+ return ok;
+ }
+
+
+int ec_GFp_mont_group_set_curve_GFp(EC_GROUP *group, const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx);
+/* TODO */
+
+
+void ec_GFp_mont_group_finish(EC_GROUP *group);
+/* TODO */
+
+
+void ec_GFp_mont_group_clear_finish(EC_GROUP *group);
+/* TODO */
+
+
+int ec_GFp_mont_group_copy(EC_GROUP *dest, const EC_GROUP *src);
+/* TODO */
+
+
+int ec_GFp_mont_field_mul(const EC_GROUP *group, BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx);
+/* TODO */
+
+
+int ec_GFp_mont_field_sqr(const EC_GROUP *group, BIGNUM *r, const BIGNUM *a, BN_CTX *ctx);
+/* TODO */
+
+
+int ec_GFp_mont_field_encode(const EC_GROUP *group, BIGNUM *r, const BIGNUM *a, BN_CTX *ctx);
+/* TODO */
+
+
+int ec_GFp_mont_field_decode(const EC_GROUP *group, BIGNUM *r, const BIGNUM *a, BN_CTX *ctx);
+/* TODO */