-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Crypto: Add BouncyCastle signatures and block cipher modes #20575
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
This commit adds the `KeyGenerationOperationInstance` and `KeyGenerationAlgorithmInstance` types to the BouncyCastle model. It also adds data flow support from key pairs to the corresponding public and private components.
This commit also adds associated elliptic curves to the key generation and key nodes.
This commit adds support for ECDSA. This includes tracking the instantiated curve parameters using data flow. It also adds SignatureArtifactInstance and SignatureOperationInstance types to the shared model.
This commit adds EllipticCurveConsumingAlgorithmInstance to the shared model, allowing us to model and graph elliptic curve algorithms.
Co-authored-by: Arthur Baars <aibaars@github.com>
This commit also reorganizes the Bouncy Castle test cases into separate sub-directories for signature and cipher modes.
- Signature operations are now handled by a single algorithm instance - All key generation operations except generic EC key generation operations are now handled by a single algorithm instance - Ed25519 and Ed448 key generation have the algorithm set to Ed25519 and Ed448 respectively - For generic EC key generation operations the algorithm is given by the corresponding curve (since these could be used for either ECDSA or ECDH)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request adds comprehensive BouncyCastle cryptographic library support to the quantum framework, implementing signature algorithms, block cipher modes, and elliptic curve operations. The changes extend the modeling capabilities to cover BouncyCastle's low-level API patterns including signatures (ECDSA, Ed25519, Ed448, LMS), block cipher modes (CBC, GCM), and key generation.
- Adds a new BouncyCastle module with operation instances, algorithm instances, and flow analysis for signature algorithms and block cipher modes
- Extends the quantum model with elliptic curve consuming algorithms and signature algorithms including LMS, HSS, and MLDSA
- Implements comprehensive test suites demonstrating the analysis of BouncyCastle's low-level APIs for signatures and block cipher modes
Reviewed Changes
Copilot reviewed 71 out of 71 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
shared/quantum/codeql/quantum/experimental/Model.qll | Adds elliptic curve consuming algorithms and new signature types |
java/ql/lib/experimental/quantum/Language.qll | Integrates BouncyCastle module into quantum framework |
java/ql/lib/experimental/quantum/BouncyCastle/ | New module implementing BouncyCastle-specific operation instances, algorithm instances, and flow analysis |
java/ql/test/stubs/bcprov-lts8on-2.73.7/ | Comprehensive test stubs for BouncyCastle library classes |
java/ql/test/experimental/library-tests/quantum/BouncyCastle/ | Test cases validating signature algorithms and block cipher modes |
* Gets the consumer of the signature that is being verified in case of a | ||
* verification operation. |
Copilot
AI
Oct 2, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicate documentation comment - the same description is repeated twice. Remove the duplicate lines.
* Gets the consumer of the signature that is being verified in case of a | |
* verification operation. |
Copilot uses AI. Check for mistakes.
This pull request is a copy of the #19568 branch created to make changes to those contributions.