From d2d5c7c917b666e0e5385d7c6123cdbe4ef0bab8 Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Sun, 22 Sep 2019 14:36:21 +0100 Subject: [PATCH] server/bulkcrypto.c: Adjust the scale in the data-format diagrams. Two spaces per byte seems to work well. --- server/bulkcrypto.c | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/server/bulkcrypto.c b/server/bulkcrypto.c index 9af4bb8c..10b51d60 100644 --- a/server/bulkcrypto.c +++ b/server/bulkcrypto.c @@ -285,10 +285,10 @@ static void gencomp_freechal(bulkchal *bc) * encrypt the input message with the cipher, and format the type, sequence * number, IV, and ciphertext as follows. * - * +------+ +------+---...---+------...------+ - * | type | | seq | iv | ciphertext | - * +------+ +------+---...---+------...------+ - * 32 32 blksz sz + * +--------+ +--------+---...---+------...------+ + * | type | | seq | iv | ciphertext | + * +--------+ +--------+---...---+------...------+ + * 32 32 blksz sz * * All of this is fed into the MAC to compute a tag. The type is not * transmitted: the other end knows what type of message it expects, and the @@ -296,10 +296,10 @@ static void gencomp_freechal(bulkchal *bc) * kind of ciphertext has been substituted. The tag is prepended to the * remainder, to yield the finished cryptogram, as follows. * - * +---...---+------+---...---+------...------+ - * | tag | seq | iv | ciphertext | - * +---...---+------+---...---+------...------+ - * tagsz 32 blksz sz + * +---...---+--------+---...---+------...------+ + * | tag | seq | iv | ciphertext | + * +---...---+--------+---...---+------...------+ + * tagsz 32 blksz sz * * Decryption: checks the overall size, verifies the tag, then decrypts the * ciphertext and extracts the sequence number. @@ -527,10 +527,10 @@ static int v0_decrypt(bulkctx *bbc, unsigned ty, * * So, a MAC is computed over * - * +------+ +------+------...------+ - * | type | | seq | ciphertext | - * +------+ +------+------...------+ - * 32 32 sz + * +--------+ +--------+------...------+ + * | type | | seq | ciphertext | + * +--------+ +--------+------...------+ + * 32 32 sz * * and we actually transmit the following as the cryptogram. * @@ -824,17 +824,17 @@ static int iiv_decrypt(bulkctx *bbc, unsigned ty, * Catacomb's current AEAD schemes are suitable.) The low 32 bits are the * sequence number, and the high 32 bits are the type, both big-endian. * - * +------+------+ - * | seq | type | - * +------+------+ - * 32 32 + * +--------+--------+ + * | seq | type | + * +--------+--------+ + * 32 32 * * The ciphertext is formatted as * - * +---...---+------+------...------+ - * | tag | seq | ciphertext | - * +---...---+------+------...------+ - * tagsz 32 sz + * +---...---+--------+------...------+ + * | tag | seq | ciphertext | + * +---...---+--------+------...------+ + * tagsz 32 sz * */ @@ -1149,10 +1149,10 @@ static int aead_decrypt(bulkctx *bbc, unsigned ty, * Salsa20 and ChaCha accept a 64-bit nonce. The low 32 bits are the * sequence number, and the high 32 bits are the type, both big-endian. * - * +------+------+ - * | seq | type | - * +------+------+ - * 32 32 + * +--------+--------+ + * | seq | type | + * +--------+--------+ + * 32 32 * * A stream is generated by concatenating the raw output blocks generated * with this nonce and successive counter values starting from zero. The -- 2.11.0