{
  "type": "object",
  "properties": {
    "algorithm": {
      "enum": [
        "ML-KEM"
      ]
    },
    "header": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "additional documentation"
    },
    "notes": {
      "$ref": "common.json#/definitions/Notes"
    },
    "numberOfTests": {
      "type": "integer",
      "description": "the number of test vectors in this test"
    },
    "schema": {
      "enum": [
        "mlkem_test_schema.json"
      ]
    },
    "testGroups": {
      "type": "array",
      "items": {
        "$ref": "#/definitions/MLKEMTestGroup"
      }
    }
  },
  "required": [
    "algorithm",
    "numberOfTests",
    "schema",
    "testGroups"
  ],
  "additionalProperties": false,
  "definitions": {
    "MLKEMTestGroup": {
      "type": "object",
      "description": "A test for KeyGen and/or Decaps",
      "properties": {
        "type": {
          "enum": [
            "MLKEMTest"
          ],
          "description": "A legacy field, test files contain only one type per file"
        },
        "source": {
          "$ref": "common.json#/definitions/Source"
        },
        "parameterSet": {
          "enum": [
            "ML-KEM-512",
            "ML-KEM-768",
            "ML-KEM-1024"
          ]
        },
        "tests": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "tcId": {
                "type": "integer",
                "description": "Identifier of the test case"
              },
              "comment": {
                "type": "string",
                "description": "A brief description of the test case"
              },
              "seed": {
                "type": "string",
                "format": "HexBytes",
                "description": "The d || z seed"
              },
              "ek": {
                "type": "string",
                "format": "HexBytes",
                "description": "The encapsulation key derived from the seed"
              },
              "c": {
                "type": "string",
                "format": "HexBytes",
                "description": "An input ciphertext"
              },
              "K": {
                "type": "string",
                "format": "HexBytes",
                "description": "The output shared secret"
              },
              "result": {
                "$ref": "common.json#/definitions/Result"
              },
              "flags": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "A list of flags"
              }
            },
            "required": [
              "tcId",
              "flags",
              "seed",
              "c",
              "K",
              "result"
            ],
            "additionalProperties": false
          }
        }
      },
      "required": [
        "type",
        "source",
        "parameterSet",
        "tests"
      ],
      "additionalProperties": false
    }
  }
}
