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

◆ BCryptEncrypt() [2/4]

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

Definition at line 331 of file Interop.cs.

332 {
333 fixed (byte* pbInput = input)
334 {
335 fixed (byte* pbOutput = output)
336 {
337 int cbResult;
338 NTSTATUS nTSTATUS = BCryptEncrypt(hKey, pbInput, input.Length, IntPtr.Zero, iv, (iv != null) ? iv.Length : 0, pbOutput, output.Length, out cbResult, 0);
339 if (nTSTATUS != 0)
340 {
341 throw CreateCryptographicException(nTSTATUS);
342 }
343 return cbResult;
344 }
345 }
346 }
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.