You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To allow parts of the data to be encrypted with different $K_{data}$ keys,
570
582
more than one of this packet type may be present.
571
583
If there is more than one, the \kw{data\_encryption\_method} MUST be the same for all of them to prevent problems
572
-
with random access in the encrypted file.
584
+
with random access in the encrypted file. If the data encryption methods are mixed, the file MUST be rejected.
585
+
586
+
When \kw{data\_encryption\_method} is \kw{chacha20\_ietf\_poly1305\_with\_AEAD}, the AEAD mode is activated and each
587
+
\kw{data\_key} is followed by an 8-bytes unsigned integer \kw{sequence\_number}, which forms part of the authenticated data used to encrypt part of the file.
588
+
Application of the AEAD mode to the plain-text is described in section~\ref{data:AEAD_encrypting_mode}.
573
589
574
590
\subsubsection{data\_edit\_list packet}
575
591
@@ -671,20 +687,6 @@ \subsubsection{Reading the header}
671
687
If more than one \kw{data\_edit\_list} packet is present, the file SHOULD be rejected.
ChaCha20 is a stream cipher which maps a 256-bit key, nonce and counter to a 512-bit key-stream block.
717
+
In IETF mode the nonce is 96 bits long and the counter is 32 bits.
718
+
The counter starts at 1, and is incremented by 1 for each successive key-stream block.
719
+
The cipher-text is the plain-text message combined with the key-stream using the bit-wise exclusive-or operation.
720
+
721
+
Poly1305 is used to generate a 16-byte message authentication code (MAC) over the cipher-text.
722
+
As the MAC is generated over the entire cipher-text it is not possible to authenticate partially decrypted data.
723
+
724
+
ChaCha20 and Poly1305 are combined using the AEAD construction described in section 2.8 of \cite{RFC8439}.
725
+
This construction allows additional authenticated data (AAD) to be included in the Poly1305 MAC calculation.
726
+
In case the selected encryption method is \kw{chacha20\_ietf\_poly1305}, the AAD is zero bytes long.
727
+
In case the selected encryption method is \kw{chacha20\_ietf\_poly1305\_with\_AEAD}, the AAD is a 8-bytes little-endian number (section~\ref{data:AEAD_encrypting_mode}).
0 commit comments