Table of Contents

Interface IEcdh

Namespace
NLightning.Infrastructure.Crypto.Interfaces
Assembly
NLightning.Infrastructure.dll

Interface for the Eliptic-Curve Diffie-Hellman key exchange.

public interface IEcdh

Methods

GenerateKeyPair()

Generates a new Diffie-Hellman key pair.

CryptoKeyPair GenerateKeyPair()

Returns

CryptoKeyPair

GenerateKeyPair(ReadOnlySpan<byte>)

Generates a Diffie-Hellman key pair from the specified private key.

CryptoKeyPair GenerateKeyPair(ReadOnlySpan<byte> privateKey)

Parameters

privateKey ReadOnlySpan<byte>

Returns

CryptoKeyPair

SecP256K1Dh(PrivKey, ReadOnlySpan<byte>, Span<byte>)

Performs a Diffie-Hellman calculation between a secp256k1 private key in keyPair and the publicKey and writes an output sequence of bytes of length DhLen into sharedKey parameter.

void SecP256K1Dh(PrivKey k, ReadOnlySpan<byte> rk, Span<byte> sharedKey)

Parameters

k PrivKey
rk ReadOnlySpan<byte>
sharedKey Span<byte>