From 53b3d8e0d1185112150c335d1325a8d8245380ab Mon Sep 17 00:00:00 2001 From: Roy Basmacier Date: Mon, 11 Jul 2022 11:18:42 -0400 Subject: Added SIKE to PrivateKeyFactory.cs and changed SikeVectorTest.cs --- crypto/src/pqc/crypto/utils/PrivateKeyFactory.cs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'crypto/src') diff --git a/crypto/src/pqc/crypto/utils/PrivateKeyFactory.cs b/crypto/src/pqc/crypto/utils/PrivateKeyFactory.cs index 009cadedf..0fadab855 100644 --- a/crypto/src/pqc/crypto/utils/PrivateKeyFactory.cs +++ b/crypto/src/pqc/crypto/utils/PrivateKeyFactory.cs @@ -13,6 +13,7 @@ using Org.BouncyCastle.Pqc.Crypto.Cmce; using Org.BouncyCastle.Pqc.Crypto.Lms; using Org.BouncyCastle.Pqc.Crypto.Picnic; using Org.BouncyCastle.Pqc.Crypto.Saber; +using Org.BouncyCastle.Pqc.Crypto.Sike; using Org.BouncyCastle.Pqc.Crypto.SphincsPlus; using Org.BouncyCastle.Utilities; @@ -97,6 +98,13 @@ namespace Org.BouncyCastle.Pqc.Crypto.Utilities return new PicnicPrivateKeyParameters(picnicParams, keyEnc); } + if (algOID.On(BCObjectIdentifiers.pqc_kem_sike)) + { + byte[] keyEnc = Asn1OctetString.GetInstance(keyInfo.ParsePrivateKey()).GetOctets(); + SIKEParameters sikeParams = PqcUtilities.SikeParamsLookup(keyInfo.PrivateKeyAlgorithm.Algorithm); + + return new SIKEPrivateKeyParameters(sikeParams, keyEnc); + } throw new Exception("algorithm identifier in private key not recognised"); -- cgit 1.4.1