rules:
  - id: kotlin-weak-ecc-curve
    pattern-either:
      - pattern: KeyPairGenerator.getInstance("EC")
      - pattern: KeyPairGenerator.getInstance("ECDH")
      - pattern: KeyPairGenerator.getInstance("ECDSA")
      - pattern: ECGenParameterSpec(...)
      - pattern: KeyAgreement.getInstance("ECDH")
    message: >-
      QUANTUM VULNERABILITY: ECC/ECDSA/ECDH is broken by Shor's algorithm.
      Migrate to CRYSTALS-Dilithium (ML-DSA) for signatures or
      CRYSTALS-Kyber (ML-KEM) for key exchange.
    severity: ERROR
    languages: [kotlin]
    metadata:
      category: security
      cwe:
        - "CWE-327: Use of a Broken or Risky Cryptographic Algorithm"
      quantum_vulnerable: true
      quantum_attack: "Shor's Algorithm"
      quantum_risk_score: 10
