usnistgov / ACVP-Server

A repository tracking releases of NIST's ACVP server. See www.github.com/usnistgov/ACVP for the protocol.
46 stars 16 forks source link

KMAC: XOF option issue #198

Closed smuellerDD closed 2 years ago

smuellerDD commented 2 years ago

environment Demo

The specification of XOF seems to cause an issue on the ACVP server for KMAC.

The following registration

   "algorithms":[
      {
        "revision":"1.0",
        "algorithm":"KMAC-256",
        "hexCustomization":true,
        "msgLen":[
          {
            "min":16,
            "max":65536,
            "increment":8
          }
        ],
        "outputLen":[
          {
            "min":16,
            "max":65536,
            "increment":8
          }
        ],
        "xof":false,
        "keyLen":[
          {
            "min":128,
            "max":524288,
            "increment":8
          }
        ],
        "macLen":[
          {
            "min":32,
            "max":65536,
            "increment":8
          }
        ]
      },
      {
        "revision":"1.0",
        "algorithm":"KMAC-256",
        "hexCustomization":true,
        "msgLen":[
          {
            "min":16,
            "max":65536,
            "increment":8
          }
        ],
        "outputLen":[
          {
            "min":16,
            "max":65536,
            "increment":8
          }
        ],
        "xof":true,
        "keyLen":[
          {
            "min":128,
            "max":524288,
            "increment":8
          }
        ],
        "macLen":[
          {
            "min":32,
            "max":65536,
            "increment":8
          }
        ]
      }

causes the issue:

  {
    "error": "Invalid JSON provided.",
    "context": "The JSON value could not be converted to System.Collections.Generic.List\u00601[System.Boolean]. Path: $.xof | LineNumber: 0 | BytePositionInLine: 217."
  }

When removing the XOF definition entirely (keyword is not set), I get:

  {
    "error": "Validation error(s) on JSON payload.",
    "context": [
      "KMAC-256-1.0: General exception. Contact service provider.",
      "KMAC-256-1.0: General exception. Contact service provider."
    ]
  }
]
livebe01 commented 2 years ago

Hi @smuellerDD, can you try updating the value of "xof" to be an array of boolean? See Table 2 and the example KMAC registration in Appendix A

smuellerDD commented 2 years ago

Yes, putting it into an array works. Thanks for the hint and sorry for the noise.