Returns the AES standard round numbers for keys of 128, 192, and 256 bit, or provides a rough 1/3 of MaxRounds for other key sizes based on a constant block size of 128 bit.
Syntax
Visual Basic (Declaration) | |
---|
Public ReadOnly Property NormalRounds As Integer |
C# | |
---|
public int NormalRounds {get;} |
Example
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 |
Requirements
Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7
See Also