Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions crypto/src/math/ec/rfc8032/Ed25519.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1100,6 +1100,21 @@ public static void SignPrehash(byte[] sk, int skOff, byte[] pk, int pkOff, byte[
ImplSign(sk, skOff, pk, pkOff, ctx, phflag, m, 0, m.Length, sig, sigOff);
}

public static void SignByExtendedKey(byte[] h, byte[] ctx, byte[] m, int mOff, int mLen, byte[] sig, int sigOff)
{
byte phflag = 0x00;

byte[] s = new byte[ScalarBytes];
PruneScalar(h, 0, s);

byte[] pk = new byte[PointBytes];
ScalarMultBaseEncoded(s, pk, 0);

IDigest d = CreateDigest();

ImplSign(d, h, s, pk, 0, ctx, phflag, m, mOff, mLen, sig, sigOff);
}

public static bool Verify(byte[] sig, int sigOff, byte[] pk, int pkOff, byte[] m, int mOff, int mLen)
{
byte[] ctx = null;
Expand Down