summaryrefslogtreecommitdiff
path: root/lib/gnutls_cipher_int.c
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2011-09-07 20:37:41 +0200
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2011-09-07 20:37:41 +0200
commit6361933cfaeab5bc0a6d36e6a4bd1b114ac96380 (patch)
treea494eb6af46e9b2f2975e8849c7e5f462c6465a1 /lib/gnutls_cipher_int.c
parent1b18e21bfbbf75bc4c60b1c56cc41406a075b813 (diff)
downloadgnutls-6361933cfaeab5bc0a6d36e6a4bd1b114ac96380.tar.gz
Added encryption flag to simplify and optimize key expansion.
Diffstat (limited to 'lib/gnutls_cipher_int.c')
-rw-r--r--lib/gnutls_cipher_int.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/gnutls_cipher_int.c b/lib/gnutls_cipher_int.c
index 73cb043853..d61d2c818c 100644
--- a/lib/gnutls_cipher_int.c
+++ b/lib/gnutls_cipher_int.c
@@ -36,7 +36,7 @@
int
_gnutls_cipher_init (cipher_hd_st * handle, gnutls_cipher_algorithm_t cipher,
- const gnutls_datum_t * key, const gnutls_datum_t * iv)
+ const gnutls_datum_t * key, const gnutls_datum_t * iv, int enc)
{
int ret = GNUTLS_E_INTERNAL_ERROR;
const gnutls_crypto_cipher_st *cc = NULL;
@@ -57,7 +57,7 @@ _gnutls_cipher_init (cipher_hd_st * handle, gnutls_cipher_algorithm_t cipher,
handle->tag = cc->tag;
handle->setiv = cc->setiv;
- SR (cc->init (cipher, &handle->handle), cc_cleanup);
+ SR (cc->init (cipher, &handle->handle, enc), cc_cleanup);
SR (cc->setkey( handle->handle, key->data, key->size), cc_cleanup);
if (iv)
{
@@ -76,7 +76,7 @@ _gnutls_cipher_init (cipher_hd_st * handle, gnutls_cipher_algorithm_t cipher,
/* otherwise use generic cipher interface
*/
- ret = _gnutls_cipher_ops.init (cipher, &handle->handle);
+ ret = _gnutls_cipher_ops.init (cipher, &handle->handle, enc);
if (ret < 0)
{
gnutls_assert ();
@@ -118,13 +118,13 @@ int _gnutls_auth_cipher_init (auth_cipher_hd_st * handle,
const gnutls_datum_t * iv,
gnutls_mac_algorithm_t mac,
const gnutls_datum_t * mac_key,
- int ssl_hmac)
+ int ssl_hmac, int enc)
{
int ret;
memset(handle, 0, sizeof(*handle));
- ret = _gnutls_cipher_init(&handle->cipher, cipher, cipher_key, iv);
+ ret = _gnutls_cipher_init(&handle->cipher, cipher, cipher_key, iv, enc);
if (ret < 0)
{
gnutls_assert();