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

◆ BCryptDecrypt() [2/4]

static unsafe int Interop.BCrypt.BCryptDecrypt ( Internal::NativeCrypto::SafeKeyHandle hKey,
ReadOnlySpan< byte > input,
byte[] iv,
Span< byte > output )
inlinestaticpackage

Definition at line 348 of file Interop.cs.

349 {
350 fixed (byte* pbInput = input)
351 {
352 fixed (byte* pbOutput = output)
353 {
354 int cbResult;
355 NTSTATUS nTSTATUS = BCryptDecrypt(hKey, pbInput, input.Length, IntPtr.Zero, iv, (iv != null) ? iv.Length : 0, pbOutput, output.Length, out cbResult, 0);
356 if (nTSTATUS != 0)
357 {
358 throw CreateCryptographicException(nTSTATUS);
359 }
360 return cbResult;
361 }
362 }
363 }
static Exception CreateCryptographicException(NTSTATUS ntStatus)
Definition Interop.cs:461
static unsafe int BCryptDecrypt(SafeKeyHandle hKey, ReadOnlySpan< byte > input, byte[] iv, Span< byte > output)
Definition Interop.cs:403
static readonly IntPtr Zero
Definition IntPtr.cs:18

References Interop.BCrypt.BCryptDecrypt(), Interop.BCrypt.CreateCryptographicException(), System.input, System.Span< T >.Length, and System.IntPtr.Zero.