[noise] Test vector format
Trevor Perrin
trevp at trevp.net
Thu Apr 7 02:05:14 PDT 2016
On Wed, Apr 6, 2016 at 11:24 PM, Alex <alex at centromere.net> wrote:
> On Wed, 6 Apr 2016 22:38:53 -0700
> Trevor Perrin <trevp at trevp.net> wrote:
>
>> - Error testing might be better handled by specifying which
>> particular ciphertext should trigger an error. For example, have a
>> "payload": "ERROR" special value, instead of "should_fail". The test
>> framework will expect decrypting the corresponding ciphertext to fail.
>>
>
> I tend to dislike special values. What about a '"fail": true' key?
I don't see much difference.
>> - I think I agree with Jonathan that pattern / cipher / hash /
>> curve-type can be specified once, outside the party-specific blocks.
>>
>
> The handshakes and keys can be defined outside of the vector array
> entirely. I've attached an updated schema. What do you think?
Hmm, don't love the complexity of internal cross-references.
I think the priority here is a format that's super easy to consume, so
there's no excuse for developers not to use it, and so it's easy for
library consumers to re-test, and integrate the tests into build
processes, etc.
In that spirit I'd prefer my previous example where there's a rigid
boilerplate template that gets filled in for each test.
That's easy to produce, you just plug values into a template string.
It's easy to consume via streaming, just readline(), then a couple
string operations to pull out the next value.
Making it JSON so it's easy to consume with a JSON parser is
consistent with the idea of making consumption easy, as long as we're
just giving the consumer an extra option. But requiring them to
handle nested parsing, and streaming JSON, and arbitrary-ordered
fields, and varying whitespace, just makes other parsing strategies
harder, without much gain.
> Would it be reasonable to commit full JSON documents to the repository
> as "master" copies, but also include a small script which can
> auto-generate new documents in the format you're after?
Don't really see the point. Why not just generate the master copies
by filling in a template string, and not need JSON or extra scripts?
Trevor
More information about the Noise
mailing list