<PackageReference Include="BouncyCastle.Cryptography" Version="2.7.0" />

Org.BouncyCastle.Crypto.Parameters.Ed25519PublicKeyParameters

Ed25519 public key (RFC 8032). Wraps a decoded curve point obtained from a 32-byte encoded representation; the point is validated at construction so that subsequent verifications work against a known-good key.
public static readonly int KeySize

Length in bytes of an Ed25519 public key encoding (32).

public Ed25519PublicKeyParameters(byte[] buf)

Construct from a 32-byte buffer holding the encoded public point.

public Ed25519PublicKeyParameters(byte[] buf, int off)

Construct from buf starting at off; reads KeySize bytes.

Construct from a span holding the encoded public point.

Read KeySize encoded bytes from input and decode them.

Construct from an already-decoded curve point. No further validation is performed.

public void Encode(byte[] buf, int off)

Write the 32-byte encoded public point into buf at off.

public void Encode(Span<byte> buf)

Write the 32-byte encoded public point into the supplied span.

public byte[] GetEncoded()

Return a fresh copy of the 32-byte encoded public point.

public bool Verify(Algorithm algorithm, byte[] ctx, byte[] msg, int msgOff, int msgLen, byte[] sig, int sigOff)

Verify an Ed25519 signature. Selects between pure Ed25519, Ed25519ctx and Ed25519ph based on algorithm. The pure variant rejects a non-null context; the context and prehash variants require a context up to 255 bytes long, and Ed25519ph additionally requires msgLen to equal PrehashSize.

public bool Verify(Algorithm algorithm, byte[] ctx, ReadOnlySpan<byte> msg, ReadOnlySpan<byte> sig)

Span-based overload of Verify.