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

◆ DecryptData()

static int Internal.NativeCrypto.CapiHelper.DecryptData ( SafeKeyHandle hKey,
ReadOnlySpan< byte > input,
Span< byte > output )
inlinestaticpackage

Definition at line 981 of file CapiHelper.cs.

982 {
983 VerifyValidHandle(hKey);
984 byte[] array = new byte[input.Length];
985 input.CopyTo(array);
986 int pdwDataLen = input.Length;
987 if (!global::Interop.Advapi32.CryptDecrypt(hKey, SafeHashHandle.InvalidHandle, Final: false, 0, array, ref pdwDataLen))
988 {
989 throw GetErrorCode().ToCryptographicException();
990 }
991 array.AsSpan(0, pdwDataLen).CopyTo(output);
992 return pdwDataLen;
993 }
static void VerifyValidHandle(SafeHandleZeroOrMinusOneIsInvalid handle)

References System.array, Internal.NativeCrypto.CapiHelper.GetErrorCode(), System.input, System.Security.Cryptography.SafeHashHandle.InvalidHandle, and Internal.NativeCrypto.CapiHelper.VerifyValidHandle().

Referenced by Internal.Cryptography.BasicSymmetricCipherCsp.Transform().