{
  "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_encaps_test_schema.json"
      ]
    },
    "testGroups": {
      "type": "array",
      "items": {
        "$ref": "#/definitions/MLKEMEncapsTestGroup"
      }
    }
  },
  "required": [
    "algorithm",
    "numberOfTests",
    "schema",
    "testGroups"
  ],
  "additionalProperties": false,
  "definitions": {
    "MLKEMEncapsTestGroup": {
      "type": "object",
      "description": "A test for Encaps",
      "properties": {
        "type": {
          "enum": [
            "MLKEMEncapsTest"
          ],
          "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"
              },
              "ek": {
                "type": "string",
                "format": "HexBytes",
                "description": "The encapsulation key"
              },
              "m": {
                "type": "string",
                "format": "HexBytes",
                "description": "The ML-KEM.Encaps_internal m input"
              },
              "c": {
                "type": "string",
                "format": "HexBytes",
                "description": "The output 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",
              "ek",
              "m",
              "c",
              "K",
              "result"
            ],
            "additionalProperties": false
          }
        }
      },
      "required": [
        "source",
        "parameterSet",
        "tests"
      ],
      "additionalProperties": false
    }
  }
}
