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

◆ CreateCryptoTransform() [3/3]

Internal.Cryptography.UniversalCryptoTransform Internal.Cryptography.CngSymmetricAlgorithmCore.CreateCryptoTransform ( byte[] rgbKey,
byte[] rgbIV,
bool encrypting,
PaddingMode padding,
CipherMode mode,
int feedbackSizeInBits )
inlineprivate

Definition at line 123 of file CngSymmetricAlgorithmCore.cs.

124 {
125 if (rgbKey == null)
126 {
127 throw new ArgumentNullException("rgbKey");
128 }
129 ValidateFeedbackSize(mode, feedbackSizeInBits);
130 byte[] array = rgbKey.CloneByteArray();
131 long num = (long)array.Length * 8L;
132 if (num > int.MaxValue || !((int)num).IsLegalSize(_outer.LegalKeySizes))
133 {
135 }
137 {
139 }
140 if (rgbIV != null && rgbIV.Length != _outer.BlockSize.BitSizeToByteSize())
141 {
143 }
144 byte[] iv = mode.GetCipherIv(rgbIV).CloneByteArray();
146 return CreateEphemeralCryptoTransformCore(array, iv, encrypting, padding, mode, feedbackSizeInBits);
147 }
static string Cryptography_WeakKey
Definition SR.cs:122
static string Cryptography_InvalidKeySize
Definition SR.cs:92
static string Cryptography_InvalidIVSize
Definition SR.cs:102
Definition SR.cs:7
void ValidateFeedbackSize(CipherMode mode, int feedbackSizeInBits)
Internal.Cryptography.UniversalCryptoTransform CreateEphemeralCryptoTransformCore(byte[] key, byte[] iv, bool encrypting, PaddingMode padding, CipherMode mode, int feedbackSizeInBits)

References Internal.Cryptography.CngSymmetricAlgorithmCore._outer, System.array, Internal.Cryptography.ICngSymmetricAlgorithm.BlockSize, Internal.Cryptography.CngSymmetricAlgorithmCore.CreateEphemeralCryptoTransformCore(), System.SR.Cryptography_InvalidIVSize, System.SR.Cryptography_InvalidKeySize, System.SR.Cryptography_WeakKey, Internal.Cryptography.ICngSymmetricAlgorithm.IsWeakKey(), System.L, Internal.Cryptography.ICngSymmetricAlgorithm.LegalKeySizes, Internal.Cryptography.ICngSymmetricAlgorithm.PreprocessKey(), and Internal.Cryptography.CngSymmetricAlgorithmCore.ValidateFeedbackSize().