Table of Contents

Class Ed448

Namespace
Org.BouncyCastle.Math.EC.Rfc8032
Assembly
BouncyCastle.Cryptography.dll

A low-level implementation of the Ed448 and Ed448ph instantiations of the Edwards-Curve Digital Signature Algorithm specified in RFC 8032.

public static class Ed448
Inheritance
Ed448
Inherited Members

Remarks

The implementation uses the "signed mult-comb" algorithm (for scalar multiplication by a fixed point) from Mike Hamburg, "Fast and compact elliptic-curve cryptography". Standard projective coordinates are used for most point arithmetic.

Fields

PrehashSize

public static readonly int PrehashSize

Field Value

int

PublicKeySize

public static readonly int PublicKeySize

Field Value

int

SecretKeySize

public static readonly int SecretKeySize

Field Value

int

SignatureSize

public static readonly int SignatureSize

Field Value

int

Methods

CreatePrehash()

public static IXof CreatePrehash()

Returns

IXof

EncodePublicPoint(PublicPoint, byte[], int)

public static void EncodePublicPoint(Ed448.PublicPoint publicPoint, byte[] pk, int pkOff)

Parameters

publicPoint Ed448.PublicPoint
pk byte[]
pkOff int

EncodePublicPoint(PublicPoint, Span<byte>)

public static void EncodePublicPoint(Ed448.PublicPoint publicPoint, Span<byte> pk)

Parameters

publicPoint Ed448.PublicPoint
pk Span<byte>

GeneratePrivateKey(SecureRandom, byte[])

public static void GeneratePrivateKey(SecureRandom random, byte[] k)

Parameters

random SecureRandom
k byte[]

GeneratePrivateKey(SecureRandom, Span<byte>)

public static void GeneratePrivateKey(SecureRandom random, Span<byte> k)

Parameters

random SecureRandom
k Span<byte>

GeneratePublicKey(byte[], int)

public static Ed448.PublicPoint GeneratePublicKey(byte[] sk, int skOff)

Parameters

sk byte[]
skOff int

Returns

Ed448.PublicPoint

GeneratePublicKey(byte[], int, byte[], int)

public static void GeneratePublicKey(byte[] sk, int skOff, byte[] pk, int pkOff)

Parameters

sk byte[]
skOff int
pk byte[]
pkOff int

GeneratePublicKey(ReadOnlySpan<byte>)

public static Ed448.PublicPoint GeneratePublicKey(ReadOnlySpan<byte> sk)

Parameters

sk ReadOnlySpan<byte>

Returns

Ed448.PublicPoint

GeneratePublicKey(ReadOnlySpan<byte>, Span<byte>)

public static void GeneratePublicKey(ReadOnlySpan<byte> sk, Span<byte> pk)

Parameters

sk ReadOnlySpan<byte>
pk Span<byte>

Precompute()

public static void Precompute()

Sign(byte[], int, byte[], byte[], int, int, byte[], int)

public static void Sign(byte[] sk, int skOff, byte[] ctx, byte[] m, int mOff, int mLen, byte[] sig, int sigOff)

Parameters

sk byte[]
skOff int
ctx byte[]
m byte[]
mOff int
mLen int
sig byte[]
sigOff int

Sign(byte[], int, byte[], int, byte[], byte[], int, int, byte[], int)

public static void Sign(byte[] sk, int skOff, byte[] pk, int pkOff, byte[] ctx, byte[] m, int mOff, int mLen, byte[] sig, int sigOff)

Parameters

sk byte[]
skOff int
pk byte[]
pkOff int
ctx byte[]
m byte[]
mOff int
mLen int
sig byte[]
sigOff int

Sign(ReadOnlySpan<byte>, byte[], ReadOnlySpan<byte>, Span<byte>)

public static void Sign(ReadOnlySpan<byte> sk, byte[] ctx, ReadOnlySpan<byte> m, Span<byte> sig)

Parameters

sk ReadOnlySpan<byte>
ctx byte[]
m ReadOnlySpan<byte>
sig Span<byte>

Sign(ReadOnlySpan<byte>, ReadOnlySpan<byte>, byte[], ReadOnlySpan<byte>, Span<byte>)

public static void Sign(ReadOnlySpan<byte> sk, ReadOnlySpan<byte> pk, byte[] ctx, ReadOnlySpan<byte> m, Span<byte> sig)

Parameters

sk ReadOnlySpan<byte>
pk ReadOnlySpan<byte>
ctx byte[]
m ReadOnlySpan<byte>
sig Span<byte>

SignPrehash(byte[], int, byte[], IXof, byte[], int)

public static void SignPrehash(byte[] sk, int skOff, byte[] ctx, IXof ph, byte[] sig, int sigOff)

Parameters

sk byte[]
skOff int
ctx byte[]
ph IXof
sig byte[]
sigOff int

SignPrehash(byte[], int, byte[], byte[], int, byte[], int)

public static void SignPrehash(byte[] sk, int skOff, byte[] ctx, byte[] ph, int phOff, byte[] sig, int sigOff)

Parameters

sk byte[]
skOff int
ctx byte[]
ph byte[]
phOff int
sig byte[]
sigOff int

SignPrehash(byte[], int, byte[], int, byte[], IXof, byte[], int)

public static void SignPrehash(byte[] sk, int skOff, byte[] pk, int pkOff, byte[] ctx, IXof ph, byte[] sig, int sigOff)

Parameters

sk byte[]
skOff int
pk byte[]
pkOff int
ctx byte[]
ph IXof
sig byte[]
sigOff int

SignPrehash(byte[], int, byte[], int, byte[], byte[], int, byte[], int)

public static void SignPrehash(byte[] sk, int skOff, byte[] pk, int pkOff, byte[] ctx, byte[] ph, int phOff, byte[] sig, int sigOff)

Parameters

sk byte[]
skOff int
pk byte[]
pkOff int
ctx byte[]
ph byte[]
phOff int
sig byte[]
sigOff int

SignPrehash(ReadOnlySpan<byte>, byte[], IDigest, Span<byte>)

public static void SignPrehash(ReadOnlySpan<byte> sk, byte[] ctx, IDigest ph, Span<byte> sig)

Parameters

sk ReadOnlySpan<byte>
ctx byte[]
ph IDigest
sig Span<byte>

SignPrehash(ReadOnlySpan<byte>, byte[], ReadOnlySpan<byte>, Span<byte>)

public static void SignPrehash(ReadOnlySpan<byte> sk, byte[] ctx, ReadOnlySpan<byte> ph, Span<byte> sig)

Parameters

sk ReadOnlySpan<byte>
ctx byte[]
ph ReadOnlySpan<byte>
sig Span<byte>

SignPrehash(ReadOnlySpan<byte>, ReadOnlySpan<byte>, byte[], IDigest, Span<byte>)

public static void SignPrehash(ReadOnlySpan<byte> sk, ReadOnlySpan<byte> pk, byte[] ctx, IDigest ph, Span<byte> sig)

Parameters

sk ReadOnlySpan<byte>
pk ReadOnlySpan<byte>
ctx byte[]
ph IDigest
sig Span<byte>

SignPrehash(ReadOnlySpan<byte>, ReadOnlySpan<byte>, byte[], ReadOnlySpan<byte>, Span<byte>)

public static void SignPrehash(ReadOnlySpan<byte> sk, ReadOnlySpan<byte> pk, byte[] ctx, ReadOnlySpan<byte> ph, Span<byte> sig)

Parameters

sk ReadOnlySpan<byte>
pk ReadOnlySpan<byte>
ctx byte[]
ph ReadOnlySpan<byte>
sig Span<byte>

ValidatePublicKeyFull(byte[], int)

public static bool ValidatePublicKeyFull(byte[] pk, int pkOff)

Parameters

pk byte[]
pkOff int

Returns

bool

ValidatePublicKeyFull(ReadOnlySpan<byte>)

public static bool ValidatePublicKeyFull(ReadOnlySpan<byte> pk)

Parameters

pk ReadOnlySpan<byte>

Returns

bool

ValidatePublicKeyFullExport(byte[], int)

public static Ed448.PublicPoint ValidatePublicKeyFullExport(byte[] pk, int pkOff)

Parameters

pk byte[]
pkOff int

Returns

Ed448.PublicPoint

ValidatePublicKeyFullExport(ReadOnlySpan<byte>)

public static Ed448.PublicPoint ValidatePublicKeyFullExport(ReadOnlySpan<byte> pk)

Parameters

pk ReadOnlySpan<byte>

Returns

Ed448.PublicPoint

ValidatePublicKeyPartial(byte[], int)

public static bool ValidatePublicKeyPartial(byte[] pk, int pkOff)

Parameters

pk byte[]
pkOff int

Returns

bool

ValidatePublicKeyPartial(ReadOnlySpan<byte>)

public static bool ValidatePublicKeyPartial(ReadOnlySpan<byte> pk)

Parameters

pk ReadOnlySpan<byte>

Returns

bool

ValidatePublicKeyPartialExport(byte[], int)

public static Ed448.PublicPoint ValidatePublicKeyPartialExport(byte[] pk, int pkOff)

Parameters

pk byte[]
pkOff int

Returns

Ed448.PublicPoint

ValidatePublicKeyPartialExport(ReadOnlySpan<byte>)

public static Ed448.PublicPoint ValidatePublicKeyPartialExport(ReadOnlySpan<byte> pk)

Parameters

pk ReadOnlySpan<byte>

Returns

Ed448.PublicPoint

Verify(byte[], int, PublicPoint, byte[], byte[], int, int)

public static bool Verify(byte[] sig, int sigOff, Ed448.PublicPoint publicPoint, byte[] ctx, byte[] m, int mOff, int mLen)

Parameters

sig byte[]
sigOff int
publicPoint Ed448.PublicPoint
ctx byte[]
m byte[]
mOff int
mLen int

Returns

bool

Verify(byte[], int, byte[], int, byte[], byte[], int, int)

public static bool Verify(byte[] sig, int sigOff, byte[] pk, int pkOff, byte[] ctx, byte[] m, int mOff, int mLen)

Parameters

sig byte[]
sigOff int
pk byte[]
pkOff int
ctx byte[]
m byte[]
mOff int
mLen int

Returns

bool

Verify(ReadOnlySpan<byte>, PublicPoint, byte[], ReadOnlySpan<byte>)

public static bool Verify(ReadOnlySpan<byte> sig, Ed448.PublicPoint publicPoint, byte[] ctx, ReadOnlySpan<byte> m)

Parameters

sig ReadOnlySpan<byte>
publicPoint Ed448.PublicPoint
ctx byte[]
m ReadOnlySpan<byte>

Returns

bool

Verify(ReadOnlySpan<byte>, ReadOnlySpan<byte>, byte[], ReadOnlySpan<byte>)

public static bool Verify(ReadOnlySpan<byte> sig, ReadOnlySpan<byte> pk, byte[] ctx, ReadOnlySpan<byte> m)

Parameters

sig ReadOnlySpan<byte>
pk ReadOnlySpan<byte>
ctx byte[]
m ReadOnlySpan<byte>

Returns

bool

VerifyPrehash(byte[], int, PublicPoint, byte[], IXof)

public static bool VerifyPrehash(byte[] sig, int sigOff, Ed448.PublicPoint publicPoint, byte[] ctx, IXof ph)

Parameters

sig byte[]
sigOff int
publicPoint Ed448.PublicPoint
ctx byte[]
ph IXof

Returns

bool

VerifyPrehash(byte[], int, PublicPoint, byte[], byte[], int)

public static bool VerifyPrehash(byte[] sig, int sigOff, Ed448.PublicPoint publicPoint, byte[] ctx, byte[] ph, int phOff)

Parameters

sig byte[]
sigOff int
publicPoint Ed448.PublicPoint
ctx byte[]
ph byte[]
phOff int

Returns

bool

VerifyPrehash(byte[], int, byte[], int, byte[], IXof)

public static bool VerifyPrehash(byte[] sig, int sigOff, byte[] pk, int pkOff, byte[] ctx, IXof ph)

Parameters

sig byte[]
sigOff int
pk byte[]
pkOff int
ctx byte[]
ph IXof

Returns

bool

VerifyPrehash(byte[], int, byte[], int, byte[], byte[], int)

public static bool VerifyPrehash(byte[] sig, int sigOff, byte[] pk, int pkOff, byte[] ctx, byte[] ph, int phOff)

Parameters

sig byte[]
sigOff int
pk byte[]
pkOff int
ctx byte[]
ph byte[]
phOff int

Returns

bool

VerifyPrehash(ReadOnlySpan<byte>, PublicPoint, byte[], IXof)

public static bool VerifyPrehash(ReadOnlySpan<byte> sig, Ed448.PublicPoint publicPoint, byte[] ctx, IXof ph)

Parameters

sig ReadOnlySpan<byte>
publicPoint Ed448.PublicPoint
ctx byte[]
ph IXof

Returns

bool

VerifyPrehash(ReadOnlySpan<byte>, PublicPoint, byte[], ReadOnlySpan<byte>)

public static bool VerifyPrehash(ReadOnlySpan<byte> sig, Ed448.PublicPoint publicPoint, byte[] ctx, ReadOnlySpan<byte> ph)

Parameters

sig ReadOnlySpan<byte>
publicPoint Ed448.PublicPoint
ctx byte[]
ph ReadOnlySpan<byte>

Returns

bool

VerifyPrehash(ReadOnlySpan<byte>, ReadOnlySpan<byte>, byte[], IXof)

public static bool VerifyPrehash(ReadOnlySpan<byte> sig, ReadOnlySpan<byte> pk, byte[] ctx, IXof ph)

Parameters

sig ReadOnlySpan<byte>
pk ReadOnlySpan<byte>
ctx byte[]
ph IXof

Returns

bool

VerifyPrehash(ReadOnlySpan<byte>, ReadOnlySpan<byte>, byte[], ReadOnlySpan<byte>)

public static bool VerifyPrehash(ReadOnlySpan<byte> sig, ReadOnlySpan<byte> pk, byte[] ctx, ReadOnlySpan<byte> ph)

Parameters

sig ReadOnlySpan<byte>
pk ReadOnlySpan<byte>
ctx byte[]
ph ReadOnlySpan<byte>

Returns

bool