aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/ec/ec_cvt.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/ec/ec_cvt.c')
-rw-r--r--crypto/ec/ec_cvt.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/crypto/ec/ec_cvt.c b/crypto/ec/ec_cvt.c
index be06d3d92f..361dcc3992 100644
--- a/crypto/ec/ec_cvt.c
+++ b/crypto/ec/ec_cvt.c
@@ -1,4 +1,3 @@
-/* TODO */
/* crypto/ec/ec_cvt.c */
/* ====================================================================
* Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved.
@@ -55,3 +54,27 @@
*/
#include "ec_lcl.h"
+
+
+EC_GROUP *EC_GROUP_new_curve_GFp(const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx)
+ {
+ const EC_METHOD *meth;
+ EC_GROUP *ret;
+
+ /* Finally, this will use EC_GFp_nist_method if 'p' is a special
+ * prime with optimized modular arithmetics (for NIST curves)
+ * and EC_GFp_mont_method or EC_GFp_recp_method otherwise. */
+ meth = EC_GFp_simple_method();
+
+ ret = EC_GROUP_new(meth);
+ if (ret == NULL)
+ return NULL;
+
+ if (!EC_GROUP_set_curve_GFp(ret, p, a, b, ctx))
+ {
+ EC_GROUP_clear_free(ret);
+ return NULL;
+ }
+
+ return ret;
+ }