Skip to content

Commit 7a629b3

Browse files
committed
Merge branch 'main' of gitlab.cryptoworkshop.com:root/bc-java
2 parents 9e17bdb + 37b18c2 commit 7a629b3

46 files changed

Lines changed: 4135 additions & 24 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎core/src/main/java/org/bouncycastle/asn1/bc/BCObjectIdentifiers.java‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -987,4 +987,13 @@ public interface BCObjectIdentifiers
987987
ASN1ObjectIdentifier aimer_192s = aimer.branch("4");
988988
ASN1ObjectIdentifier aimer_256f = aimer.branch("5");
989989
ASN1ObjectIdentifier aimer_256s = aimer.branch("6");
990+
991+
/**
992+
* SMAUG-T
993+
* */
994+
ASN1ObjectIdentifier pqc_kem_smaugt = bc_kem.branch("11");
995+
ASN1ObjectIdentifier smaugt_mode1 = pqc_kem_smaugt.branch("1");
996+
ASN1ObjectIdentifier smaugt_mode3 = pqc_kem_smaugt.branch("2");
997+
ASN1ObjectIdentifier smaugt_mode5 = pqc_kem_smaugt.branch("3");
998+
ASN1ObjectIdentifier smaugt_modet = pqc_kem_smaugt.branch("4");
990999
}

‎core/src/main/java/org/bouncycastle/asn1/gm/GMObjectIdentifiers.java‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,4 +106,22 @@ public interface GMObjectIdentifiers
106106
ASN1ObjectIdentifier sm2_pkcs7_signedAndEnvelopedData = sm2_pkcs7.branch("4");
107107
ASN1ObjectIdentifier sm2_pkcs7_encryptedData = sm2_pkcs7.branch("5");
108108
ASN1ObjectIdentifier sm2_pkcs7_keyAgreementInfoData = sm2_pkcs7.branch("6");
109+
110+
// GM/T 0081-2020 SM9 encryption and signature message syntax content types, clause 5 table 1.
111+
// Base arc 1.2.156.10197.6.1.4.4 - the SM9 sibling of the GM/T 0010-2012 SM2 arc above, with
112+
// the same six content types in the same order. The structures they identify are modelled on
113+
// PKCS#7 but are not interchangeable with it: GM/T 0081 SignedData keeps the PKCS#7 field
114+
// order and tags while replacing certificates [0] / crls [1] with ibcSysParamsPublishInfos [0]
115+
// / irls [1], so org.bouncycastle.asn1.pkcs.SignedData parses it and silently mislabels those
116+
// two sets. The mismatch only bites one level down, in SignerInfo, which identifies the signer
117+
// by an identity-based Identifier rather than an IssuerAndSerialNumber and carries an
118+
// SM9Signature SEQUENCE where PKCS#7 has an EncryptedDigest OCTET STRING.
119+
ASN1ObjectIdentifier sm9_pkcs7 = new ASN1ObjectIdentifier("1.2.156.10197.6.1.4.4");
120+
ASN1ObjectIdentifier sm9_pkcs7_data = sm9_pkcs7.branch("1");
121+
ASN1ObjectIdentifier sm9_pkcs7_signedData = sm9_pkcs7.branch("2");
122+
ASN1ObjectIdentifier sm9_pkcs7_envelopedData = sm9_pkcs7.branch("3");
123+
ASN1ObjectIdentifier sm9_pkcs7_signedAndEnvelopedData = sm9_pkcs7.branch("4");
124+
ASN1ObjectIdentifier sm9_pkcs7_encryptedData = sm9_pkcs7.branch("5");
125+
// GM/T 0081 names this object keyAgreementInfo; the SM2 constant above carries a Data suffix.
126+
ASN1ObjectIdentifier sm9_pkcs7_keyAgreementInfo = sm9_pkcs7.branch("6");
109127
}

0 commit comments

Comments
 (0)