CSharpTest.Net
Rounds Property
See Also  Example Send Feedback Download Help File
CSharpTest.Net.Library Assembly > CSharpTest.Net.Crypto Namespace > ModifiedRijndael Class : Rounds Property

Glossary Item Box

Gets or sets the number of rounds the encryption algorithm will use when encrypting/decrypting data.

Syntax

Visual Basic (Declaration) 
Public Property Rounds As Integer
C# 
public int Rounds {get; set;}

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.NETCopy 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

Generated with Document! X 2011 by Innovasys