@@ -172,4 +172,38 @@ int aegis128x2_state_encrypt_detached_final(aegis128x2_state *st_, uint8_t *c, s
172172int aegis128x2_state_encrypt_final (aegis128x2_state * st_ , uint8_t * c , size_t clen_max ,
173173 size_t * written , size_t maclen );
174174
175+ /*
176+ * Decrypt a message chunk.
177+ *
178+ * The output should never be released to the caller until the tag has been verified.
179+ *
180+ * st_: state to update
181+ * m: plaintext output buffer
182+ * mlen_max: length of the plaintext chunk buffer (must be >= clen)
183+ * written: number of plaintext bytes actually written
184+ * c: ciphertext chunk input buffer
185+ * clen: length of the ciphertext chunk
186+ *
187+ * Return 0 on success, -1 on failure.
188+ */
189+ int aegis128x2_state_decrypt_detached_update (aegis128x2_state * st_ , uint8_t * m , size_t mlen_max ,
190+ size_t * written , const uint8_t * c , size_t clen )
191+ __attribute__((warn_unused_result ));
192+
193+ /*
194+ * Decrypt the final message chunk and verify the authentication tag.
195+ *
196+ * st_: state to finalize
197+ * m: plaintext output buffer
198+ * mlen_max: length of the plaintext chunk buffer (must be >= remaining bytes)
199+ * written: number of plaintext bytes actually written
200+ * mac: authentication tag input buffer
201+ * maclen: length of the authentication tag (16 or 32)
202+ *
203+ * Return 0 on success, -1 on failure.
204+ */
205+ int aegis128x2_state_decrypt_detached_final (aegis128x2_state * st_ , uint8_t * m , size_t mlen_max ,
206+ size_t * written , const uint8_t * mac , size_t maclen )
207+ __attribute__((warn_unused_result ));
208+
175209#endif
0 commit comments