Package: PARI

Hi

I'm experiencing a memory issue where allocating enough memory causes Pari to fail. Im trying to run a python script designed to generate a cryptographic eliptic curve based on a paper.

https://cryptoexperts.github.io/million-dollar-curve/

The original autorss of the paper use the scripts to generate a 256 bit curve, and allocate 100megs of ram to do so. I however for complicated need reasons a 992bit curve. All scripts found above are based on PARI can handle variable bit length, but step 4 fails due to running out of memory in sea_weierstrass. We modified the script to insted use a gigabyte of memory, but then we get a new error:

*** error opening seadata file: `/opt/local/share/pari/seadata/sea503'.
*** Error in the PARI system. End of program.

As a progammer i muse appologize if this isnt the best bug rapport, but i myself dont know python. Ive been in contact with the developers of the scripts, and you can see the latest mai from them below. Please mail me and let me know if this is solvable. I only need to make it run once.

Regards

Eskil Steenberg

---------- Original message ----------
From: Thomas Baigneres <thomas.baigneres@cryptoexperts.com>
Date: 25 april 2016 01:24:59 +02:00
Subject Re: 992 bits
To: eskil@quelsolaar.com

Hello Eskil,

I have been trying to run the scripts with a 992 prime size. The third script ran without any issue. This is the line :

# python3 03_generate_prime_field_using_bbs.py in_03.json in_04.json 992

I used the in_03.json that you can find on the Million Dollar Curve website. The in_04.json file I obtained is in attachment. I guess you already managed to obtain this file.


The next step is to generate the curve. To do so, you should run

# python3 04_generate_curve_using_bbs.py in_04.json out.json —fast

At this point, I get the same memory issue than you (while checking candidate number 3). It seems that the routine causing this failure is sea_weierstrass in the file subroutines.py. I tried to allocate more memory for PARI by changing the line 67 of the file

pari_light_interface.pari_init(100000000, 0)

by

pari_light_interface.pari_init(1000000000, 0)

This allocates 1000000000 bytes = 1 GB of memory (instead of 100 MB). But then, I ran into another issue:


*** error opening seadata file: `/opt/local/share/pari/seadata/sea503'.
*** Error in the PARI system. End of program.

Indeed, this sea503 file is not part of the seadata directory. This file is required to count the number of points on the elliptic curve.

At this point, I am afraid there is not much I can do. Counting points on a curve is done by means of the Schoof–Elkies–Atkin algorithm, as implemented in PARI. It seems that you are pushing the implementation outside its limits ;-)

You could try to contact the maintainers of the PARI library to tell them about your issue. They may be able to help you, e.g., by telling you how to compute the seaXXX files yourself (?).

Please let me know if you managed to make it work. All I can say is that it seems hopeless to try to run the scripts on any architecture until you find a way to get the missing sea files.

I wish you luck

Thomas