diff options
author | Werner Koch <wk@gnupg.org> | 2003-06-18 18:27:59 +0000 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2003-06-18 18:27:59 +0000 |
commit | 3c9d0b4898f05b9b494a8fa505d2c16b51483e4d (patch) | |
tree | 872e481fcdac200030b46d9b160c2eb1dc76decf /cipher | |
parent | b99f9e0dc418ed042c574328948a4f7827430454 (diff) | |
download | libgcrypt-3c9d0b4898f05b9b494a8fa505d2c16b51483e4d.tar.gz |
* basic.c (check_cbc_mac_cipher): Adjusted for new API of get_blklen
and get_keylen.
(check_ctr_cipher): Ditto.
(check_one_cipher): Ditto.
(check_one_md): Adjusted for new API of gcry_md_copy.
* benchmark.c (cipher_bench): Adjusted for new API of get_blklen
and get_keylen.
* gcrypt.h (gcry_cipher_get_algo_blklen)
(gcry_cipher_get_algo_keylen): Replaced macro by funcion.
* cipher.c (gcry_cipher_get_algo_keylen): New.
(gcry_cipher_get_algo_blklen): New.
Diffstat (limited to 'cipher')
-rw-r--r-- | cipher/ChangeLog | 5 | ||||
-rw-r--r-- | cipher/cipher.c | 23 |
2 files changed, 28 insertions, 0 deletions
diff --git a/cipher/ChangeLog b/cipher/ChangeLog index 447251df..72cf4f2d 100644 --- a/cipher/ChangeLog +++ b/cipher/ChangeLog @@ -1,3 +1,8 @@ +2003-06-18 Werner Koch <wk@gnupg.org> + + * cipher.c (gcry_cipher_get_algo_keylen): New. + (gcry_cipher_get_algo_blklen): New. + 2003-06-18 Moritz Schulte <moritz@g10code.com> * arcfour.c, cipher.c, blowfish.c, md.c, cast5.c, pubkey.c, crc.c, diff --git a/cipher/cipher.c b/cipher/cipher.c index 3cc509d8..185ac9f7 100644 --- a/cipher/cipher.c +++ b/cipher/cipher.c @@ -1248,6 +1248,29 @@ gcry_cipher_algo_info (int algo, int what, void *buffer, size_t *nbytes) return gpg_error (err); } + +size_t +gcry_cipher_get_algo_keylen (int algo) +{ + size_t n; + + if (gcry_cipher_algo_info( algo, GCRYCTL_GET_KEYLEN, NULL, &n)) + n = 0; + return n; +} + + +size_t +gcry_cipher_get_algo_blklen (int algo) +{ + size_t n; + + if (gcry_cipher_algo_info( algo, GCRYCTL_GET_BLKLEN, NULL, &n)) + n = 0; + return n; +} + + gpg_err_code_t _gcry_cipher_init (void) { |