Subject: Re: [quicwg/base-drafts] Test vectors (#2274)

From: Rui Paulo <[email-masked]>
Date: Tue, 01 Jan 2019 15:09:09 -0800

Nice!  I think the script would be helpful!

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/quicwg/base-drafts/pull/2274#issuecomment-450764011

---

From: Martin Thomson <[email-masked]>
Date: Tue, 01 Jan 2019 15:40:52 -0800

@martinthomson pushed 1 commit.

22873bd9623e487160c6000532478c43821c1917  Add script used for generating test vectors

-- 
You are receiving this because you are subscribed to this thread.
View it on GitHub:
https://github.com/quicwg/base-drafts/pull/2274/files/fae7aa46da4a9c396b145fa300cc54431271c0c3..22873bd9623e487160c6000532478c43821c1917

---

From: Alessandro Ghedini <[email-masked]>
Date: Fri, 04 Jan 2019 10:53:12 -0800

ghedo requested changes on this pull request.

FWIW I also verified the vectors with my implementation.

> @@ -0,0 +1,278 @@
+#!/bin/sh
+':' //; exec "$(command -v nodejs || command -v node)" "$0" "$@"
+
+// This script performs simple encryption and decryption for Initial packets.
+// It's crude, but it should be sufficient to generate examples.
+
+
+'use strict';
+var buffer = require('buffer');
+var crypto = require('crypto');
+var assert = require('assert');
+
+var INITIAL_SECRET = Buffer.from('ef4fb0abb47470c41befcf8031334fae485e09a0', 'hex');

INITIAL_SALT?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/quicwg/base-drafts/pull/2274#pullrequestreview-189470724

---

From: Kazuho Oku <[email-masked]>
Date: Fri, 04 Jan 2019 11:41:54 -0800

I've added the test vector to the unit test of quicly, so that I can continue confirming the values as the draft evolves. And of course, the current test vector decrypts successfully.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/quicwg/base-drafts/pull/2274#issuecomment-451547608

---

From: Marten Seemann <[email-masked]>
Date: Fri, 04 Jan 2019 23:02:42 -0800

marten-seemann commented on this pull request.

I also added the vector to a unit test of quic-go, and I'm getting the same values.
As noted in my in-line comment, I'd prefer to use different packet numbers for both packets sent from client and server.

+~~~
+060040c4010000c003036660261ff947 cea49cce6cfad687f457cf1b14531ba1
+4131a0e8f309a1d0b9c4000006130113 031302010000910000000b0009000006
+736572766572ff01000100000a001400 12001d00170018001901000101010201
+03010400230000003300260024001d00 204cfdfcd178b784bf328cae793b136f
+2aedce005ff183d7bb14952072366470 37002b0003020304000d0020001e0403
+05030603020308040805080604010501 060102010402050206020202002d0002
+0101001c00024001
+~~~
+
+The unprotected header includes the connection ID and a 4 byte packet number
+encoding:
+
+~~~
+c3ff000012508394c8f03e51570800449f00000000

Can we use a different packet number than 0 here? XORing the IV with 0 is special case when calculating the nonce for the AEAD, so I'd prefer to use *any* other value here.

+The server sends the following payload in response, including an ACK frame, a
+CRYPTO frame, and no PADDING frames:
+
+~~~
+0d0000000018410a020000560303eefc e7f7b37ba1d1632e96677825ddf73988
+cfc79825df566dc5430b9a045a120013 0100002e00330024001d00209d3c940d
+89690b84d08a60993c144eca684d1081 287c834d5311bcf32bb9da1a002b0002
+0304
+~~~
+
+The header from the server includes a new connection ID and a 2-byte packet
+number encoding:
+
+~~~
+c1ff00001205f067a5502a4262b50040740000

Same here.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/quicwg/base-drafts/pull/2274#pullrequestreview-189587995

---

From: Martin Thomson <[email-masked]>
Date: Sun, 06 Jan 2019 15:42:49 -0800

@martinthomson pushed 2 commits.

08feb310f45762c3f42a873114e7e170bc893082  initial salt
a23d9f763cc190d37764ed1e76de6e1449d84b43  Use different packet numbers

-- 
You are receiving this because you are subscribed to this thread.
View it on GitHub:
https://github.com/quicwg/base-drafts/pull/2274/files/22873bd9623e487160c6000532478c43821c1917..a23d9f763cc190d37764ed1e76de6e1449d84b43

---

From: Martin Thomson <[email-masked]>
Date: Sun, 06 Jan 2019 15:43:37 -0800

Thanks everyone for checking these values.  At @marten-seemann's request, I've tweaked the packet numbers.  That means new values, but I'll assume that these are OK.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/quicwg/base-drafts/pull/2274#issuecomment-451786583

---

From: Kazuho Oku <[email-masked]>
Date: Sun, 06 Jan 2019 16:06:40 -0800

Confirmed that the updated version correctly decrypts and gives PN=2.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/quicwg/base-drafts/pull/2274#issuecomment-451788327

---

From: Martin Thomson <[email-masked]>
Date: Sun, 06 Jan 2019 16:11:23 -0800

Thanks @kazuho, that's enough for me :)

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/quicwg/base-drafts/pull/2274#issuecomment-451788715

---

From: Martin Thomson <[email-masked]>
Date: Sun, 06 Jan 2019 16:11:29 -0800

Merged #2274 into master.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/quicwg/base-drafts/pull/2274#event-2056527005

---

From: Marten Seemann <[email-masked]>
Date: Sun, 06 Jan 2019 18:13:23 -0800

Thanks @martinthomson! I updated my test vectors in quic-go, and I can confirm that the new values work.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/quicwg/base-drafts/pull/2274#issuecomment-451801331