protected byte[] KeyValue;
protected KeySizes[] LegalBlockSizesValue;
protected KeySizes[] LegalKeySizesValue;
-#if MOONLIGHT
- // Silverlight 2.0 only supports CBC
- internal int FeedbackSizeValue;
- internal CipherMode ModeValue;
- internal PaddingMode PaddingValue;
-#else
protected int FeedbackSizeValue;
protected CipherMode ModeValue;
protected PaddingMode PaddingValue;
-#endif
private bool m_disposed;
protected SymmetricAlgorithm ()
{
ModeValue = CipherMode.CBC;
PaddingValue = PaddingMode.PKCS7;
- m_disposed = false;
}
-#if MOONLIGHT
- // No Finalizer or IDisposable.Dispose in Silverlight 2.0
- // Documentation makes it "clear" that Clear MUST BE CALLED to zero out sensitive information
-#else
- ~SymmetricAlgorithm ()
- {
- Dispose (false);
- }
-#endif
+#if NET_4_0
+ public void Dispose ()
+#else
void IDisposable.Dispose ()
+#endif
{
Dispose (true);
GC.SuppressFinalize (this); // Finalization is now unnecessary
throw new CryptographicException (
Locale.GetText ("feedback size larger than block size"));
}
+ if ((value & 3) != 0) {
+ throw new CryptographicException (
+ Locale.GetText ("feedback size must be a multiple of 8 (bits)"));
+ }
this.FeedbackSizeValue = value;
}
}
// LAMESPEC: Default is Rijndael - not TripleDES
public static SymmetricAlgorithm Create ()
{
+#if FULL_AOT_RUNTIME
+ return new System.Security.Cryptography.RijndaelManaged ();
+#else
return Create ("System.Security.Cryptography.SymmetricAlgorithm");
+#endif
}
public static SymmetricAlgorithm Create (string algName)