From fea5971488e049f902d7912df22a945bc755ad6d Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Wed, 23 Mar 2016 15:24:40 +0100 Subject: Add new control GCRYCTL_GET_TAGLEN for use with gcry_cipher_info. * src/gcrypt.h.in (GCRYCTL_GET_TAGLEN): New. * cipher/cipher.c (_gcry_cipher_info): Add GCRYCTL_GET_TAGLEN feature. * tests/basic.c (_check_gcm_cipher): Check that new feature. (_check_poly1305_cipher): Ditto. (check_ccm_cipher): Ditto. (do_check_ocb_cipher): Ditto. (check_ctr_cipher): Add negative test for new feature. -- Signed-off-by: Werner Koch --- doc/gcrypt.texi | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'doc/gcrypt.texi') diff --git a/doc/gcrypt.texi b/doc/gcrypt.texi index 3265a706..84516279 100644 --- a/doc/gcrypt.texi +++ b/doc/gcrypt.texi @@ -1900,12 +1900,24 @@ handle @var{h}. Please see the comments in the source code (@code{src/global.c}) for details. @end deftypefun -@deftypefun gcry_error_t gcry_cipher_info (gcry_cipher_hd_t @var{h}, int @var{what}, void *@var{buffer}, size_t *@var{nbytes}) +@deftypefun gcry_error_t gcry_cipher_info (gcry_cipher_hd_t @var{h}, @ + int @var{what}, void *@var{buffer}, size_t *@var{nbytes}) @code{gcry_cipher_info} is used to retrieve various information about a cipher context or the cipher module in general. -Currently no information is available. +@c begin constants for gcry_cipher_info +@table @code + +@item GCRYCTL_GET_TAGLEN: +Return the length of the tag for an AE algorithm mode. An error is +returned for modes which do not support a tag. @var{buffer} must be +given as NULL. On success the result is stored @var{nbytes}. The +taglen is returned in bytes. + +@end table +@c end constants for gcry_cipher_info + @end deftypefun @node General cipher functions -- cgit v1.2.1