On 14 December 2012 12:37, jeetendra gangele <gangele...@gmail.com> wrote:

> I got these parameters from marlin and I wanted to load these parameter.
> Its must for me to load these parameters.
>
> I am not familiar with what marlin is, so I cannot advise on that. I would
double check that the parameters do not correspond to a standard curve.
Have a look in src/crypto/ec/ec_curve.c in the openssl source code. Check
to see if your "p" value is present in the built in data structures
somewhere.

If not you will have to do it by creating the curve yourself as per my
previous post. Assuming you have a Fp curve, then you will need to know p,
a, b, generator (x and y co-ords), order and co-factor. You can then do
something like:

        if ((group = EC_GROUP_new_curve_GFp(p, a, b, ctx)) == NULL) goto
err;
        if ((gen = EC_POINT_new(group)) == NULL) goto err;
        if (!EC_POINT_set_affine_coordinates_GFp(group, gen, x, y, ctx))
goto err;
        if (!EC_GROUP_set_generator(group, gen, order, cofactor)) goto err;

If you have an F2m curve then the parameters are the same except you need
to know m instead of p (the code is similar but replace GFp with GF2m).
Confusingly though the Openssl codebase refers to p for F2m curves to mean
p = 2^m. If you're not sure which one you've got, then if p is odd then its
probably an Fp curve, whilst if its even its probably F2m.

Matt

Reply via email to