mirror of
https://github.com/cuberite/polarssl.git
synced 2025-11-01 12:10:18 -04:00
1.0 KiB
1.0 KiB
GCM interface changes: impact for alternative implementations
The GCM multipart interface has changed as described in “GCM multipart interface: application changes”. The consequences for an alternative implementation of GCM (MBEDTLS_GCM_ALT) are as follows:
mbedtls_gcm_starts()now only sets the mode and the nonce (IV). The new functionmbedtls_gcm_update_ad()receives the associated data. It may be called multiple times.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:- Always return the partial output immediately, even if it does not consist of a whole number of blocks.
- Buffer the data for the last partial block, to be returned in the next call to
mbedtls_gcm_update()ormbedtls_gcm_finish().
mbedtls_gcm_finish()now takes an extra output buffer for the last partial block if needed.