blob: 388e2bedd5d0867829d98abd0b4dcf4421f2863d [file] [log] [blame] [view]
Gilles Peskine7f312c82021-05-20 11:51:46 +02001GCM interface changes: impact for alternative implementations
2-------------------------------------------------------------
3
4The GCM multipart interface has changed as described in [“GCM multipart interface: application changes”](#gcm-multipart-interface:-application-changes). The consequences for an alternative implementation of GCM (`MBEDTLS_GCM_ALT`) are as follows:
5
6* `mbedtls_gcm_starts()` now only sets the mode and the nonce (IV). The new function `mbedtls_gcm_update_ad()` receives the associated data. It may be called multiple times.
7* `mbedtls_gcm_update()` now allows arbitrary-length inputs, takes an extra parameter to indicate the actual output length. Alternative implementations may choose between two modes:
8 * Always return the partial output immediately, even if it does not consist of a whole number of blocks.
9 * Buffer the data for the last partial block, to be returned in the next call to `mbedtls_gcm_update()` or `mbedtls_gcm_finish()`.
10* `mbedtls_gcm_finish()` now takes an extra output buffer for the last partial block if needed.