Correct method to generate a Curve25519 keypair

Alexander Lyon alyon.ipride at
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:

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

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.


> On 20 Jul 2018, at 20:49, Stef Bon <stefbon at> 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

More information about the Gcrypt-devel mailing list