Library/Library.Test/TestModifiedRijndael.cs
C# | Copy Code |
---|---|
ModifiedRijndael r = new ModifiedRijndael(); foreach (int blksz in AllKeySizes(r.LegalBlockSizes)) { r.BlockSize = blksz; r.GenerateIV(); Assert.AreEqual(blksz, r.IV.Length*8); foreach (int keysz in AllKeySizes(r.LegalKeySizes)) { r.KeySize = keysz; r.GenerateKey(); Assert.AreEqual(keysz, r.Key.Length*8); r.Rounds = r.NormalRounds; TestEncryptDecrypt(r, r); r.Rounds = r.MaxRounds; TestEncryptDecrypt(r, r); } } |
VB.NET | Copy Code |
---|---|
Dim r As New ModifiedRijndael() For Each blksz As Integer In AllKeySizes(r.LegalBlockSizes) r.BlockSize = blksz r.GenerateIV() Assert.AreEqual(blksz, r.IV.Length * 8) For Each keysz As Integer In AllKeySizes(r.LegalKeySizes) r.KeySize = keysz r.GenerateKey() Assert.AreEqual(keysz, r.Key.Length * 8) r.Rounds = r.NormalRounds TestEncryptDecrypt(r, r) r.Rounds = r.MaxRounds TestEncryptDecrypt(r, r) Next Next |
Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7
Reference
ModifiedRijndael ClassModifiedRijndael Members