Tracing through the execution znlog does

h = Rg_to_Fp(Mod(148670581, 268890659), 10);

(forgive my conflation of C and GP for the moment) which sets h = 0 and hence

p_log(0, Mod(10, 268890659), 268890658, 10)

is undefined. But really the Rg_to_Fp call is invalid since 10 does not divide 268890659.

I don't have a good idea of what the code is supposed to be doing at this point...

Charles Greathouse
Analyst/Programmer
Case Western Reserve University