[#20] Client: Optimize memory usage
All checks were successful
DCO / DCO (pull_request) Successful in 41s
All checks were successful
DCO / DCO (pull_request) Successful in 41s
Avoid memory allocation, use cache and static Signed-off-by: Pavel Gross <p.gross@yando.com>
This commit is contained in:
parent
35fe791406
commit
0ddde467cd
46 changed files with 596 additions and 372 deletions
|
@ -60,7 +60,7 @@ public static class Verifier
|
|||
|
||||
public static bool VerifyData(this ECDsa key, byte[] data, byte[] sig)
|
||||
{
|
||||
return key.VerifyHash(SHA512.Create().ComputeHash(data), sig[1..]);
|
||||
return key.VerifyHash(data.Sha512(), sig[1..]);
|
||||
}
|
||||
|
||||
public static bool VerifyMessagePart(this Signature sig, IMessage data)
|
||||
|
@ -101,7 +101,8 @@ public static class Verifier
|
|||
throw new FormatException($"invalid response, type={resp.GetType()}");
|
||||
|
||||
var status = resp.MetaHeader.Status.ToModel();
|
||||
if (!status.IsSuccess)
|
||||
|
||||
if (status != null && !status.IsSuccess)
|
||||
throw new ResponseException(status);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue