← Back to Pull requests

generate_psa_tests: skip ML-DSA key types #324

Closed
unknown closed this pull request without merging on Oct 02, 2026 20:13 UTC
View on GitHub
unknown unknown commented on Oct 02, 2026 15:21 UTC
Author

This is my first contribution here, so please bear with me if I've missed any conventions — happy to adjust.

The PSA test-data generators iterate over every PSA_KEY_TYPE_* define found in the public headers, and as far as I can tell they assume that a key type's "bits" attribute is a bit size. ML-DSA doesn't fit that model: its bits attribute is a parameter set (44/65/87), so both sizes_to_test() and key_material() choke on it. With PSA_KEY_TYPE_ML_DSA_PUBLIC_KEY becoming public in Mbed-TLS/TF-PSA-Crypto#899, generate_psa_tests.py now
fails with a KeyError.

This PR skips ML-DSA key types in the affected generators (KeyTypeNotSupported, KeyGenerate, OpFail, StorageFormat) as a minimal stopgap. I suspect the nicer long-term fix is to teach crypto_knowledge.py proper ML-DSA support — presumably that lands with TF-PSA-Crypto #900/#901 when key pairs and signatures arrive — so I'm very open to this being replaced or reworked once that happens, or sooner if you'd rather do it properly right away.

  • TF-PSA-Crypto development PR provided #____ (to follow — I'll open it right after this one and edit the number in)

  • TF-PSA-Crypto 1.1 PR not required because: I believe this only matters where PSA_KEY_TYPE_ML_DSA_PUBLIC_KEY is public, which is development only — 1.1 doesn't have ML-DSA. Correct me if I'm wrong.

  • mbedtls development PR not required because: as I understand it, no mbedtls-side change is needed here; it would pick this up through its normal submodule bumps once TF-PSA-Crypto#899 is consumed

  • mbedtls 4.1 PR not required because: ML-DSA public keys aren't in 4.1 as far as I know

  • mbedtls 3.6 PR not required because: ML-DSA isn't present in 3.6
  • Diff: 216 lines (+162 / -54) across 2 files Reviewer: gilles-peskine-arm Review duration: 291m
    All Vouch review confidence checks passed
    Residual risk 0.14 = Change Risk (0.37) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.37 · 216 lines diff across 2 files
    0.37
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.322
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #324"
    general weight: 0.35
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 36.6% (MEDIUM) · Higher = larger blast radius
    36.6%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 14.5% · Safe to merge
    14.5%