[noise] Test vector format

Alex alex at centromere.net
Wed Apr 20 14:01:49 PDT 2016


On Tue, 19 Apr 2016 19:14:41 +1000
Rhys Weatherley <rhys.weatherley at gmail.com> wrote:

> > An update on this for the list.  Noise-C now passes all of the  
> cacophony.txt test cases from Alex after some bug fixes by me.  There
> was one minor issue with the Curve448 test vectors due to a bug in
> the upstream Haskell crypto library, which Alex has addressed.
> 

The branch from which that file was retrieved no longer exists and is
now available here[0] instead (NB: huge file).

Below is a brief summary of the format:

{
"vectors": [
{
"name": "arbitrary string",
"pattern": "NN|KN|NK|KK|NX|KX|XN|IN|XK|IK|XX|IX|XR|N|K|X",
"dh": "25519|448",
"cipher": "AESGCM|ChaChaPoly",
"hash": "SHA256|SHA512|BLAKE2s|BLAKE2b",
"fail": false|true,
"init_prologue": "hex string",
"init_psk": "hex string",
"init_static": "hex string",
"init_semiephemeral": "hex string",
"init_ephemeral": "hex string",
"init_remote_static": "hex string",
"init_remote_semiephemeral": "hex string",
"resp_prologue": "hex string",
"resp_psk": "hex string",
"resp_static": "hex string",
"resp_semiephemeral": "hex string",
"resp_ephemeral": "hex string",
"resp_remote_static": "hex string",
"resp_remote_semiephemeral": "hex string",
"messages": [
{
"payload": "hex string",
"ciphertext": "hex string"
}, ...
]
}, ...
]
}

All "init_" and "resp_" keys (/except/ the prologues) are optional and
may be null or omitted entirely. The "fail" key, if omitted, defaults
to false. All other keys are mandatory.

The messages array describes a conversation alternating between the
initiator and responder, starting with the initiator. No distinction is
made between when the handshake begins and when it is complete. I.e.,
if a handshake pattern has three messages in it, the responder will
send the first non-handshake Noise message. For one-way patterns the
messages simply flow from the initiator to the responder.

-- 
Alex

[0] https://github.com/centromere/cacophony/blob/master/vectors/cacophony.txt


More information about the Noise mailing list