Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
3241 commits
Select commit Hold shift + click to select a range
81196e6
Merge branch 'pgpainless-fixHashedSubpacketsNull'
dghgit Mar 4, 2026
c39c027
Merge branch 'fixSelfSigSelection' of https://github.com/pgpainless/b…
dghgit Mar 4, 2026
657b7d0
Merge branch 'pgpainless-fixSelfSigSelection'
dghgit Mar 4, 2026
9eab8ed
Merge branch 'pgpsecretkeyV6directkeysig' of https://github.com/pgpai…
dghgit Mar 4, 2026
13ce3ad
Merge branch 'pgpainless-pgpsecretkeyV6directkeysig'
dghgit Mar 4, 2026
a1553af
Merge branch 'rsaKeyGeneration' of https://github.com/pgpainless/bc-j…
dghgit Mar 4, 2026
7b094ad
Merge branch 'pgpainless-rsaKeyGeneration'
dghgit Mar 4, 2026
94abbd5
Fix Frodo error sampling to be constant-time
peterdettman Mar 4, 2026
9643807
Refactor AESTest
peterdettman Mar 4, 2026
c6ec8c2
Use AESEngine.newInstance
peterdettman Mar 4, 2026
97fbab5
Refactoring in constant-time utils
peterdettman Mar 4, 2026
9f14109
More Pack methods
peterdettman Mar 4, 2026
5c22553
More Nat methods
peterdettman Mar 4, 2026
8692e6b
Refactoring in pqc.crypto.frodo
peterdettman Mar 4, 2026
bd43571
PKCS12KeyStoreSpi.java in tls can now write as well as read PBMAC1 pk…
Mar 5, 2026
8ce7aa8
Adaptedtls to support custom certificate types.
xipki Sep 18, 2025
91263d1
Followup for CertificateType changes (github #2165)
peterdettman Mar 5, 2026
48e8857
removed unused file, removed interal dependencies on prov module.
dghgit Mar 6, 2026
d275858
updated unit tests to track if the piped thread is stuck #2245
Mar 9, 2026
dc12926
read whole stream to prevent piped thread stuck #2245
Mar 9, 2026
8939236
fixed styling for java brackets #2245
Mar 9, 2026
5afa4ad
NTRU only in BCPQC
peterdettman Mar 9, 2026
d91537f
Use CryptoServicesRegistrar for auto-created SecureRandom
peterdettman Mar 9, 2026
c463222
Re-enable tests that need java.security conf
peterdettman Mar 9, 2026
10f2143
Fix package for jdk17 KEM tests
peterdettman Mar 9, 2026
031922a
Rename jdk17 test classes to avoid conflicts
peterdettman Mar 9, 2026
510d7e4
Rename jdk17 test classes to avoid conflicts
peterdettman Mar 9, 2026
e363a8e
CMS: Use BCPQC for NTRU tests
peterdettman Mar 9, 2026
32979da
Refactor, include some missing ".OID." entries
peterdettman Mar 9, 2026
ca8f1a9
From JDK11, test for NamedParameterSpec
peterdettman Mar 9, 2026
0093eeb
Use BCPQC for NTRU tests
peterdettman Mar 9, 2026
23646ad
Whitespace cleanup
peterdettman Mar 9, 2026
21e880b
Cleanup PKCS12-PBMAC1 changes
peterdettman Mar 9, 2026
e1993b3
Cleanup PKCS12-PBMAC1 changes
peterdettman Mar 9, 2026
36b83a6
Revert name change for gradle's sake
peterdettman Mar 9, 2026
6b98972
Cleanup warnings
peterdettman Mar 10, 2026
82df3ea
Update Falcon mappings
peterdettman Mar 10, 2026
0cc62b8
Use BCPQC for NTRU tests
peterdettman Mar 10, 2026
b5dd429
Cleanup jdk25 warnings
peterdettman Mar 10, 2026
5abd0e0
Register ".OID." variants too
peterdettman Mar 10, 2026
70dcd6c
Refactor DRBG
peterdettman Mar 10, 2026
8c5c54e
Cleanup warnings
peterdettman Mar 10, 2026
fa1cab3
Quick fix for broken tests: check jdk.tls.disableAlgorithms security …
peterdettman Mar 10, 2026
882c55e
Cleanup warnings
peterdettman Mar 10, 2026
94d11dc
Use Strings.lineSeparator
peterdettman Mar 10, 2026
c1e229b
added "the real" PKCS12-PBMAC1 key store.
dghgit Mar 11, 2026
826cee0
Merge branch 'main' of gitlab.cryptoworkshop.com:root/bc-java
dghgit Mar 11, 2026
fbe302f
minor cleanup
dghgit Mar 11, 2026
fa4336a
added setEncoding() method
dghgit Mar 11, 2026
4eb4ba6
Merge branch '2245-PipedInputStream-fix-with-getSafeInstance' of http…
dghgit Mar 11, 2026
e057cf9
Merge branch 'marijusGood-2245-PipedInputStream-fix-with-getSafeInsta…
dghgit Mar 11, 2026
64f5354
relates to github #2265
dghgit Mar 11, 2026
6b51636
added extra example test.
dghgit Mar 12, 2026
ccb059b
use FIDO_ED_25519 for parsing fido ed25519 keys
Mar 10, 2026
f2602bb
Refactoring in crypto.util
peterdettman Mar 12, 2026
5047bdf
Fix incorrect Javadoc in EllipticCurveKeyPairGenerator example.
Joowon-Seo Mar 12, 2026
eda7ebf
Fix typos in (ASN1)PKIXNameConstraintValidator
peterdettman Mar 12, 2026
8234202
Merge branch 'main' of gitlab.cryptoworkshop.com:root/bc-java
dghgit Mar 13, 2026
807bf8a
added work around property for "odd" JSAFE files.
dghgit Mar 13, 2026
e34cc8b
added mismatched curve test for ECDH.
dghgit Mar 15, 2026
0ca6c53
added test for differing MQV EC domain parameters - relates to github…
dghgit Mar 15, 2026
3883819
added test for differing MQV EC domain parameters - relates to github…
dghgit Mar 15, 2026
39e864f
minor clean up in JavaDoc
dghgit Mar 16, 2026
b0dd3c1
corrected keyWrap function to use set PRF.
dghgit Mar 18, 2026
ab7fc5e
Address PKIXNameConstraintValidator Bug
xSammyKang Feb 20, 2026
7830384
additional test for PBMAC1, fixed merge conflicts
Mar 18, 2026
645b1c7
fix the change of name
Mar 18, 2026
b4e4eb8
Followup for name constraint validation fix
peterdettman Mar 18, 2026
19150a7
Simplify MQVTest and fix error message
peterdettman Mar 18, 2026
9cc90c6
Refactor OID parsing
peterdettman Mar 23, 2026
248716d
Use helper to create AlgorithmParameters
peterdettman Mar 24, 2026
539887a
Update OID map
peterdettman Mar 24, 2026
fb2baac
Remove redundant static class specifiers
peterdettman Mar 24, 2026
b7b6a1c
Fix the issue in the pipeline
Mar 25, 2026
1f1190d
Update alt. NameConstraint validators
peterdettman Mar 25, 2026
9623c6b
Refactor NameConstraint validator classes
peterdettman Mar 25, 2026
4b6c361
Cleanup NIST CertPath tests
peterdettman Mar 25, 2026
855d507
Avoid depending on Set .toString method for error message
peterdettman Mar 25, 2026
15fc20e
Remove redundant static class specifiers
peterdettman Mar 25, 2026
9f6d911
Refactor CertPath validator classes
peterdettman Mar 25, 2026
84ba827
Restore case-sensitive filenames
peterdettman Mar 25, 2026
bb1ce2c
Add bitLength method to Integers, Longs
peterdettman Mar 26, 2026
1bd4e62
Update ASN.1 BitString from bc-csharp
peterdettman Mar 26, 2026
b914fc2
added HQC support to encapsulation lookup.
dghgit Mar 31, 2026
4ff1194
Merge branch 'main' of gitlab.cryptoworkshop.com:root/bc-java
dghgit Mar 31, 2026
11b17cc
commented out r3 only tests
dghgit Mar 31, 2026
8a471e5
changed examples to use HKDF SHA256
dghgit Mar 31, 2026
4fe9e47
Fix javadoc
peterdettman Mar 31, 2026
e19238d
Cleanup unused variables
peterdettman Mar 31, 2026
6490ec9
Add getssuerPrincipal from attr. cert.
peterdettman Mar 31, 2026
dc2684e
Refactor CertPath validator classes
peterdettman Mar 31, 2026
ac0b6c7
Fix exception messages
peterdettman Mar 31, 2026
f2528f3
Refactor RFC3280CertPathUtilities
peterdettman Mar 31, 2026
7e9c112
Use explicit boxing
peterdettman Apr 1, 2026
ffc08a7
TLS jdk1.4 updates
peterdettman Apr 1, 2026
a10b458
TLS: Improved PQC cert validation in JcaTlsCrypto
peterdettman Apr 1, 2026
da68a7e
Followup for TLS PQC validation fix
peterdettman Apr 1, 2026
5d44779
Refactor ReedSolomon.encode
peterdettman Apr 3, 2026
d4efaba
Openpgp getencryptionkeys
ligefeiBouncycastle Apr 4, 2026
fcedfe3
Merge branch 'openpgp-getEncryptionKeys' into 'main'
dghgit Apr 4, 2026
94b98de
Openpgp openpgpkeyconstructor
ligefeiBouncycastle Apr 4, 2026
fdd430a
Merge branch 'openpgp-openpgpkeyConstructor' into 'main'
dghgit Apr 4, 2026
240134e
AbstractOpenPGPDocumentSignatureGenerator: Properly apply signature c…
ligefeiBouncycastle Apr 4, 2026
80c4426
Merge branch 'openpgp-applySignatureCreationTime' into 'main'
dghgit Apr 4, 2026
ac369c1
Openpgp decryptwildcardpkesk
ligefeiBouncycastle Apr 4, 2026
0bacc55
Merge branch 'openpgp-decryptWildcardPKESK' into 'main'
dghgit Apr 4, 2026
656bae0
ensured generic composite always checks at least one signature. Added…
dghgit Apr 4, 2026
f9540ea
Merge branch 'main' of gitlab.cryptoworkshop.com:root/bc-java
dghgit Apr 4, 2026
5be47dd
removed deprecation, seems these are actually needed.
dghgit Apr 5, 2026
0976c80
removed deprecation, seems these are actually needed.
dghgit Apr 5, 2026
0252742
added system properties to allow setting of max read length and max c…
dghgit Apr 5, 2026
e1a979e
cleared property to avoid contaminating later tests.
dghgit Apr 5, 2026
65bf633
cleared property to avoid contaminating later tests.
dghgit Apr 5, 2026
00eb352
constant time/side-channel improvements
dghgit Apr 5, 2026
08e172b
added use of depth property to deal with dodgy ASN.1
dghgit Apr 5, 2026
405086a
updated providers to 1.84
dghgit Apr 6, 2026
e76a2d8
moved bike, picnic, sphincsplus, and rainbow to legacy
dghgit Apr 6, 2026
74077f8
promoted pqc/crypto/mldsa to the universal crypto package. Deprecated…
dghgit Apr 6, 2026
0503ef0
promoted pqc/crypto/mldsa to the universal crypto package. Deprecated…
dghgit Apr 6, 2026
d7c6af3
promoted mlkem to standard crypto package.
dghgit Apr 6, 2026
6fb0886
commented out legacy algorithms
dghgit Apr 7, 2026
608bc24
refactoring - simplified use of SLHDSAEngine
dghgit Apr 7, 2026
0e053a6
promoted SLHDSA to main crypto package.
dghgit Apr 7, 2026
0179acb
promoted SLHDSA to main crypto package.
dghgit Apr 7, 2026
dcf5860
correct NTRU+ from bc_sig to bc_kem.
Apr 7, 2026
127cffa
Refactoring around ASN.1 External type
peterdettman Apr 7, 2026
424d90d
More work on jdk25 KDF support
peterdettman Apr 7, 2026
091e249
Dynamic check for KEMSpi in jdk17
peterdettman Apr 7, 2026
d650f31
BCJSSE: ShangMi suites for TLS 1.3 (RFC 8998)
Feb 21, 2026
3dba8e9
ML-DSA, SLH-DSA keys are now in normal API
peterdettman Apr 8, 2026
2bb52f5
Add OpenPGPComponentSignature.verify() method
vanitasvitae Mar 10, 2026
533f7bb
Rework methods for accessing self-signatures
vanitasvitae Mar 10, 2026
94b972e
getSignatureChainFor(): Constrain chains to origin
vanitasvitae Mar 10, 2026
89d6fa1
Add methods for accessing third-party signatures for web-of-trust imp…
vanitasvitae Mar 10, 2026
dbbde9d
Add documentation for OpenPGPSignatureChain
vanitasvitae Mar 11, 2026
991c20a
Improve documentation of certification/delegation/revocation getters
vanitasvitae Mar 11, 2026
1bf44a6
Fix javadoc
vanitasvitae Mar 11, 2026
dce1e46
reformat OpenPGPCertificate
Apr 5, 2026
eb6efd0
Merge branch 'openpgp-missingGetRevocation' into 'main'
dghgit Apr 8, 2026
b9f7baa
BCJSSE: Further work on RFC 8998 (now experimental)
peterdettman Apr 8, 2026
3ed4f6f
These signers do actually do need randomness
peterdettman Apr 8, 2026
66ba74f
changed public method returning internal class in GcmSpecUtil to retu…
dghgit Apr 8, 2026
6a1a7fb
removed println
dghgit Apr 8, 2026
4371ec5
Merge branch 'main' of gitlab.cryptoworkshop.com:root/bc-java
dghgit Apr 8, 2026
2b7f1d5
PKCS12-PBMAC1 no longer needed in BCJSSE
peterdettman Apr 8, 2026
dc65548
RFC 9380 Hashing to Elliptic Curves
Razumain Nov 16, 2025
3d94239
Reformat hash2curve, minor refactoring
peterdettman Apr 8, 2026
d175373
Restore KDFAlgorithmProvider
peterdettman Apr 8, 2026
b69dbfe
Remove deprecation for BitString and OctetString parsers
peterdettman Apr 8, 2026
a5e50d3
Refactor PKCS12PfxPdu
peterdettman Apr 8, 2026
67956ab
PKCS12: Throw IOException for missing ContentInfo content
peterdettman Apr 8, 2026
fa59cc2
PKCS12: improve validation of iteration counts
peterdettman Apr 8, 2026
bf5a783
Update old jdk versions of PKCS12KeyStoreSpi
peterdettman Apr 8, 2026
7e0d85b
1.5 to 1.8 compatibility fixes.
dghgit Apr 9, 2026
346ec44
added neg iteration count test.
dghgit Apr 9, 2026
e1231ea
Guarded iterations loop
peterdettman Apr 9, 2026
970d8d4
Delegate JceTlsMLKemDomain functionality to KemUtil
peterdettman Apr 9, 2026
9b3fc33
TLS: Use javax.crypto.KEM API when available
peterdettman Apr 9, 2026
9713cb3
minor cleanup, Java 4 updates.
dghgit Apr 10, 2026
3f8d769
Merge branch 'main' of gitlab.cryptoworkshop.com:root/bc-java
dghgit Apr 10, 2026
bfd148c
minor cleanup, Java 4 updates.
dghgit Apr 11, 2026
8775f0c
correct curve lookup
dghgit Apr 11, 2026
746af49
added NTRU back, subject to final NTT feedback
dghgit Apr 11, 2026
39118aa
minor cleanup, Java 4 and 5 updates.
dghgit Apr 11, 2026
cad3ace
marked SPHINCSPlus and Dilithium for deprecation.
dghgit Apr 11, 2026
76e0136
moved to 1.84
dghgit Apr 12, 2026
4dedef1
added CVE numbers
dghgit Apr 13, 2026
ebcf060
Update release notes for 1.84
peterdettman Apr 13, 2026
c3cbbef
initial update
dghgit Apr 14, 2026
dc45902
update release notes for openpgp, SM2/4 and NTRU+
Apr 14, 2026
ee68871
final updates
dghgit Apr 15, 2026
4da25d5
format issue
dghgit Apr 15, 2026
a523239
typo...
dghgit Apr 15, 2026
22847da
added missing CVE
dghgit Apr 15, 2026
cbfe765
corrected CVE number
dghgit Apr 15, 2026
d716d77
fixed typo in CVE
dghgit Apr 15, 2026
00df193
moved to 1.0.24 - fips 23 releases now going out.
dghgit Apr 16, 2026
b2e7520
increased MAX_CONS_DEPTH to 64 - turns out 32 is not big enough.
dghgit Apr 21, 2026
f3623fb
increased MAX_CONS_DEPTH to 64 - turns out 32 is not big enough.
dghgit Apr 21, 2026
0d29783
Refactoring in tls tests
peterdettman Apr 21, 2026
9225e08
Cleanup in tls
peterdettman Apr 21, 2026
dd9e383
Cleanup in tls
peterdettman Apr 21, 2026
4c59cc8
Refactor PKCS#12 code
peterdettman Apr 21, 2026
c7fb857
Add parameterless constructor for ScryptWithUTF8
peterdettman Apr 22, 2026
ffa28e4
ASN.1: Rework depth and limit checking
peterdettman Apr 22, 2026
34645f5
added Mayo support to CMS/PKIX
dghgit Apr 22, 2026
6925874
Merge branch 'main' of gitlab.cryptoworkshop.com:root/bc-java
dghgit Apr 22, 2026
9a8ee88
added property for limiting Argon2 memory usage - relates to github #…
dghgit Apr 23, 2026
b7eaf8f
moved to 1.85 beta release
dghgit Apr 23, 2026
41989f9
removed bizzare inclusion of old pqc factory. Relates to github #2287
dghgit Apr 23, 2026
33716ca
added support for MAYO-N naming
dghgit Apr 24, 2026
d7f7d95
updated section numbers, added 1.85
dghgit Apr 24, 2026
50b45d9
added new Argon2 property
dghgit Apr 24, 2026
1ff948a
added support for MAYO-N naming
dghgit Apr 24, 2026
4eb637c
fixed memory range check
dghgit Apr 28, 2026
3c50bb1
Improve exception messages
peterdettman Apr 29, 2026
631242f
Refactor prov build.gradle
peterdettman Apr 29, 2026
0197957
Refactor CMSSignedHelper
peterdettman Apr 29, 2026
1c0cf75
ecdsa_plain_SHA1 => noParams for consistency
peterdettman Apr 29, 2026
c459037
Update noParams list in NewSIgnedDataTest
peterdettman Apr 29, 2026
82c183c
Refactoring in cert.ocsp
peterdettman Apr 29, 2026
d083987
Merge branch 'main' of gitlab.cryptoworkshop.com:root/bc-java
dghgit May 1, 2026
8a32189
rationalised ProvRecovationOscpChecker relates to github #2254
dghgit May 1, 2026
2aa0926
rationalised ProvRecovationOscpChecker relates to github #2254
dghgit May 1, 2026
1939817
Refactor ASN1Boolean
peterdettman May 1, 2026
dd44ecb
added support for PBEKey storage, relates to #2164
dghgit May 1, 2026
d37c5d9
added support additional setters, relates to #1545
dghgit May 1, 2026
67cbc0d
Merge branch 'main' of gitlab.cryptoworkshop.com:root/bc-java
dghgit May 1, 2026
bba6163
Update StreamUtil in old java versions
peterdettman May 1, 2026
d30f6bb
Reduce tmp buffers used by ASN1InputStream
peterdettman May 1, 2026
a5409ad
corrected padding, relates to #2214
dghgit May 1, 2026
106ab8f
Merge branch 'main' of gitlab.cryptoworkshop.com:root/bc-java
dghgit May 2, 2026
295d8dc
added CMS support for RFC 8418, relates to #1845.
dghgit May 2, 2026
9f73faf
generalised BlockPool support in Argon2, relates to github #1647
dghgit May 2, 2026
af79374
Added use of Exceptions class to propogate cause, relates to github #…
dghgit May 2, 2026
9a3ce13
Added use of Exceptions class to propogate cause, relates to github #…
dghgit May 2, 2026
a08bb94
Added use of Exceptions class to propogate cause for IllegalStateExce…
dghgit May 2, 2026
bf11c90
Corrected casing of Falcon naming when used with NamedParameterSpec, …
dghgit May 2, 2026
eda070d
Corrected casing of Falcon naming when used with NamedParameterSpec, …
dghgit May 2, 2026
0a31f6c
re-added old composite lookup - needs to be deprecated out.
dghgit May 2, 2026
467cac8
annotated return with TODO - relates to github #837
dghgit May 2, 2026
2f7f39a
added missing names - relates to github #1763
dghgit May 2, 2026
b71f930
updated test for message check to use cause.
dghgit May 2, 2026
02fc493
updated test for message check to use cause.
dghgit May 2, 2026
4b2c49f
added mode support to SM2, relates to github #1302
dghgit May 2, 2026
0a01811
added SM2 patch
dghgit May 2, 2026
5086e68
corrected expiry time check to allow for later packets which increase…
dghgit May 2, 2026
b80da46
Fixed case issues in Falcon name.
dghgit May 2, 2026
4e28866
Updated validity test.
dghgit May 3, 2026
153da24
Added legacy parsing of encrypted EdEC keys. Relates to github #1238
dghgit May 3, 2026
6b169b3
Added use of Exceptions class to propogate cause for IOException, rel…
dghgit May 3, 2026
eaebef1
Added cause to GeneralSecurityException throw, relates to github #2250
dghgit May 3, 2026
527488a
Added null check to prevent attempt to validate trust anchor without …
dghgit May 3, 2026
22e9e8d
Added additional methods to SimplePKIResponse and builder class, rela…
dghgit May 3, 2026
cf2f521
Added basic KeyGrip calculator for RSA keys, relates to github #676
dghgit May 3, 2026
5490432
Added support for SM2 as a CMS KeyTransport cipher, relates to github…
dghgit May 3, 2026
cbfae08
Added certificate based SM2 test, relates to github #584
dghgit May 3, 2026
31fe836
Initial support for SecretBag, relates to github #890
dghgit May 3, 2026
a46adf3
Added PBMAC1 support to pkcs package MAC verifier provider.
dghgit May 3, 2026
63a0d11
Added name and OID search, relates to github #1230
dghgit May 4, 2026
a0aeb44
initial CLAUDE.md
dghgit May 4, 2026
790ac4b
removed possible recursion on misconfigured CertPath validations, rel…
dghgit May 4, 2026
aa7d3f6
generalized openSSH ECDSA key encoding, relates to github #2240
dghgit May 4, 2026
71ede26
tweak on misconfigured CertPath validations, relates to github #2291
dghgit May 4, 2026
cace5d1
re-added commented out tests.
dghgit May 4, 2026
c7f57bd
added missing tests
dghgit May 4, 2026
65e218e
added missing tests
dghgit May 4, 2026
c2cb354
added external hash to HashMLDSASigner, relates to github #2198
dghgit May 4, 2026
c2c5d52
Update SLHDSAParameters.java
chen-cht May 5, 2026
f67f7ef
Update SLHDSAEngine.java
chen-cht May 5, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
4 changes: 2 additions & 2 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ jobs:
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# - run: |
echo "Run, Build Application using script"
gradle clean build
# echo "Run, Build Application using script"
# gradle clean build

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@
*.swp
*.iml
*/*.iml
*.ipr
*.iws

bin/
build/
*/build/
libs/*.jar
out/
*/out/
.settings/
Expand All @@ -21,7 +24,7 @@ pg/*.bak
pg/*.bpg
pg/*.txt

.idea
.idea/

codesigning.jks

Expand Down
79 changes: 60 additions & 19 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,71 @@
stages:
- check
- build
- test
- publish
- sync

check-code:
stage: check
script:
- "apply_overlay bc-java ./"
- ". cienv.sh; \ gradle check -x test;"

test-code-8:
stage: test
- "ecr_login"
- "ecr_pull vm_base_intel latest"
- "ci_docker_run \"vm_base_intel:latest\" \"bc-java\" \"/workspace/bc-java/ci/check_java.sh\""
artifacts:
when: always
paths:
- "core/build/reports"
- "prov/build/reports"
- "pg/build/reports"
- "pkix/build/reports"
- "mail/build/reports"
- "util/build/reports"
- "tls/build/reports"
- "mls/build/reports"

ant-build:
stage: build
needs: [ "check-code" ]
script:
- "apply_overlay bc-java ./"
- "sh gettestdata.sh"
- ". cienv-8.sh; \ gradle -stacktrace clean build;"

test-code-11:
- "ecr_login"
- "ecr_pull vm_base_intel latest"
- "ci_docker_run \"vm_base_intel:latest\" \"bc-java\" \"/workspace/bc-java/ci/build_1_8.sh\""


test-code:
stage: test
needs: [ "check-code" ]
script:
- "apply_overlay bc-java ./"
- "sh gettestdata.sh"
- ". cienv-11.sh; \ gradle -stacktrace clean build;"

test-code-17:
stage: test
- "ecr_login"
- "ecr_pull vm_base_intel latest"
- "ci_docker_run \"vm_base_intel:latest\" \"bc-java\" \"/workspace/bc-java/ci/test.sh\""
artifacts:
when: always
reports:
junit:
- "core/build/test-results/**/*.xml"
- "prov/build/test-results/**/*.xml"
- "pg/build/test-results/**/*.xml"
- "pkix/build/test-results/**/*.xml"
- "mail/build/test-results/**/*.xml"
- "util/build/test-results/**/*.xml"
- "tls/build/test-results/**/*.xml"
- "mls/build/test-results/**/*.xml"


publish:
stage: publish
rules:
- if: $CI_COMMIT_BRANCH == "main"
script:
- "apply_overlay bc-java-pub ./"
- "ecr_login"
- "ecr_pull vm_base_intel latest"
- "ci_docker_run \"vm_base_intel:latest\" \"bc-java\" \"/workspace/bc-java/ci/pub.sh\""

spongycastle:
stage: "sync"
rules:
- if: $CI_COMMIT_BRANCH == "main"
script:
- "apply_overlay bc-java ./"
- "sh gettestdata.sh"
- ". cienv-17.sh; \ gradle -stacktrace clean build;"
- "syncpongy.sh"
78 changes: 78 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

## Build & test

The build is Gradle multi-module. JDK 21+ is required to drive Gradle. Optional environment variables `BC_JDK8`, `BC_JDK11`, `BC_JDK17`, `BC_JDK21`, `BC_JDK25` opt in version-specific test tasks (compiled against MR-jar overlays). The default `:test` aggregates `:core:test :prov:test :prov:test11 :prov:test15 :prov:test17 :pkix:test :pg:test :tls:test :mls:test :mail:test :jmail:test`.

```
./gradlew clean build # full build + all tests
./gradlew :prov:compileJava :prov:compileTestJava # quick compile-only check
./gradlew :prov:test --tests <fqcn> # one JUnit class
./gradlew -PexcludeTests=<glob> :prov:test # exclude pattern
```

`bc-test-data` (separate repo `bcgit/bc-test-data`) must be checked out as a sibling of `bc-java` for the full suite to pass; the Gradle property `bcTestDataHome` defaults to `core/src/test/data`.

### Running an individual test fast

Most BC tests extend `org.bouncycastle.util.test.SimpleTest` and have a `main()` that registers `BouncyCastleProvider` and runs `performTest()`. Gradle's `:test` only matches `AllTest*` JUnit wrappers (which iterate over `RegressionTest.tests` arrays and run each `SimpleTest`). To iterate quickly on one test, run its `main()` directly — much faster than spinning up Gradle:

```
java -cp pkix/build/classes/java/main:pkix/build/classes/java/test:pkix/src/test/resources:\
prov/build/classes/java/main:core/build/classes/java/main:core/build/classes/java/test:\
util/build/classes/java/main:$(find ~/.gradle -name 'junit-*.jar' | head -1) \
org.bouncycastle.openssl.test.ParserTest
```

Test resources live under `*/src/test/resources` and must be on the classpath. Failures inside `performTest()` print `<TestName>: <message>`; success prints `<TestName>: Okay`.

## Architecture

### Module graph and the `core`-into-`prov` trap

```
core ── lightweight crypto API (engines, digests, ASN.1, math, params)
util ── ASN.1/X.500 helpers used by pkix
prov ── JCA/JCE provider (BouncyCastleProvider, BouncyCastlePQCProvider) — depends on core
pkix ── X.509 / CMS / TSP / OCSP / PKCS#12 / OpenSSL PEM — depends on prov
pg ── OpenPGP — depends on prov
tls ── TLS API + JSSE provider — depends on prov
mail / jmail ── S/MIME on top of CMS — depends on pkix
mls ── Messaging Layer Security
```

**Important quirk**: `prov/build.gradle` adds `core/src/main/java` directly to its `srcDirs`. The published `bcprov-<vmrange>.jar` therefore contains both the `core` lightweight API **and** the `prov` JCE provider classes. Practical implications:

- Editing a file under `core/src/main/java/...` will be compiled twice — once by `:core:compileJava`, once by `:prov:compileJava`. If a stale `prov` class file persists after a `core` change, classes loaded from `prov/build/classes/...` may shadow your edit. When in doubt, run `:prov:compileJava --rerun-tasks` or clear `prov/build/classes`.
- A change in `core` can break `prov` tests that compile against both source trees.

### Multi-Release JAR overlays

`prov`, `pkix`, `pg`, `tls`, etc. ship as MR-jars. Inside each module:

- `src/main/java` — base sources, compiled with `--release 8`
- `src/main/jdk1.9`, `jdk1.11`, `jdk1.15`, `jdk17`, `jdk25` — version-specific overlays packaged under `META-INF/versions/<n>/`
- `src/main/j2me`, `src/main/jdk1.1` … `jdk1.5`, `src/main/ext-jdk1.9` — alternate distributions for the legacy Ant builds (J2ME, pre-1.6 JDKs). **Gradle does not compile these.** Don't edit them when fixing a Gradle-build bug; they're separate trees maintained for the J2ME/legacy distributions.

The same applies to tests: `src/test/java` is the Gradle-driven tree; `src/test/jdk1.4`, `src/test/j2me`, `src/test/jdk1.1` are alternate trees, while `src/test/jdk1.11`, `jdk1.15`, `jdk17`, `jdk25` are MR-jar test overlays driven by the `test11`/`test15`/`test17`/`test25` Gradle tasks.

### JCE provider registration

`BouncyCastleProvider` (in `prov`) registers algorithms by string name through `ConfigurableProvider.addAlgorithm("Cipher.SM2", "...GMCipherSpi$SM2")` etc. Per-algorithm registration code lives in `prov/src/main/java/org/bouncycastle/jcajce/provider/{asymmetric,symmetric,digest,keystore,...}/<Family>.java`. The corresponding `*Spi` classes (CipherSpi, KeyFactorySpi, KeyPairGeneratorSpi, etc.) are siblings under the same package. When adding or fixing a JCE-visible behaviour, the registration `Family.java` is the entry point; the underlying lightweight engine usually lives in `core/src/main/java/org/bouncycastle/crypto/engines/`.

### Test conventions

- Most tests extend `org.bouncycastle.util.test.SimpleTest` (not JUnit). They override `performTest()` and call `fail(msg)` / `isTrue(msg, cond)` / `areEqual(a, b)`. They are *not* discovered by Gradle directly — they're invoked from JUnit `AllTests` / `RegressionTest` wrappers.
- `RegressionTest.tests` arrays (one per package) list every `SimpleTest` to be run. When you add a new `SimpleTest`, also add a call from a parent test or from `RegressionTest`.
- Tests pass `-Dbc.test.data.home=<core/src/test/data>` for fixture lookups.
- The `:test` task runs each test class in its own JVM (`forkEvery = 1`).

### Exception messages are part of the test contract

Many tests assert on exact exception message text (e.g. `isTrue(e.getMessage().equals("..."))` or `getCause().getMessage()` checks). Changing the wording of a thrown exception — even something as small as adding a colon, rewording for clarity, or wrapping with `Exceptions.illegalArgumentException(...)` — will silently break tests in another module. Before modifying any exception message, grep the whole tree for the existing string and update every matching assertion in lockstep.

### Release notes

Defects fixed and additional features go into `docs/releasenotes.html` under the **current** unreleased version block (e.g. section 2.1 with header "Release: 1.85"). Each entry is a single `<li>...</li>` referencing the GitHub issue number where applicable. The file is hand-edited HTML; preserve the existing prose style and `<ul>` structure.
51 changes: 51 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Bouncy Castle Contributing Guidelines <!-- omit in toc -->

Thank you for contributing to Bouncy Castle!

In this guide, you get an overview of the contribution workflow from starting a discussion or opening an issue, to creating, reviewing, and merging a pull request.

For an overview of the project, see [README](README.md).

### Start a discussion
If you have a question or problem, you can [search in discussions](https://github.com/bcgit/bc-java/discussions), if someone has already found a solution to your problem.

Or you can [start a new discussion](https://github.com/bcgit/bc-java/discussions/new/choose) and ask your question.

### Create an issue

If you find a problem with Bouncy Castle, [search if an issue already exists](https://github.com/bcgit/bc-java/issues).

> **_NOTE:_** If the issue is a __potential security problem__, please contact us
before posting anything public. See [Security Policy](SECURITY.md).

If a related discussion or issue doesn't exist, and the issue is not security related, you can [open a new issue](https://github.com/bcgit/bc-java/issues/new). An issue can be converted into a discussion if regarded as one.

### Contribute to the code

For substantial, non-trivial contributions, you may be asked to sign a contributor assignment agreement. Optionally, you can also have your name and contact information listed in [Contributors](https://www.bouncycastle.org/contributors.html).

Please note we are unable to accept contributions which cannot be released under the [Bouncy Castle License](https://www.bouncycastle.org/licence.html). Issuing a pull request on our public github mirror is taken as agreement to issuing under the Bouncy Castle License.

#### Create a pull request

> **_NOTE:_** If the issue is a __potential security problem__, please contact us. See [Security Policy](SECURITY.md).

You are welcome to send patches, under the Bouncy Castle License, as pull requests. For more information, see [Creating a pull request](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request). For minor updates, you can instead choose to create an issue with short snippets of code. See above.

* For contributions touching multiple files try and split up the pull request, smaller changes are easier to review and test, as well as being less likely to run into merge issues.
* Create a test cases for your change, it may be a simple addition to an existing test. If you do not know how to do this, ask us and we will help you.
* If you run into any merge issues, check out this [git tutorial](https://github.com/skills/resolve-merge-conflicts) to help you resolve merge conflicts and other issues.

For more information, refer to the Bouncy Castle documentation on [Getting Started with Bouncy Castle](https://doc.primekey.com/bouncycastle/introduction#Introduction-GettingStartedwithBouncyCastle).

#### Self-review

Don't forget to self-review. Please follow these simple guidelines:
* Keep the patch limited, only change the parts related to your patch.
* Do not change other lines, such as whitespace, adding line breaks to Java doc, etc. It will make it very hard for us to review the patch.


#### Your pull request is merged

For acceptance, pull requests need to meet specific quality criteria, including tests for anything substantial. Someone on the Bouncy Castle core team will review the pull request when there is time, and let you know if something is missing or suggest improvements. If it is a useful and generic feature it will be integrated in Bouncy Castle to be available in a later release.

Loading