summary refs log tree commit diff
path: root/crypto/test
diff options
context:
space:
mode:
authorDavid Hook <david.hook@keyfactor.com>2022-10-14 06:57:49 +1100
committerDavid Hook <david.hook@keyfactor.com>2022-10-14 06:57:49 +1100
commit3ed028aa4a1034b9941443b2a1e164db7b4d626b (patch)
treec7ccbe8e267187ccb622ab0922da8dc25dc6618f /crypto/test
parentRevert mistaken framework change (diff)
downloadBouncyCastle.NET-ed25519-3ed028aa4a1034b9941443b2a1e164db7b4d626b.tar.xz
updated public key encoding to latest version of draft RFC
Diffstat (limited to 'crypto/test')
-rw-r--r--crypto/test/src/pqc/crypto/test/CrystalsDilithiumTest.cs4
1 files changed, 4 insertions, 0 deletions
diff --git a/crypto/test/src/pqc/crypto/test/CrystalsDilithiumTest.cs b/crypto/test/src/pqc/crypto/test/CrystalsDilithiumTest.cs
index 9d4d7fc9f..2d682179c 100644
--- a/crypto/test/src/pqc/crypto/test/CrystalsDilithiumTest.cs
+++ b/crypto/test/src/pqc/crypto/test/CrystalsDilithiumTest.cs
@@ -5,6 +5,7 @@ using NUnit.Framework;
 
 using Org.BouncyCastle.Crypto;
 using Org.BouncyCastle.Pqc.Crypto.Crystals.Dilithium;
+using Org.BouncyCastle.Pqc.Crypto.Utilities;
 using Org.BouncyCastle.Utilities;
 using Org.BouncyCastle.Utilities.Encoders;
 using Org.BouncyCastle.Utilities.Test;
@@ -71,6 +72,9 @@ namespace Org.BouncyCastle.Pqc.Crypto.Tests
             //Console.WriteLine(string.Format("{0} Expected pk       = {1}", pk.Length, Convert.ToHexString(pk)));
             //Console.WriteLine(String.Format("{0} Actual Public key = {1}", pubParams.GetEncoded().Length, Convert.ToHexString(pubParams.GetEncoded())));
 
+            pubParams = (DilithiumPublicKeyParameters)PublicKeyFactory.CreateKey(SubjectPublicKeyInfoFactory.CreateSubjectPublicKeyInfo(ackp.Public));
+            privParams = (DilithiumPrivateKeyParameters)PrivateKeyFactory.CreateKey(PrivateKeyInfoFactory.CreatePrivateKeyInfo(ackp.Private));
+
             Assert.True(Arrays.AreEqual(pk, pubParams.GetEncoded()), name + " " + count + ": public key");
             Assert.True(Arrays.AreEqual(sk, privParams.GetEncoded()), name + " " + count + ": secret key");