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

◆ HashUpdateAndFinish()

static void Internal.Cryptography.HashProviderDispenser.OneShotHashProvider.HashUpdateAndFinish ( SafeBCryptAlgorithmHandle algHandle,
int hashSize,
ReadOnlySpan< byte > key,
ReadOnlySpan< byte > source,
Span< byte > destination )
inlinestaticprivate

Definition at line 97 of file HashProviderDispenser.cs.

98 {
99 global::Interop.BCrypt.NTSTATUS nTSTATUS = global::Interop.BCrypt.BCryptCreateHash(algHandle, out var phHash, IntPtr.Zero, 0, key, key.Length, global::Interop.BCrypt.BCryptCreateHashFlags.None);
100 if (nTSTATUS != 0)
101 {
102 phHash.Dispose();
103 throw global::Interop.BCrypt.CreateCryptographicException(nTSTATUS);
104 }
105 using (phHash)
106 {
107 nTSTATUS = global::Interop.BCrypt.BCryptHashData(phHash, source, source.Length, 0);
108 if (nTSTATUS != 0)
109 {
110 throw global::Interop.BCrypt.CreateCryptographicException(nTSTATUS);
111 }
112 global::Interop.BCrypt.BCryptFinishHash(phHash, destination, hashSize, 0);
113 }
114 }
static readonly IntPtr Zero
Definition IntPtr.cs:18

References System.destination, System.key, System.source, and System.IntPtr.Zero.

Referenced by Internal.Cryptography.HashProviderDispenser.OneShotHashProvider.HashData(), and Internal.Cryptography.HashProviderDispenser.OneShotHashProvider.MacData().