~mdw
/
tripe
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
server/bulkcrypto.c: Adjust the scale in the data-format diagrams.
[tripe]
/
server
/
bulkcrypto.c
diff --git
a/server/bulkcrypto.c
b/server/bulkcrypto.c
index
9af4bb8
..
10b51d6
100644
(file)
--- 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.
*
* 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
*
* 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.
*
* 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.
*
* 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
*
*
* 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.
*
*
* 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.
*
* 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
*
*
* 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.
*
* 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
*
* A stream is generated by concatenating the raw output blocks generated
* with this nonce and successive counter values starting from zero. The