From 35909ba94ad602e76aeab6e344ec79c3c27b9be6 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Tue, 21 Feb 2017 15:15:28 +1030 Subject: [PATCH] cryptomsg: wording fix with update to latest BOLT. Signed-off-by: Rusty Russell --- lightningd/cryptomsg.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lightningd/cryptomsg.c b/lightningd/cryptomsg.c index b39becdec..a62d8d44b 100644 --- a/lightningd/cryptomsg.c +++ b/lightningd/cryptomsg.c @@ -229,7 +229,9 @@ struct io_plan *peer_write_message(struct io_conn *conn, * * * Encrypt `l` using `ChaChaPoly-1305`, `sn`, and `sk` to obtain `lc` * (`18-bytes`) - * * The nonce `sn` is encoded as a 96-bit big-endian number. + * * The nonce `sn` is encoded as a 96-bit little-endian number. + * As our decoded nonces a 64-bit, we encode the 96-bit nonce as + * follows: 32-bits of leading zeroes followed by a 64-bit value. * * The nonce `sn` MUST be incremented after this step. * * A zero-length byte slice is to be passed as the AD */