<PackageReference Include="BouncyCastle.Cryptography" Version="2.8.0-beta.349" />

Org.BouncyCastle.Crypto.Agreement.X25519Agreement

public sealed class X25519Agreement : IRawAgreement
X25519 (RFC 7748) Diffie-Hellman raw agreement. Init takes the local X25519PrivateKeyParameters; CalculateAgreement writes the 32-byte shared secret derived against the peer's X25519PublicKeyParameters.
namespace Org.BouncyCastle.Crypto.Agreement { public sealed class X25519Agreement : IRawAgreement { public int AgreementSize { get; } public void Init(ICipherParameters parameters); public void CalculateAgreement(ICipherParameters publicKey, byte[] buf, int off); public void CalculateAgreement(ICipherParameters publicKey, Span<byte> buf); public X25519Agreement(); } }