[Ecm-dev] Proposal from George. Literally.

Alexander Kruppa alexander.kruppa at mytum.de
Sam 7 Mai 18:31:56 CEST 2005

George Woltman wrote:
> At 05:27 PM 5/6/2005, Alexander Kruppa wrote:

> The interface would be cleaner if you always passed A and starting x 

No problem. That's what we do in GMP-ECM, convert sigma->A in ecm(), 
then call ecm_stage1().

Should we do the normalization of Z to 1 in GMP as well? That way your 
stage 1 code would never have to deal with any factors found.

> (already multiplied by go_array)

Ok. The go value will usually be small, so performance should not be 

> However, if this information is not handy at the time you 
> would be calling
> this routine, then we can go with the more complicated interface above.  
> I'm a little
> confused when sigma_is_A != 0 -- where do I read A from?  Is it the 
> 32-bit value in sigma_or_A?

Sorry, ulong *sigma_or_A was meant to be ulong *sigma_or_A_array, with 
the associated ulong sigma_or_A_arraylen.

>> For the return codes, I'd suggest
>> 0 = success, but no factor
>> 1 = factor found (during sigma->A conversion or normalization)
>> 2 = could not handle this k,b,n,c combination
>> 3 = out_of_memory
> and
> 4 = stopping at user request.  B1done is returned.  X is returned for 
> caller to write to a
> save file.  How do I detect this user request?  Do you have a signal 
> handler that
> sets some global variable for me to check periodically?
> Regards,
> George

We could provide a stop_check() function you can call, or maybe better a 
function pointer we could pass to your code, NULL for no stop checking. 
Btw, didn't you have a function to register a stop check function? We 
could use that. Btw2, GMP-ECM does not trap signals yet, but might in 
the future.

When stage 1 is interrupted and later resumed, some more small primes 
will be added, resulting in a different x after the complete stage 1 is 
done. This is not a problem as far as finding factors goes, but might be 
if people want to verify samples of end-of-stage 1 residues i.e. to 
check that people really did the number of curves they said they did. 
This is a minor issue.

About licensing: if we include your code in the GMP-ECM distribution, 
we'll have to publish it under the GPL. The alternative is to have your 
code as a separate library that gets linked in if the user said so at 
./configure time. This however would mean that the resulting binary 
could not be distributed to others.


Plus d'informations sur la liste de diffusion Ecm-discuss