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

◆ BasicSymmetricCipherNCrypt()

Internal.Cryptography.BasicSymmetricCipherNCrypt.BasicSymmetricCipherNCrypt ( Func< CngKey > cngKeyFactory,
CipherMode cipherMode,
int blockSizeInBytes,
byte[] iv,
bool encrypting,
int paddingSize )
inline

Definition at line 20 of file BasicSymmetricCipherNCrypt.cs.

21 : base(iv, blockSizeInBytes, paddingSize)
22 {
23 _encrypting = encrypting;
24 _cngKey = cngKeyFactory();
25 CngProperty property = cipherMode switch
26 {
27 CipherMode.ECB => s_ECBMode,
28 CipherMode.CBC => s_CBCMode,
29 CipherMode.CFB => s_CFBMode,
31 };
32 _cngKey.SetProperty(property);
33 Reset();
34 }
static string Cryptography_InvalidCipherMode
Definition SR.cs:54
Definition SR.cs:7
unsafe void SetProperty(CngProperty property)
Definition CngKey.cs:261

References Internal.Cryptography.BasicSymmetricCipherNCrypt._cngKey, Internal.Cryptography.BasicSymmetricCipherNCrypt._encrypting, System.SR.Cryptography_InvalidCipherMode, Internal.Cryptography.BasicSymmetricCipherNCrypt.Reset(), Internal.Cryptography.BasicSymmetricCipherNCrypt.s_CBCMode, Internal.Cryptography.BasicSymmetricCipherNCrypt.s_CFBMode, Internal.Cryptography.BasicSymmetricCipherNCrypt.s_ECBMode, and System.Security.Cryptography.CngKey.SetProperty().