Skip to content

Commit 1ce38ab

Browse files
committed
Revert "Remove WIP APIs"
This reverts commit 0028f84.
1 parent 0028f84 commit 1ce38ab

File tree

4 files changed

+136
-0
lines changed

4 files changed

+136
-0
lines changed

src/include/aegis128l.h

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,4 +172,38 @@ int aegis128l_state_encrypt_detached_final(aegis128l_state *st_, uint8_t *c, siz
172172
int aegis128l_state_encrypt_final(aegis128l_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 aegis128l_state_decrypt_detached_update(aegis128l_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 aegis128l_state_decrypt_detached_final(aegis128l_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

src/include/aegis128x2.h

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,4 +172,38 @@ int aegis128x2_state_encrypt_detached_final(aegis128x2_state *st_, uint8_t *c, s
172172
int 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

src/include/aegis128x4.h

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,4 +172,38 @@ int aegis128x4_state_encrypt_detached_final(aegis128x4_state *st_, uint8_t *c, s
172172
int aegis128x4_state_encrypt_final(aegis128x4_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 aegis128x4_state_decrypt_detached_update(aegis128x4_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 aegis128x4_state_decrypt_detached_final(aegis128x4_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

src/include/aegis256.h

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,4 +172,38 @@ int aegis256_state_encrypt_detached_final(aegis256_state *st_, uint8_t *c, size_
172172
int aegis256_state_encrypt_final(aegis256_state *st_, uint8_t *c, size_t clen_max, size_t *written,
173173
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 aegis256_state_decrypt_detached_update(aegis256_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 aegis256_state_decrypt_detached_final(aegis256_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

Comments
 (0)