diff --git a/Ed25519/Signer.cs b/Ed25519/Signer.cs index aa85ea0..82adeff 100644 --- a/Ed25519/Signer.cs +++ b/Ed25519/Signer.cs @@ -10,8 +10,8 @@ namespace Ed25519 { public static ReadOnlySpan Sign(ReadOnlySpan message, ReadOnlySpan privateKey, ReadOnlySpan publicKey) { - if(privateKey.Length == 0) - throw new ArgumentException("Private key length is wrong. Key must not be empty."); + if(privateKey.Length != Constants.BIT_LENGTH / 8) + throw new ArgumentException($"Private key length is wrong. Got {publicKey.Length} instead of {Constants.BIT_LENGTH / 8}."); if (publicKey.Length != Constants.BIT_LENGTH / 8) throw new ArgumentException($"Public key length is wrong. Got {publicKey.Length} instead of {Constants.BIT_LENGTH / 8}.");