From 3ed028aa4a1034b9941443b2a1e164db7b4d626b Mon Sep 17 00:00:00 2001 From: David Hook Date: Fri, 14 Oct 2022 06:57:49 +1100 Subject: updated public key encoding to latest version of draft RFC --- crypto/src/pqc/crypto/utils/SubjectPublicKeyInfoFactory.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'crypto/src/pqc') diff --git a/crypto/src/pqc/crypto/utils/SubjectPublicKeyInfoFactory.cs b/crypto/src/pqc/crypto/utils/SubjectPublicKeyInfoFactory.cs index 75a89c3f0..a919a71e5 100644 --- a/crypto/src/pqc/crypto/utils/SubjectPublicKeyInfoFactory.cs +++ b/crypto/src/pqc/crypto/utils/SubjectPublicKeyInfoFactory.cs @@ -116,10 +116,8 @@ namespace Org.BouncyCastle.Pqc.Crypto.Utilities DilithiumPublicKeyParameters parameters = (DilithiumPublicKeyParameters)publicKey; AlgorithmIdentifier algorithmIdentifier = new AlgorithmIdentifier(PqcUtilities.DilithiumOidLookup(parameters.Parameters)); - Asn1EncodableVector v = new Asn1EncodableVector(); - v.Add(new DerOctetString(parameters.Rho)); - v.Add(new DerOctetString(parameters.T1)); - return new SubjectPublicKeyInfo(algorithmIdentifier, new DerSequence(v)); + + return new SubjectPublicKeyInfo(algorithmIdentifier, new DerOctetString(Arrays.Concatenate(parameters.Rho, parameters.T1))); } if (publicKey is BikePublicKeyParameters) { -- cgit 1.4.1