Question about gmp...

David Cleaver wraithx at
Sun Jan 22 22:26:45 CET 2006

Hello everyone,

I have just begun learning gmp and was going to write my own program
involving the miller-rabin "primality" test, when I came across
mpz_probab_prime_p.  When I did a little more digging I saw that that
function made a call to mpz_millerrabin.  Once there I saw almost all
the code I needed to write my program.  But, here's where my questions
1)  I've read before that if the function isn't documented in the man
pages, I shouldn't use it if I want to keep forward compatibility.  So,
should most of the functionality in millerrabin.c not be duplicated for
fear of them being deprecated?
2)  I've seen references to mpz_srcptr and mpz_ptr in millerrabin.c. 
Are these ok to use or do they fall into the same category as up above?

The reason I'm asking is because I want to use my own set of bases when
doing these tests and I'd like to make sure the miller-rabin function is
performing as fast as possible.  Thanks in advance for any comments or
suggestions you may have.

-David C.

More information about the gmp-discuss mailing list