Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use JSON Schema instead of prose descriptions. #83

Open
duesee opened this issue Feb 10, 2023 · 2 comments
Open

Use JSON Schema instead of prose descriptions. #83

duesee opened this issue Feb 10, 2023 · 2 comments

Comments

@duesee
Copy link
Contributor

duesee commented Feb 10, 2023

We could replace the test case descriptions with JSON Schema and check the test vectors in CI. This way, it cannot happen that things get out-of-sync. I could give it a try when we want it :-)

@bifurcation
Copy link
Collaborator

It's a nice idea, but I don't think anyone will actually use this in practice. I would note that there are also semantics here that will not be captured by JSON Schema, e.g., the fact that a string represents a hex-encoded, TLS-serialized struct of a certain type.

Might be useful as a finishing touch once we have an agreed-upon set of test vectors, but probably not during development.

@bifurcation bifurcation added this to the Test vector finalization milestone Feb 13, 2023
@duesee
Copy link
Contributor Author

duesee commented Feb 14, 2023

Yeah, maybe. The idea was also to agree on how to document the test vectors in a consistent way. I saw JSON Schema used for this in Project Wycheproof and found it to be very helpful. But I agree that it's probably too early to think about this. Edit: Unless, we use JSON Scheme to discuss the structure of new vectors or so.

Regarding the hex-semantics: Wycheproof uses, e.g., ...

        "key": {
          "type": "string",
          "format": "HexBytes",
          "description": "the key"
        },

... to define a hex-encoded key. There are some pre-defined formats in JSON Scheme but AFAIK "HexBytes" is none of them. So I'm not sure a validation tool could validate that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants