summaryrefslogtreecommitdiff
path: root/doc/gcrypt.texi
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2011-06-29 15:26:22 +0200
committerWerner Koch <wk@gnupg.org>2011-06-29 15:26:22 +0200
commit7cae9fdfc9e322941545a3a2128a5ead1010a6cf (patch)
tree81ffb01412c1ca2516444725336f0ad69f4a75cd /doc/gcrypt.texi
parentea2b4d6653b7e3f483582ee5bf1dc7de2cb0a3f9 (diff)
downloadlibgcrypt-7cae9fdfc9e322941545a3a2128a5ead1010a6cf.tar.gz
Fixed a bug in the gcry_cipher_get_algo_keylen and gcry_cipher_get_algo_blklen
Contrary to the documentation those functions aborted if an invalid algorithm was passed. The same happened for the corresponding subcommands of gcry_cipher_algo_info.
Diffstat (limited to 'doc/gcrypt.texi')
-rw-r--r--doc/gcrypt.texi33
1 files changed, 31 insertions, 2 deletions
diff --git a/doc/gcrypt.texi b/doc/gcrypt.texi
index e172ca8e..1f5e6e1c 100644
--- a/doc/gcrypt.texi
+++ b/doc/gcrypt.texi
@@ -1891,11 +1891,15 @@ Here is a list of supported codes for @var{what}:
Return the length of the key. If the algorithm supports multiple key
lengths, the maximum supported value is returned. The length is
returned as number of octets (bytes) and not as number of bits in
-@var{nbytes}; @var{buffer} must be zero.
+@var{nbytes}; @var{buffer} must be zero. Note that it is usually
+better to use the convenience function
+@code{gcry_cipher_get_algo_keylen}.
@item GCRYCTL_GET_BLKLEN:
Return the block length of the algorithm. The length is returned as a
-number of octets in @var{nbytes}; @var{buffer} must be zero.
+number of octets in @var{nbytes}; @var{buffer} must be zero. Note
+that it is usually better to use the convenience function
+@code{gcry_cipher_get_algo_blklen}.
@item GCRYCTL_TEST_ALGO:
Returns @code{0} when the specified algorithm is available for use.
@@ -1907,6 +1911,31 @@ Returns @code{0} when the specified algorithm is available for use.
@end deftypefun
@c end gcry_cipher_algo_info
+@deftypefun size_t gcry_cipher_get_algo_keylen (@var{algo})
+
+This function returns length of the key for algorithm @var{algo}. If
+the algorithm supports multiple key lengths, the maximum supported key
+length is returned. On error @code{0} is returned. The key length is
+returned as number of octets.
+
+This is a convenience functions which should be preferred over
+@code{gcry_cipher_algo_info} because it allows for proper type
+checking.
+@end deftypefun
+@c end gcry_cipher_get_algo_keylen
+
+@deftypefun size_t gcry_cipher_get_algo_blklen (int @var{algo})
+
+This functions returns the blocklength of the algorithm @var{algo}
+counted in octets. On error @code{0} is returned.
+
+This is a convenience functions which should be preferred over
+@code{gcry_cipher_algo_info} because it allows for proper type
+checking.
+@end deftypefun
+@c end gcry_cipher_get_algo_blklen
+
+
@deftypefun {const char *} gcry_cipher_algo_name (int @var{algo})
@code{gcry_cipher_algo_name} returns a string with the name of the