aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/ec/ec_lib.c
diff options
context:
space:
mode:
authorBodo Möller <bodo@openssl.org>2001-03-08 19:14:52 +0000
committerBodo Möller <bodo@openssl.org>2001-03-08 19:14:52 +0000
commitbb62a8b0c57c88ec189389f07250dee9c87d0681 (patch)
tree55b32ba2164438036f69e023274d2becfb0da32a /crypto/ec/ec_lib.c
parenta75d8bebd24f1a0f5560131a2c9c49b65a8a4e94 (diff)
downloadopenssl-bb62a8b0c57c88ec189389f07250dee9c87d0681.tar.gz
More method functions for elliptic curves,
and an ectest.c that actually tests something.
Diffstat (limited to 'crypto/ec/ec_lib.c')
-rw-r--r--crypto/ec/ec_lib.c39
1 files changed, 25 insertions, 14 deletions
diff --git a/crypto/ec/ec_lib.c b/crypto/ec/ec_lib.c
index bef62961e1..6aaacb343f 100644
--- a/crypto/ec/ec_lib.c
+++ b/crypto/ec/ec_lib.c
@@ -56,9 +56,12 @@
#include <string.h>
#include <openssl/err.h>
+#include <openssl/opensslv.h>
#include "ec_lcl.h"
+static const char EC_version[] = "EC" OPENSSL_VERSION_PTEXT;
+
/* functions for EC_GROUP objects */
@@ -101,17 +104,6 @@ EC_GROUP *EC_GROUP_new(const EC_METHOD *meth)
}
-int EC_GROUP_set_curve_GFp(EC_GROUP *group, const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx)
- {
- if (group->meth->group_set_curve_GFp == 0)
- {
- ECerr(EC_F_EC_GROUP_SET_CURVE_GFP, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
- return 0;
- }
- return group->meth->group_set_curve_GFp(group, p, a, b, ctx);
- }
-
-
void EC_GROUP_free(EC_GROUP *group)
{
if (group->meth->group_finish != 0)
@@ -171,6 +163,28 @@ int EC_GROUP_copy(EC_GROUP *dest, const EC_GROUP *src)
}
+int EC_GROUP_set_curve_GFp(EC_GROUP *group, const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx)
+ {
+ if (group->meth->group_set_curve_GFp == 0)
+ {
+ ECerr(EC_F_EC_GROUP_SET_CURVE_GFP, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
+ return 0;
+ }
+ return group->meth->group_set_curve_GFp(group, p, a, b, ctx);
+ }
+
+
+int EC_GROUP_get_curve_GFp(EC_GROUP *group, BIGNUM *p, BIGNUM *a, BIGNUM *b, BN_CTX *ctx)
+ {
+ if (group->meth->group_get_curve_GFp == 0)
+ {
+ ECerr(EC_F_EC_GROUP_GET_CURVE_GFP, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
+ return 0;
+ }
+ return group->meth->group_get_curve_GFp(group, p, a, b, ctx);
+ }
+
+
int EC_GROUP_set_generator(EC_GROUP *group, const EC_POINT *generator, const BIGNUM *order, const BIGNUM *cofactor)
{
if (group->meth->group_set_generator == 0)
@@ -182,9 +196,6 @@ int EC_GROUP_set_generator(EC_GROUP *group, const EC_POINT *generator, const BIG
}
-/* TODO: 'set' and 'get' functions for EC_GROUPs */
-
-
/* this has 'package' visibility */
int EC_GROUP_set_extra_data(EC_GROUP *group, void *extra_data, void *(*extra_data_dup_func)(void *),
void (*extra_data_free_func)(void *), void (*extra_data_clear_free_func)(void *))