Loïc Grenié on Fri, 21 Apr 2017 09:40:59 +0200


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: Function to calculate the power of a number in a finite group Zn




2017-04-21 0:49 GMT+02:00 Sally Andria <sally.andrya@gmail.com>:
I'm working with criptography, u
I choose a prime 

?     isprime(37462350986754834657874659823456747);
%1  = 0
?     nextprime(37462350986754834657874659823456747);
%2  37462350986754834657874659823456849
?     isprime(37462350986754834657874659823456849);
%3  = 1

So I find a generator and your order

?     znprimroot(37462350986754834657874659823456849);
%5  Mod(17, 37462350986754834657874659823456849)
?     g = Mod(17, 37462350986754834657874659823456849);
%6  Mod(17, 37462350986754834657874659823456849)
?     znorder(g);
%7 37462350986754834657874659823456848

So I have a group Zp (p=37462350986754834657874659823456849) 
and a generator g= Mod(17, 37462350986754834657874659823456849)
But I want to calculate g elevated to the number e= 5466093453756547, but I didn't finde the function to calculate this.


g^e
Mod(17, 37462350986754834657874659823456849)^5466093453756547

    should work.

           Loïc