Transport
X25519
Implements X25519 key agreement from RFC 7748 §5 using BigInteger arithmetic.
generated from the sources
Static class in namespace
Nebula · Packages/com.1by3.nebula/Runtime/Transport/NebulaCrypto.cspublic static class X25519Implements X25519 key agreement from RFC 7748 §5 using BigInteger arithmetic. This managed implementation is not constant-time.
Fields
KeySize
public const int KeySize = 32;Methods
NewPrivateKey
public static byte[] NewPrivateKey();Generates a random 32-byte private scalar with the X25519 clamping rules applied.
PublicKey
public static byte[] PublicKey(byte[] privateKey);Agree
public static byte[] Agree(byte[] privateKey, byte[] peerPublicKey);Computes the shared secret from two 32-byte keys. Returns null when agreement produces an all-zero result.