浏览代码

Merge pull request #2544 from enkore/docs/ids-chunklayout

docs/data structures: add chunk layout diagram
enkore 8 年之前
父节点
当前提交
334a7007da
共有 3 个文件被更改,包括 4 次插入3 次删除
  1. 4 3
      docs/internals/data-structures.rst
  2. 二进制
      docs/internals/encryption.png
  3. 二进制
      docs/internals/encryption.vsd

+ 4 - 3
docs/internals/data-structures.rst

@@ -451,9 +451,10 @@ Encryption
 
 
 AES_-256 is used in CTR mode (so no need for padding). A 64 bit initialization
 AES_-256 is used in CTR mode (so no need for padding). A 64 bit initialization
 vector is used, a MAC is computed on the encrypted chunk
 vector is used, a MAC is computed on the encrypted chunk
-and both are stored in the chunk.
-The header of each chunk is: ``TYPE(1)`` + ``MAC(32)`` + ``NONCE(8)`` + ``CIPHERTEXT``.
-Encryption and MAC use two different keys.
+and both are stored in the chunk. Encryption and MAC use two different keys.
+Each chunk consists of ``TYPE(1)`` + ``MAC(32)`` + ``NONCE(8)`` + ``CIPHERTEXT``:
+
+.. figure:: encryption.png
 
 
 In AES-CTR mode you can think of the IV as the start value for the counter.
 In AES-CTR mode you can think of the IV as the start value for the counter.
 The counter itself is incremented by one after each 16 byte block.
 The counter itself is incremented by one after each 16 byte block.

二进制
docs/internals/encryption.png


二进制
docs/internals/encryption.vsd