-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
KCVTests.cs
34 lines (29 loc) · 956 Bytes
/
KCVTests.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
namespace Leosac.KeyManager.Library.Tests
{
[TestClass]
public class KCVTests
{
[TestMethod]
public void Test_KCV_2K3DES()
{
var kcv = new KeyGen.KCV();
var checksum = kcv.ComputeKCV("DES", "11223344556677889900AABBCCDDEEFF");
Assert.AreEqual("5ED7EA", checksum);
}
[TestMethod]
public void Test_KCV_3K3DES()
{
var kcv = new KeyGen.KCV();
var checksum = kcv.ComputeKCV("DES", "11223344556677889900AABBCCDDEEFF8877665544332211");
Assert.AreEqual("CB799D", checksum);
}
[TestMethod]
public void Test_KCV_AES()
{
var kcv = new KeyGen.KCV();
var checksum = kcv.ComputeKCV("AES", "11223344556677889900AABBCCDDEEFF");
// Would be DD566B if not using 0x01 as padding value for IV
Assert.AreEqual("CDE1DE", checksum);
}
}
}