Skip to content

Use a more common JSON formatting #162

@davidben

Description

@davidben

When writing some test vectors, I noticed that the JSON formatting is a bit uneven. It looks like the original Wycheproof test put a space before the : in JSON dictionaries, which is a bit uncommon. I see we've already had other test vectors, such as ML-DSA, which use the more conventional pattern: only a space after the :.

I propose we use a uniform encoding, and use one without the extra space. (I.e. we run a tool to rewrite all the old vectors.) The value of a more common encoding is that contributors can more easily add test vectors without a ton of diff noise. This came up when I was putting together #161 and had to figure out how to reproduce the original formatting. It happens that Python has a separators parameter to reproduce it but other APIs (JS, Go) only control the indent . We should pick a convention that the most tools can reproduce easily.

(Even better would be if there were some tool for folding a contributor's test vector set into the combined file, and then the formatting would be whatever that tool thinks it is, but either way I think we would be better served by a more conventional formatting.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions