Elgamal implementation problems

Angelo Nicolosi amenuor at hotmail.com
Sun May 1 15:41:11 CEST 2011


Hello again,Andrew thank you very much for your answer.The problem was somewhere else, but I actually appreciate your help.
To the other guy, I am sorry if my message disturbed you so much, but instead of writing useless commentsit is generally good practice to address on the right direction people that knows less than you on some topic.
Moreover,  I actually am more interested in getting some comments on the code I wrote (as I stated at the end of the message).There are some books, papers, websites I can have a look at about using gmp for cryptography?Thank you again for your help.Angelo.

> To: andrew_mattingly at au1.ibm.com
> Subject: Re: Elgamal implementation problems
> From: tg at gmplib.org
> Date: Sun, 1 May 2011 13:31:46 +0200
> CC: gmp-discuss at gmplib.org
> 
> Andrew Mattingly <andrew_mattingly at au1.ibm.com> writes:
> 
>   I can see two problems with your eg_encryption routine (eg_decryption has 
>   no problems):
>   
>   1.  you should be computing c2 = h^k * M mod p, not c2 = h^k * g^M mod p
>   
>   2.  even if you disagree with point 1, you should take a modulus after the 
>   final multiplication,
>   
>   ie. after:
>   
>     mpz_mul(cipherText->c2, tmp2, tmp);
>   
>   do
>   
>     mpz_mod(cipherText->c2, cipherText->c2, publicKey->p);
>   
>   Hope this helps.
>   
> It is generally a disservice to the society to do student's homework for
> them.
> 
> Also, please do not use the GMP mailing list for such "help".
> 
> -- 
> Torbjörn
> _______________________________________________
> gmp-discuss mailing list
> gmp-discuss at gmplib.org
> https://gmplib.org/mailman/listinfo/gmp-discuss
 		 	   		  


More information about the gmp-discuss mailing list