summary refs log tree commit diff
path: root/crypto/test/src/asn1
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2020-10-30 23:43:25 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2020-10-30 23:43:25 +0700
commitcf9d584cebc3b589ba865ecf74d2af9d91bae631 (patch)
tree601689d830d03d870a0b4eef4ab8c4f9eb84f74b /crypto/test/src/asn1
parentAdd new files to projects (diff)
downloadBouncyCastle.NET-ed25519-cf9d584cebc3b589ba865ecf74d2af9d91bae631.tar.xz
Cleanup after recent changes
Diffstat (limited to 'crypto/test/src/asn1')
-rw-r--r--crypto/test/src/asn1/test/KMacParamsTest.cs62
1 files changed, 34 insertions, 28 deletions
diff --git a/crypto/test/src/asn1/test/KMacParamsTest.cs b/crypto/test/src/asn1/test/KMacParamsTest.cs
index 1c080f755..a3d82694b 100644
--- a/crypto/test/src/asn1/test/KMacParamsTest.cs
+++ b/crypto/test/src/asn1/test/KMacParamsTest.cs
@@ -1,4 +1,7 @@
-using NUnit.Framework;
+using System;
+
+using NUnit.Framework;
+
 using Org.BouncyCastle.Asn1.Nist;
 using Org.BouncyCastle.Utilities;
 using Org.BouncyCastle.Utilities.Test;
@@ -6,63 +9,66 @@ using Org.BouncyCastle.Utilities.Test;
 namespace Org.BouncyCastle.Asn1.Tests
 {
     [TestFixture]
-    public class KMacParamsTest  :SimpleTest
+    public class KMacParamsTest
+        : SimpleTest
     {
-        public override string Name => "KMacParamsTest";
+        public override string Name
+        {
+            get { return "KMacParamsTest"; }
+        }
 
-      
         public override void PerformTest()
         {
-            Assert.IsTrue(Arrays.AreEqual(new KMACwithSHAKE128_params(256).GetEncoded(), new DerSequence().GetEncoded()));
-            Assert.IsTrue(Arrays.AreEqual(new KMACwithSHAKE256_params(512).GetEncoded(), new DerSequence().GetEncoded()));
+            Assert.IsTrue(Arrays.AreEqual(new KMacWithShake128Params(256).GetEncoded(), new DerSequence().GetEncoded()));
+            Assert.IsTrue(Arrays.AreEqual(new KMacWithShake256Params(512).GetEncoded(), new DerSequence().GetEncoded()));
 
-            Assert.IsTrue(Arrays.AreEqual(new KMACwithSHAKE128_params(512).GetEncoded(), new DerSequence(new DerInteger(512)).GetEncoded()));
-            Assert.IsTrue(Arrays.AreEqual(new KMACwithSHAKE256_params(256).GetEncoded(), new DerSequence(new DerInteger(256)).GetEncoded()));
+            Assert.IsTrue(Arrays.AreEqual(new KMacWithShake128Params(512).GetEncoded(), new DerSequence(new DerInteger(512)).GetEncoded()));
+            Assert.IsTrue(Arrays.AreEqual(new KMacWithShake256Params(256).GetEncoded(), new DerSequence(new DerInteger(256)).GetEncoded()));
 
-            Assert.IsTrue(Arrays.AreEqual(new KMACwithSHAKE128_params(512).GetEncoded(), KMACwithSHAKE128_params.getInstance(new DerSequence(new DerInteger(512))).GetEncoded()));
-            Assert.IsTrue(Arrays.AreEqual(new KMACwithSHAKE256_params(256).GetEncoded(), KMACwithSHAKE256_params.getInstance(new DerSequence(new DerInteger(256))).GetEncoded()));
+            Assert.IsTrue(Arrays.AreEqual(new KMacWithShake128Params(512).GetEncoded(), KMacWithShake128Params.GetInstance(new DerSequence(new DerInteger(512))).GetEncoded()));
+            Assert.IsTrue(Arrays.AreEqual(new KMacWithShake256Params(256).GetEncoded(), KMacWithShake256Params.GetInstance(new DerSequence(new DerInteger(256))).GetEncoded()));
 
             byte[] customizationString = Strings.ToByteArray("hello, world!");
 
-            Assert.IsTrue(Arrays.AreEqual(new KMACwithSHAKE128_params(512, customizationString).GetEncoded(), new DerSequence(
+            Assert.IsTrue(Arrays.AreEqual(new KMacWithShake128Params(512, customizationString).GetEncoded(), new DerSequence(
                 new Asn1Encodable[] { new DerInteger(512), new DerOctetString(customizationString) }).GetEncoded()));
-            Assert.IsTrue(Arrays.AreEqual(new KMACwithSHAKE256_params(256, customizationString).GetEncoded(), new DerSequence(
+            Assert.IsTrue(Arrays.AreEqual(new KMacWithShake256Params(256, customizationString).GetEncoded(), new DerSequence(
                 new Asn1Encodable[] { new DerInteger(256), new DerOctetString(customizationString) }).GetEncoded()));
 
-            Assert.IsTrue(Arrays.AreEqual(new KMACwithSHAKE128_params(512, customizationString).GetEncoded(),
-                KMACwithSHAKE128_params.getInstance(
+            Assert.IsTrue(Arrays.AreEqual(new KMacWithShake128Params(512, customizationString).GetEncoded(),
+                KMacWithShake128Params.GetInstance(
                     new DerSequence(new Asn1Encodable[] { new DerInteger(512), new DerOctetString(customizationString) })).GetEncoded()));
-            Assert.IsTrue(Arrays.AreEqual(new KMACwithSHAKE256_params(256, customizationString).GetEncoded(),
-                KMACwithSHAKE256_params.getInstance(new DerSequence(
+            Assert.IsTrue(Arrays.AreEqual(new KMacWithShake256Params(256, customizationString).GetEncoded(),
+                KMacWithShake256Params.GetInstance(new DerSequence(
                 new Asn1Encodable[] { new DerInteger(256), new DerOctetString(customizationString) })).GetEncoded()));
 
-            Assert.IsTrue(Arrays.AreEqual(new KMACwithSHAKE128_params(256, customizationString).GetEncoded(), new DerSequence(
+            Assert.IsTrue(Arrays.AreEqual(new KMacWithShake128Params(256, customizationString).GetEncoded(), new DerSequence(
                 new Asn1Encodable[] { new DerOctetString(customizationString) }).GetEncoded()));
-            Assert.IsTrue(Arrays.AreEqual(new KMACwithSHAKE256_params(512, customizationString).GetEncoded(), new DerSequence(
+            Assert.IsTrue(Arrays.AreEqual(new KMacWithShake256Params(512, customizationString).GetEncoded(), new DerSequence(
                 new Asn1Encodable[] { new DerOctetString(customizationString) }).GetEncoded()));
 
-            Assert.IsTrue(Arrays.AreEqual(new KMACwithSHAKE128_params(256, customizationString).GetEncoded(),
-                KMACwithSHAKE128_params.getInstance(
+            Assert.IsTrue(Arrays.AreEqual(new KMacWithShake128Params(256, customizationString).GetEncoded(),
+                KMacWithShake128Params.GetInstance(
                     new DerSequence(new Asn1Encodable[] { new DerOctetString(customizationString) })).GetEncoded()));
-            Assert.IsTrue(Arrays.AreEqual(new KMACwithSHAKE256_params(512, customizationString).GetEncoded(),
-                KMACwithSHAKE256_params.getInstance(new DerSequence(
+            Assert.IsTrue(Arrays.AreEqual(new KMacWithShake256Params(512, customizationString).GetEncoded(),
+                KMacWithShake256Params.GetInstance(new DerSequence(
                 new Asn1Encodable[] { new DerOctetString(customizationString) })).GetEncoded()));
 
-            KMACwithSHAKE128_params p128 = new KMACwithSHAKE128_params(256, customizationString);
+            KMacWithShake128Params p128 = new KMacWithShake128Params(256, customizationString);
             Assert.AreEqual(256, p128.OutputLength);
             Assert.IsTrue(Arrays.AreEqual(customizationString, p128.CustomizationString));
-            Assert.IsTrue(p128 == KMACwithSHAKE128_params.getInstance(p128));
+            Assert.IsTrue(p128 == KMacWithShake128Params.GetInstance(p128));
 
-            KMACwithSHAKE256_params p256 = new KMACwithSHAKE256_params(512, customizationString);
+            KMacWithShake256Params p256 = new KMacWithShake256Params(512, customizationString);
             Assert.AreEqual(512, p256.OutputLength);
             Assert.IsTrue(Arrays.AreEqual(customizationString, p256.CustomizationString));
-            Assert.IsTrue(p256 == KMACwithSHAKE256_params.getInstance(p256));
+            Assert.IsTrue(p256 == KMacWithShake256Params.GetInstance(p256));
 
-            p128 = new KMACwithSHAKE128_params(512);
+            p128 = new KMacWithShake128Params(512);
             Assert.AreEqual(512, p128.OutputLength);
             Assert.IsTrue(Arrays.AreEqual(new byte[0], p128.CustomizationString));
 
-            p256 = new KMACwithSHAKE256_params(256);
+            p256 = new KMacWithShake256Params(256);
             Assert.AreEqual(256, p256.OutputLength);
             Assert.IsTrue(Arrays.AreEqual(new byte[0], p256.CustomizationString));
         }