Karim Belabas on Sat, 02 Jan 2021 11:08:34 +0100


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: How to use a named elliptic curve?


* Jeffrey Walton [2021-01-02 05:58]:
> Hi Everyone,
> 
> I'm working through the elliptic curve tutorial at
> https://pari.math.u-bordeaux.fr/Events/PARI2017c/talks/ecc_en.pdf. I
> want to use a named curve, like secp256k1 or secp256r1. It does not
> appear to be covered in the tutorial.
> 
> Here are a couple attempts that don't work:
> 
> ? E=ellinit(secp256k1)
>   ***   at top-level: E=ellinit(secp256k1)
>   ***                   ^------------------
>   *** ellinit: incorrect type in ellxxx [not an elliptic curve (ell5)] (t_POL).
>   ***   Break loop: type 'break' to go back to GP prompt
> 
> ? E=ellinit("secp256k1")
>   ***   at top-level: E=ellinit("secp256k1")
>   ***                   ^--------------------
>   *** ellinit: incorrect type in ellsearch (t_STR).
>   ***   Break loop: type 'break' to go back to GP prompt
> 
> How do I create a named curve?

The named curves mechanism only supports Cremona labels at this point
(for curves over Q sorted by conductor provided by the Cremona database,
which we repackage as 'elldata'); with the second syntax as in

  E = ellinit("36a1");

None of the crypto curves names (SEC2, FIPS 186-4, RFC3279, etc.) are
currently supported by this mechanism. It's an interesting option,
though, that would not be hard to support: Crenoma labels start by a
digit, all crypto curves names I am aware of start by a letter...

What names would we need to support ?
  - [PKR]-* from FIPS
  - sec* from SEC2
  - prime* from RFC

Any others ?

Cheers,

    K.B.
--
Karim Belabas, IMB (UMR 5251)  Tel: (+33) (0)5 40 00 26 17
Universite de Bordeaux         Fax: (+33) (0)5 40 00 21 23
351, cours de la Liberation    http://www.math.u-bordeaux.fr/~kbelabas/
F-33405 Talence (France)       http://pari.math.u-bordeaux.fr/  [PARI/GP]
`