Correct method to generate a Curve25519 keypair

Alexander Lyon alyon.ipride at gmail.com
Sat Jul 21 23:39:55 CEST 2018


I actually just stumbled across it in the tests after many many hours. If you look here:

https://github.com/gpg/libgcrypt/blob/master/tests/t-cv25519.c#L422

There is a call to test_dh which then calls test_cv with a_priv and b_pub

https://github.com/gpg/libgcrypt/blob/master/tests/t-cv25519.c#L363

Following that function you can see it parse the hex into binary, reverse the private key, and then create the appropriate s-expressions and finally pass them on to gcry_pk_encrypt before comparing that with the expected result hex string.

https://github.com/gpg/libgcrypt/blob/master/tests/t-cv25519.c#L191

Alex

> On 20 Jul 2018, at 20:49, Stef Bon <stefbon at gmail.com> wrote:
> 
> How did you find out you have to use gcry_pk_encrypt for getting the shared k?? I cannot find any doumentation about it and without your help
> I would still be searching.
> 
> Stef Bon
> the Netherlands/ Pays Bas
> _______________________________________________
> Gcrypt-devel mailing list
> Gcrypt-devel at gnupg.org
> http://lists.gnupg.org/mailman/listinfo/gcrypt-devel




More information about the Gcrypt-devel mailing list