[#41] Client: Remove ranges

Signed-off-by: Pavel Gross <p.gross@yadro.com>
This commit is contained in:
Pavel Gross 2025-03-12 00:11:50 +03:00
parent 809bd90352
commit 6ae96c1d77
6 changed files with 11 additions and 260 deletions

View file

@ -27,8 +27,8 @@ public static class Verifier
throw new FormatException($"Wrong signature size, expect={RFC6979SignatureSize}, actual={sig.Length}");
var rs = new BigInteger[2];
rs[0] = new BigInteger(1, sig[..32]);
rs[1] = new BigInteger(1, sig[32..]);
rs[0] = new BigInteger(1, sig.AsSpan(0, 32).ToArray());
rs[1] = new BigInteger(1, sig.AsSpan(32).ToArray());
return rs;
}
@ -71,7 +71,7 @@ public static class Verifier
if (sig is null)
throw new ArgumentNullException(nameof(sig));
return key.VerifyHash(data.Sha512(), sig[1..]);
return key.VerifyHash(data.Sha512(), sig.AsSpan(1).ToArray());
}
public static bool VerifyMessagePart(this Signature sig, IMessage data)