From fe8f738e093eede32b55b329a6a864eb680dc281 Mon Sep 17 00:00:00 2001 From: Peter Dettman Date: Tue, 18 Oct 2022 16:02:29 +0700 Subject: Refactoring in Pqc.Crypto.Bike (performance) --- crypto/test/src/pqc/crypto/test/BikeVectorTest.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'crypto/test/src') diff --git a/crypto/test/src/pqc/crypto/test/BikeVectorTest.cs b/crypto/test/src/pqc/crypto/test/BikeVectorTest.cs index 723f6b554..a25a27fe1 100644 --- a/crypto/test/src/pqc/crypto/test/BikeVectorTest.cs +++ b/crypto/test/src/pqc/crypto/test/BikeVectorTest.cs @@ -64,11 +64,13 @@ namespace Org.BouncyCastle.Pqc.Crypto.Tests kpGen.Init(genParam); AsymmetricCipherKeyPair kp = kpGen.GenerateKeyPair(); - BikePublicKeyParameters pubParams = (BikePublicKeyParameters)PublicKeyFactory.CreateKey(SubjectPublicKeyInfoFactory.CreateSubjectPublicKeyInfo((BikePublicKeyParameters) kp.Public)); - BikePrivateKeyParameters privParams = (BikePrivateKeyParameters)PrivateKeyFactory.CreateKey(PrivateKeyInfoFactory.CreatePrivateKeyInfo((BikePrivateKeyParameters) kp.Private)); + BikePublicKeyParameters pubParams = (BikePublicKeyParameters)PublicKeyFactory.CreateKey( + SubjectPublicKeyInfoFactory.CreateSubjectPublicKeyInfo((BikePublicKeyParameters) kp.Public)); + BikePrivateKeyParameters privParams = (BikePrivateKeyParameters)PrivateKeyFactory.CreateKey( + PrivateKeyInfoFactory.CreatePrivateKeyInfo((BikePrivateKeyParameters) kp.Private)); - Assert.True(Arrays.AreEqual(pk, pubParams.PublicKey), name + " " + count + ": public key"); - Assert.True(Arrays.AreEqual(sk, privParams.PrivateKey), name + " " + count + ": secret key"); + Assert.True(Arrays.AreEqual(pk, pubParams.GetEncoded()), name + " " + count + ": public key"); + Assert.True(Arrays.AreEqual(sk, privParams.GetEncoded()), name + " " + count + ": secret key"); // KEM Enc BikeKemGenerator BikeEncCipher = new BikeKemGenerator(random); -- cgit 1.5.1