浏览代码

update doc - chacha20poly1305_memory + gcm_memory

Karel Miko 7 年之前
父节点
当前提交
7d8567695b
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6 0
      doc/crypt.tex

+ 6 - 0
doc/crypt.tex

@@ -2305,6 +2305,9 @@ int gcm_memory(
 This will initialize the GCM state with the given key, IV and AAD value then proceed to encrypt or decrypt the message text and store the final
 This will initialize the GCM state with the given key, IV and AAD value then proceed to encrypt or decrypt the message text and store the final
 message tag.  The definition of the variables is the same as it is for all the manual functions.
 message tag.  The definition of the variables is the same as it is for all the manual functions.
 
 
+IMPORTANT NOTICE: for \textit{direction == GCM\_DECRYPT} the caller has to fill \textit{tag} and \textit{taglen} with expected
+tag value. The \textit{gcm\_memory} in decrypt mode validates the \textit{tag} value and returns \textit{CRYPT\_ERROR} on mismatch.
+
 If you are processing many packets under the same key you shouldn't use this function as it invokes the pre--computation with each call.
 If you are processing many packets under the same key you shouldn't use this function as it invokes the pre--computation with each call.
 
 
 \subsection{Example Usage}
 \subsection{Example Usage}
@@ -2515,6 +2518,9 @@ encrypt (\textit{direction} equals \textbf{CHACHA20POLY1305\_ENCRYPT}) or decryp
 \textbf{CHACHA20POLY1305\_DECRYPT}) the message text and store the final message tag. The definition of the
 \textbf{CHACHA20POLY1305\_DECRYPT}) the message text and store the final message tag. The definition of the
 variables is the same as it is for all the manual functions.
 variables is the same as it is for all the manual functions.
 
 
+IMPORTANT NOTICE: for \textit{direction == CHACHA20POLY1305\_DECRYPT} the caller has to fill \textit{tag} and \textit{taglen} with expected
+tag value. The \textit{chacha20poly1305\_memory} in decrypt mode validates the \textit{tag} value and returns \textit{CRYPT\_ERROR} on mismatch.
+
 \chapter{One-Way Cryptographic Hash Functions}
 \chapter{One-Way Cryptographic Hash Functions}
 \mysection{Core Functions}
 \mysection{Core Functions}
 Like the ciphers, there are hash core functions and a universal data type to hold the hash state called \textit{hash\_state}.  To initialize hash
 Like the ciphers, there are hash core functions and a universal data type to hold the hash state called \textit{hash\_state}.  To initialize hash