X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=crypto%2Fec%2Fec_cvt.c;h=45b0ec33a0ba370c3b732bd4c91d3ff185592c06;hb=7ae551fd03b447e41d3a74e803a711350383ebc4;hp=be06d3d92f9405f02a6c36431d59e40b13f60507;hpb=38e3c5815c142e905f0a023d86c066283889cf4a;p=oweals%2Fopenssl.git diff --git a/crypto/ec/ec_cvt.c b/crypto/ec/ec_cvt.c index be06d3d92f..45b0ec33a0 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) + */ + meth = EC_GFp_mont_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; + }