Advanced _ED25519 to Curve25519 - Chewhern/ASodium GitHub Wiki

For detailed documentation, kindly refer to official libsodium.

Generally, you will need to avoid using the key material used in digital signature private key as a private key used in diffie hellman private key.

However, if you can't afford to do that, libsodium got you covered.

Converting DSA cryptography key material to DH cryptography key material

Initial Functions

public static Byte[] ConvertDSAPKToDHPK(Byte[] ED25519PK) 
public static Byte[] ConvertDSASKToDHSK(Byte[] ED25519SK,Boolean ClearKey=false)

Example Code (Converting DSA private key to DH private key)

RevampedKeyPair MyKeyPair = SodiumPublicKeyAuth.GenerateRevampedKeyPair();
Byte[] X25519SK = SodiumConvertDSAToDH.ConvertDSASKToDHSK(MyKeyPair.PrivateKey);

Example code (Converting DSA public key to DH public key)

RevampedKeyPair MyKeyPair = SodiumPublicKeyAuth.GenerateRevampedKeyPair();
Byte[] X25519PK = SodiumConvertDSAToDH.ConvertDSAPKToDHPK(MyKeyPair.PublicKey);