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

◆ BCryptEncrypt() [4/4]

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

Definition at line 386 of file Interop.cs.

387 {
388 fixed (byte* pbInput = input)
389 {
390 fixed (byte* pbOutput = output)
391 {
392 int cbResult;
393 NTSTATUS nTSTATUS = BCryptEncrypt(hKey, pbInput, input.Length, IntPtr.Zero, iv, (iv != null) ? iv.Length : 0, pbOutput, output.Length, out cbResult, 0);
394 if (nTSTATUS != 0)
395 {
396 throw CreateCryptographicException(nTSTATUS);
397 }
398 return cbResult;
399 }
400 }
401 }
static unsafe int BCryptEncrypt(SafeKeyHandle hKey, ReadOnlySpan< byte > input, byte[] iv, Span< byte > output)
Definition Interop.cs:386
static Exception CreateCryptographicException(NTSTATUS ntStatus)
Definition Interop.cs:461
static readonly IntPtr Zero
Definition IntPtr.cs:18

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

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