Question

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?

Was it helpful?

Solution

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)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top