15 public BasicSymmetricCipherCsp(
int algId,
CipherMode cipherMode,
int blockSizeInBytes,
byte[]
key,
int effectiveKeyLength,
bool addNoSaltFlag,
byte[] iv,
bool encrypting,
int feedbackSize,
int paddingSizeInBytes)
16 : base(cipherMode.GetCipherIv(iv), blockSizeInBytes, paddingSizeInBytes)
26 byte[] cipherIv = cipherMode.GetCipherIv(iv);
31 if (effectiveKeyLength != 0)
37 protected override void Dispose(
bool disposing)
48 base.Dispose(disposing);
59 if (
input.Length != 0)
92 return safeProvHandle;
readonly bool _encrypting
override int TransformFinal(ReadOnlySpan< byte > input, Span< byte > output)
int Transform(ReadOnlySpan< byte > input, Span< byte > output, bool isFinal)
static SafeKeyHandle ImportCspBlob(SafeProvHandle safeProvHandle, int algId, byte[] rawKey, bool addNoSaltFlag)
static SafeProvHandle AcquireSafeProviderHandle()
override void Dispose(bool disposing)
override int Transform(ReadOnlySpan< byte > input, Span< byte > output)
BasicSymmetricCipherCsp(int algId, CipherMode cipherMode, int blockSizeInBytes, byte[] key, int effectiveKeyLength, bool addNoSaltFlag, byte[] iv, bool encrypting, int feedbackSize, int paddingSizeInBytes)
SafeProvHandle _hProvider
static void AcquireCsp(CspParameters cspParameters, out SafeProvHandle safeProvHandle)
static void SetKeyParameter(SafeKeyHandle safeKeyHandle, CryptGetKeyParamQueryType keyParam, byte[] value)
static int DecryptData(SafeKeyHandle hKey, ReadOnlySpan< byte > input, Span< byte > output)
CryptGetKeyParamQueryType
static byte[] ToPlainTextKeyBlob(int algId, byte[] rawKey)
static void ImportKeyBlob(SafeProvHandle saveProvHandle, CspProviderFlags flags, bool addNoSaltFlag, byte[] keyBlob, out SafeKeyHandle safeKeyHandle)
static int EncryptData(SafeKeyHandle hKey, ReadOnlySpan< byte > input, Span< byte > output, bool isFinal)
override void Dispose(bool disposing)