Skip to content

Conversation

bdrodes
Copy link
Contributor

@bdrodes bdrodes commented Oct 3, 2025

Adding initial JCA signature models. We still need to address RSASSA-PSS, but that will be in a separate PR. Adding comprehensive JCA unit tests. Also modeled the JCA random number generator within the crypto model. Note it is already modeled generally in CodeQL Java, but to be consistent, we have modeled it within the crypto infrastructure as well.

@bdrodes bdrodes requested a review from a team as a code owner October 3, 2025 17:34
@Copilot Copilot AI review requested due to automatic review settings October 3, 2025 17:34
Copy link
Contributor

@Copilot Copilot AI left a 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 PR adds comprehensive modeling for JCA (Java Cryptography Architecture) signatures, random number generation, and unit tests to the quantum experimental cryptography library. The main focus is on implementing signature models for various algorithms while updating type naming conventions throughout the shared quantum infrastructure.

Key changes include:

  • Addition of comprehensive JCA signature models and unit tests with over 1,500 test cases covering various cryptographic operations
  • Improved naming consistency in quantum standardization types (replacing "Unknown" with "Other" prefixes)
  • Addition of random number generator modeling within the crypto infrastructure
  • Bug fix in MAC operation classification logic

Reviewed Changes

Copilot reviewed 31 out of 33 changed files in this pull request and generated no comments.

Show a summary per file
File Description
shared/quantum/codeql/quantum/experimental/Standardization.qll Updates type naming from "Unknown" to "Other" for consistency
shared/quantum/codeql/quantum/experimental/Model.qll Fixes MAC operation classification logic bug
java/ql/test/experimental/library-tests/quantum/nodes.ql Adds test query for crypto nodes
java/ql/test/experimental/library-tests/quantum/nodes.expected Contains expected test results with 1,512 crypto operation nodes
java/ql/test/experimental/library-tests/quantum/node_properties.ql Adds test query for node properties
java/ql/test/experimental/library-tests/quantum/node_edges.ql Adds test query for node relationships
java/ql/test/experimental/library-tests/quantum/jca/*.java Multiple comprehensive test files covering JCA cryptographic operations

@nicolaswill nicolaswill changed the title JCA Signatures, Random Number Gen, and Unit Tests Crypto: Add JCA signatures, RNG, and unit tests Oct 6, 2025
Copy link
Contributor

@nicolaswill nicolaswill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One change as well as clarification needed around toUpperCase()

@nicolaswill
Copy link
Contributor

nicolaswill commented Oct 6, 2025

Executing check script: ascii-check.py
File "ql/java/ql/test/experimental/library-tests/quantum/jca/EllipticCurve2.java" contains a non-ASCII character at the location marked with | in:

19 for signatures)
 * - Other fallback (e.g., secp256r1 for |

File "ql/java/ql/test/experimental/library-tests/quantum/jca/MACOperation.java" contains a non-ASCII character at the location marked with | in:

rations and further use of MAC outputs as inputs into higher|

File "ql/java/ql/test/experimental/library-tests/quantum/jca/SymmetricAlgorithm.java" contains a non-ASCII character at the location marked with | in:

yte[] iv = new byte[12]; // Fixed IV (all zeros by default) |

File "ql/java/ql/test/experimental/library-tests/quantum/jca/SignatureOperation.java" contains a non-ASCII character at the location marked with | in:

message with Unicode characters.
        String nonAscii = "|

File "ql/java/ql/test/experimental/library-tests/quantum/jca/SignEncryptCombinations.java" contains a non-ASCII character at the location marked with | in:

<p>
     * **Issue:** The plaintext message is not encrypted|

File "ql/java/ql/test/experimental/library-tests/quantum/jca/KeyDerivation1.java" contains a non-ASCII character at the location marked with | in:

tionBasic: Uses PBKDF2WithHmacSHA256 with 10,000 iterations |

ASCII check failed!

Copy link
Contributor

@nicolaswill nicolaswill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-ASCII characters are causing a CI job to fail.

@nicolaswill nicolaswill merged commit e2a8d58 into github:main Oct 6, 2025
42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants