Question: Don't get my Error... "Error, (in S4) the modular inverse does not exist"

Heyho,

I'm pretty new to Maple (started Monday). And I don't know how to solve (or even why it exists) the following error:

S3() generates two integers, one converted from a random 568-Bit-number "e" and one converted from a random 160-bit number "kp1", satisfying gcd(e,kp1)=1.
That works pretty fine so far.

 

Now I need two specific numbers, x and y defined by:

 

And I use the proc S4 to get them:

 

Sometimes, the error occurs "Error, (in S4) the modular inverse does not exist", and I dont get why,... I tried to fix it, with the "while"-loop, but it didnt work out yet.

Someone knows how to solve this problem?
Thanks!

 

Please Wait...