Home GnuPG

cipher: Buffer data from gcry_cipher_authenticate in OCB mode.
b6d2a25a275aUnpublished

Unpublished Commit · Learn More

Not On Permanent Ref: This commit is not an ancestor of any permanent ref.

Description

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>

Details

Provenance
wernerAuthored on Apr 12 2016, 11:11 AM
Parents
rCee7e1a0e835f: ecc: Fix X25519 computation on Curve25519.
Branches
Unknown
Tags
Unknown

Event Timeline