a565d929fc2a309fcfacbaeb165cf097bf71cf12
[mono.git] / mcs / class / corlib / Test / System.Security.Cryptography / DESCryptoServiceProviderTest.cs
1 //
2 // TestSuite.System.Security.Cryptography.DESCryptoServiceProviderTest.cs
3 //
4 // Author:
5 //      Sebastien Pouliot  <sebastien@ximian.com>
6 //
7 // (C) 2004 Novell (http://www.novell.com)
8 //
9
10 using System;
11 using System.Security.Cryptography;
12
13 using NUnit.Framework;
14
15 namespace MonoTests.System.Security.Cryptography {
16
17         [TestFixture]
18         public class DESCryptoServiceProviderTest : DESFIPS81Test {
19
20                 [SetUp]
21                 public void SetUp () 
22                 {
23                         des = new DESCryptoServiceProvider ();
24                 }
25
26                 [Test]
27                 public void KeyChecks () 
28                 {
29                         byte[] key = des.Key;
30                         AssertEquals ("Key", 8, key.Length);
31                         Assert ("IsWeakKey", !DES.IsWeakKey (key));
32                         Assert ("IsSemiWeakKey", !DES.IsSemiWeakKey (key));
33                 }
34
35                 [Test]
36                 public void IV () 
37                 {
38                         byte[] iv = des.IV;
39                         AssertEquals ("IV", 8, iv.Length);
40                 }
41
42                 // other tests (test vectors) are inherited from DESFIPS81Test
43                 // (in DESTest.cs) but executed here
44         }
45 }