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

◆ BasicSymmetricCipherCsp()

Internal.Cryptography.BasicSymmetricCipherCsp.BasicSymmetricCipherCsp ( int algId,
CipherMode cipherMode,
int blockSizeInBytes,
byte[] key,
int effectiveKeyLength,
bool addNoSaltFlag,
byte[] iv,
bool encrypting,
int feedbackSize,
int paddingSizeInBytes )
inline

Definition at line 15 of file BasicSymmetricCipherCsp.cs.

16 : base(cipherMode.GetCipherIv(iv), blockSizeInBytes, paddingSizeInBytes)
17 {
18 _encrypting = encrypting;
20 _hKey = ImportCspBlob(_hProvider, algId, key, addNoSaltFlag);
22 if (cipherMode == CipherMode.CFB)
23 {
25 }
26 byte[] cipherIv = cipherMode.GetCipherIv(iv);
27 if (cipherIv != null)
28 {
30 }
31 if (effectiveKeyLength != 0)
32 {
33 CapiHelper.SetKeyParameter(_hKey, CapiHelper.CryptGetKeyParamQueryType.KP_EFFECTIVE_KEYLEN, effectiveKeyLength);
34 }
35 }
static SafeKeyHandle ImportCspBlob(SafeProvHandle safeProvHandle, int algId, byte[] rawKey, bool addNoSaltFlag)
static void SetKeyParameter(SafeKeyHandle safeKeyHandle, CryptGetKeyParamQueryType keyParam, byte[] value)

References Internal.Cryptography.BasicSymmetricCipherCsp._encrypting, Internal.Cryptography.BasicSymmetricCipherCsp._hKey, Internal.Cryptography.BasicSymmetricCipherCsp._hProvider, Internal.Cryptography.BasicSymmetricCipherCsp.AcquireSafeProviderHandle(), Internal.Cryptography.BasicSymmetricCipherCsp.ImportCspBlob(), System.key, and Internal.NativeCrypto.CapiHelper.SetKeyParameter().