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

◆ BCryptDecrypt() [4/4]

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

Definition at line 403 of file Interop.cs.

404 {
405 fixed (byte* pbInput = input)
406 {
407 fixed (byte* pbOutput = output)
408 {
409 int cbResult;
410 NTSTATUS nTSTATUS = BCryptDecrypt(hKey, pbInput, input.Length, IntPtr.Zero, iv, (iv != null) ? iv.Length : 0, pbOutput, output.Length, out cbResult, 0);
411 if (nTSTATUS != 0)
412 {
413 throw CreateCryptographicException(nTSTATUS);
414 }
415 return cbResult;
416 }
417 }
418 }
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.

Referenced by Interop.BCrypt.BCryptDecrypt(), and Interop.BCrypt.BCryptDecrypt().