cipher: Buffer data from gcry_cipher_authenticate in OCB mode.
* cipher/cipher-internal.h (gcry_cipher_handle): Add fields aad_leftover and aad_nleftover to u_mode.ocb. * cipher/cipher-ocb.c (_gcry_cipher_ocb_set_nonce): Clear aad_nleftover. (_gcry_cipher_ocb_authenticate): Add buffering and facor some code out to ... (ocb_aad_finalize): new. (compute_tag_if_needed): Call new function. * tests/basic.c (check_ocb_cipher_splitaad): New. (check_ocb_cipher): Call new function. (main): Also call check_cipher_modes with --ciper-modes.
It is more convenient to not require full blocks for
gcry_cipher_authenticate. Other modes than OCB do this as well.
Note that the size of the context structure is not increased because
other modes require more context data.
- Signed-off-by: Werner Koch <wk@gnupg.org>