[noise] Noise test vector format

Trevor Perrin trevp at trevp.net
Tue Nov 10 19:08:51 PST 2015


Now that there's a few implementations being worked on, it would be
good to have test vectors everyone could check.

Below's a simple text format for test vectors.  An implementation
could scan a file full of tests and and check any handshakes it
supports.  For example:

# Below is a handshake block
# Test code will create an initiator and responder instance, generate keypairs
# as determined by the handshake, and send the following payloads as
# handshake or transport payloads, while checking equality of ciphertexts
# and correctness of decryption.
# Must be followed by declaration of random_i, random_r, and prologue byte
# sequences.  random_i and random_r represent the RNG output used for
# generating private keys

handshake=Noise_XX_25519_AESGCM_SHA256
random_i=<hex>
random_r=<hex>
prologue=<hex>
msg_0_payload=<hex>
msg_0_ciphertext=<hex>
msg_1_payload=<hex>
msg_1_ciphertext=<hex>
msg_2_payload=<hex>
msg_2_ciphertext=<hex>
msg_3_payload=<hex>
msg_3_ciphertext=<hex>
msg_4_payload=<hex>
msg_4_ciphertext=<hex>

# Another handshake block
handshake=Noise_N_448_ChaChaPoly_SHA512
random_i=<hex>
random_r=<hex>
prologue=<hex>
msg_0_payload=<hex>
msg_0_ciphertext=<hex>

...


Trevor


More information about the Noise mailing list