Info for using 32-bit source

Source code version 1.1.1 is in ecdl2K-108.32bit.c.

> ecdl2K-108.32bit.c
Purpose: Fast arithmetic for computing discrete logs on elliptic curves.
Copyright: Robert J. Harley, 1997-1999.
Legalese: This source code is subject to the GNU General Public Licence v2.

This is Rob's 32-bit ECDL program for Unix, version 1.1.1.

Consult the following URL for more information:


Do this:

cc -O3 ecdl2K-108.32bit.c -o ecdl.exe
echo Machine name is `hostname`
mkdir `hostname`
cd `hostname`
nice ../ecdl.exe mail by my@email.address on `hostname` > ecdl.log &

Then go sign up, using the exact same email address, at this form:

Detailed instructions

1. Signing up

Go to this form to sign up:

Give your email address (or at least something that identifies you uniquely) and a passphrase you just invented. Keep a safe copy of the passphrase!

Note: If you prefer to stay anonymous and not sign up, that's fine.

2. Compiling

Compile with something like:

cc -O3 ecdl2K-108.32bit.c -o ecdl.exe

You can test the binary like this:

./ecdl.exe test by me@here on bla

The test output should match this sample except for the reported times and rates:

> ./ecdl.exe test by me@here on bla
This is Rob's ECDL program for Unix32, version 1.1.1 MMX
Mode ...... test
Email ..... me@here
Machine ... bla
Starting at Thu Feb 17 14:27:27 2000
Generating 32 new starting points.
Computing iterations...

Test point found at: Thu Feb 17 14:27:31 2000
TEST-L0|Unix32|1.1.1 MMX|
Iterations used = 18567.
Total iterations = 594144.
Rate = 160579 per second.

Test point found at: Thu Feb 17 14:27:50 2000
TEST-L0|Unix32|1.1.1 MMX|
Iterations used = 113354.
Total iterations = 3.62733e+06.
Rate = 159443 per second.

Test point found at: Thu Feb 17 14:27:57 2000
TEST-L0|Unix32|1.1.1 MMX|
Iterations used = 146537.
Total iterations = 4.68918e+06.
Rate = 158472 per second.

[...and so on...]

If the program complains that it cannot find sendmail, you can compile with -DSENDMAIL='"/usr/sbin/sendmail"' or something similar.

3. Optimising

You can compile with various optimisation flags to maximise speed before starting on the real calculations. Speeds to aim for are roughly 160 k iterations per second for a 500 MHz x86 (85 k without MMX), 100 k for a 450 MHz PowerPC G3 and 43 k for a 275 MHz StrongARM.

Good flags to use with gcc are:

-fomit-frame-pointer -funroll-loops -fexpensive-optimizations

You might also consider specifying -march=pentiumpro or similar.

If you have a chip with MMX instructions, definitely use -DMMX as the program will run about twice as fast! (Compiling the MMX version requires a recent version of gcc). For non-MMX chips, try adding -DPROD=2 (or 3, 4 or 5) to the compilation flags to use a different implementation of speed critical functions. It might be a little faster; then again, maybe not!

You can also try tweaking the value of PARAL. Just add -DPARAL=40, for instance. The default is 32 and useful values are roughly in the range 20 to 50. Note that the test output will no longer exactly match the sample given above.

4. Starting up

When you're ready to start up: on each machine you want to run on make a directory for that machine, cd into it and go.

echo Machine name is `hostname`
mkdir `hostname`
cd `hostname`
unlimit cputime || (echo Using ulimit instead; ulimit -t unlimited)
nice +15 ../ecdl.exe [...arguments, see below...] > ecdl.log &

Note: Some shells need nice -15 instead.
Note: You can keep an eye on the output using tail -f ecdl.log.
Note: If you have a machine with several CPUs, make a directory for each CPU and start up an ecdl process in each one.

The arguments have the following syntax:

ecdl <mode> by <email> on <machine>

<mode>: Either test, batch, mail, alt or http.
<email>: Something to identify you uniquely e.g., your email address.
<machine>: The machine name e.g., as given by hostname.

Note: For <email> give the exact same string you used when signing up, since otherwise the Web pages will not be able to show correct statistics for your contribution.


ecdl mail by on avalon
ecdl http by on acid
ecdl batch by anonymous on 'Mystery machine'

Test mode quickly produces some (useless) test output to stdout along with info on iterations per second. This allows you to check that your binary is OK, to compare compiler optimisation flags etc.

The other modes produce things called "distinguished points" every few hours. Each distinguished point looks something like this:

Distinguished point found at: Wed Nov 24 03:52:02 1999

These points are valuable! The ECDL project needs to collect roughly 1.3 million of them to solve Certicom's ECC2K-108 problem. The points are always appended to a file called dist.points and also written to stdout along with some verbose info.

When running in mail mode each point is automatically emailed (using sendmail) to as well. INRIA's excessively aggressive spam filters might refuse the email; in that case switch to alt mode which sends to instead.

When running in http mode each point is automatically sent (using the HTTP POST protocol) to the Web server on If your machine is behind a firewall, you'll need to specify a Web proxy to use for sending the points via HTTP. Specify it on the command line as follows:

ecdl http by <email> on <machine> proxy <proxy-host>:<proxy-port>

where <proxy-host> is the host name of the proxy, e.g., and <proxy-port> is the port number of the HTTP proxy on this host, e.g. 3128. Note that this does not work with firewalls using the SOCKS protocol.

For machines unable to send email or make HTTP connections, for instance not permanently connected to the Net, use batch mode. Then every few days do:

mv dist.points dist.points.nov.25

or similar using the correct date, and email the dist.points.nov.25 file manually. When the next distinguished point is found, a new dist.points file will be created for it and further points will be appended to this new file until the next time you mv it.

Writes info on stdoutxxxxx
Writes points to dist.points-xxxx
Sends points via sendmail--xx-
Sends points via http----x

5. Shutting down (and saved states)

When the program is running it saves its internal state in a file called saved.state from time to time. If you want to stop the program, send it a SIGINT or SIGTERM signal so it can save its state before exiting. If it is running in the foreground, you can send SIGINT by typing Ctrl-C. If it is running in the background send SIGTERM by killall ecdl.exe. If you don't have killall installed, find the PID (first column of the ps output) and use kill:

ps x | grep ecdl | grep -v grep
kill <the PID>

When you restart in the same directory:

nice +15 ../ecdl.exe [...arguments...] >> ecdl.log &

the program will look for the saved state file. If no saved state is found it will generate a new state and work from there. If one is found, the program reads it and continues where it left off. Note that it would be wasteful to use a given saved state on more than one CPU because work would just be duplicated.

The reason each machine should have its own directory is to avoid the dist.points and saved.state files getting mixed up! Note that test mode does not mess with these files.