summaryrefslogtreecommitdiff
path: root/lib/algorithms.h
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@redhat.com>2014-11-03 13:21:31 +0100
committerNikos Mavrogiannopoulos <nmav@redhat.com>2014-11-03 13:49:44 +0100
commite29d027872fb61a6e7117d3b920626bbc638ac64 (patch)
tree81e97de83099b9b0c52b930dd738d1cc886e3824 /lib/algorithms.h
parent6378c46c9c39628e52c86dd652fa43b2bee1c9e5 (diff)
downloadgnutls-e29d027872fb61a6e7117d3b920626bbc638ac64.tar.gz
Made AEAD type an alternative to stream and block
That way the terminology becomes closer to the TLS rfc.
Diffstat (limited to 'lib/algorithms.h')
-rw-r--r--lib/algorithms.h13
1 files changed, 5 insertions, 8 deletions
diff --git a/lib/algorithms.h b/lib/algorithms.h
index 93ef670d45..205f6f681a 100644
--- a/lib/algorithms.h
+++ b/lib/algorithms.h
@@ -175,11 +175,11 @@ _gnutls_cipher_suite_get_id(gnutls_kx_algorithm_t kx_algorithm,
/* Functions for ciphers. */
const cipher_entry_st *cipher_to_entry(gnutls_cipher_algorithm_t c);
-inline static int _gnutls_cipher_is_block(const cipher_entry_st * e)
+inline static cipher_type_t _gnutls_cipher_type(const cipher_entry_st * e)
{
if (unlikely(e == NULL))
return 0;
- return e->block;
+ return e->type;
}
inline static int _gnutls_cipher_get_block_size(const cipher_entry_st * e)
@@ -232,7 +232,7 @@ inline static int _gnutls_cipher_algo_is_aead(const cipher_entry_st * e)
{
if (unlikely(e == NULL))
return 0;
- return e->aead;
+ return (e->type == CIPHER_AEAD)?1:0;
}
inline static int _gnutls_cipher_is_ok(const cipher_entry_st * e)
@@ -250,11 +250,8 @@ inline static int _gnutls_cipher_get_tag_size(const cipher_entry_st * e)
if (unlikely(e == NULL))
return ret;
- if (e->aead)
- ret = e->blocksize; /* FIXME: happens to be the same for now */
- else
- ret = 0;
- return ret;
+ /* non-AEAD have 0 as tag size */
+ return e->tagsize;
}
/* Functions for key exchange. */