Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ HashSpanToArray()

byte[] System.Security.Cryptography.DSA.HashSpanToArray ( ReadOnlySpan< byte > data,
HashAlgorithmName hashAlgorithm )
inlineprivateinherited

Definition at line 498 of file DSA.cs.

499 {
500 byte[] array = ArrayPool<byte>.Shared.Rent(data.Length);
501 bool flag = false;
502 try
503 {
504 data.CopyTo(array);
505 byte[] result = HashData(array, 0, data.Length, hashAlgorithm);
506 flag = true;
507 return result;
508 }
509 finally
510 {
511 Array.Clear(array, 0, data.Length);
512 if (flag)
513 {
515 }
516 }
517 }
static ArrayPool< T > Shared
Definition ArrayPool.cs:7
virtual byte[] HashData(byte[] data, int offset, int count, HashAlgorithmName hashAlgorithm)
Definition DSA.cs:69
void CopyTo(Span< T > destination)

References System.array, System.Array.Clear(), System.ReadOnlySpan< T >.CopyTo(), System.Security.Cryptography.DSA.HashData(), System.ReadOnlySpan< T >.Length, and System.Buffers.ArrayPool< T >.Shared.

Referenced by System.Security.Cryptography.DSA.HashSpanToTmp(), System.Security.Cryptography.DSA.SignDataCore(), and System.Security.Cryptography.DSA.TryHashData().