1

I am currently making a script for digital signature algorithm until I met a stumbling block which with a lot of trial and errors, I still can't get through it.

There are 3 integers which is stored to p,q,h.

Using the above 3, I would like to do

 g = h(p-1/q) mod p

The number of things I tried in my .gp script:

 1. g = mod((h(p-1)/q),p);

 2. g = h((p-1)/q) mod p;

 3. temp = h(p-1/q);
    g = mod(temp,p);

They all can't work and have errors. Anyone can enlighten me on using PARI/GP?

John
  • 177
  • 1
  • 4
  • 19

1 Answers1

1

1. was almost correct: you're missing a multiplication sign *, and the function name is Mod, not mod.

Try

g = Mod(h*(p-1)/q, p)

K.B.
  • 861
  • 5
  • 14