From: Nikos Mavrogiannopoulos Date: Tue, 12 Apr 2011 10:10:59 +0000 (+0200) Subject: Increased priority of CPU assisted ciphers. X-Git-Tag: gnutls_2_99_1~50 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=06cbbc3d6d582487649f34de46e434466ea7bc04;p=thirdparty%2Fgnutls.git Increased priority of CPU assisted ciphers. --- diff --git a/lib/accelerated/intel/aes-x86.c b/lib/accelerated/intel/aes-x86.c index 55ee6ffd6b..eeeca30134 100644 --- a/lib/accelerated/intel/aes-x86.c +++ b/lib/accelerated/intel/aes-x86.c @@ -178,19 +178,19 @@ register_x86_crypto (void) int ret; if (check_optimized_aes()) { fprintf(stderr, "Intel AES accelerator was detected\n"); - ret = gnutls_crypto_single_cipher_register (GNUTLS_CIPHER_AES_128_CBC, 90, &cipher_struct); + ret = gnutls_crypto_single_cipher_register (GNUTLS_CIPHER_AES_128_CBC, 80, &cipher_struct); if (ret < 0) { gnutls_assert (); } - ret = gnutls_crypto_single_cipher_register (GNUTLS_CIPHER_AES_192_CBC, 90, &cipher_struct); + ret = gnutls_crypto_single_cipher_register (GNUTLS_CIPHER_AES_192_CBC, 80, &cipher_struct); if (ret < 0) { gnutls_assert (); } - ret = gnutls_crypto_single_cipher_register (GNUTLS_CIPHER_AES_256_CBC, 90, &cipher_struct); + ret = gnutls_crypto_single_cipher_register (GNUTLS_CIPHER_AES_256_CBC, 80, &cipher_struct); if (ret < 0) { gnutls_assert (); diff --git a/lib/crypto.c b/lib/crypto.c index 853df9ed70..aa914b0873 100644 --- a/lib/crypto.c +++ b/lib/crypto.c @@ -156,7 +156,7 @@ _gnutls_crypto_deregister (void) * This function will register a cipher algorithm to be used by * gnutls. Any algorithm registered will override the included * algorithms and by convention kernel implemented algorithms have - * priority of 90. The algorithm with the lowest priority will be + * priority of 90 and CPU-assisted of 80. The algorithm with the lowest priority will be * used by gnutls. * * This function should be called before gnutls_global_init(). @@ -197,7 +197,7 @@ _gnutls_get_crypto_cipher (gnutls_cipher_algorithm_t algo) * This function will register a random generator to be used by * gnutls. Any generator registered will override the included * generator and by convention kernel implemented generators have - * priority of 90. The generator with the lowest priority will be + * priority of 90 and CPU-assisted of 80. The generator with the lowest priority will be * used by gnutls. * * This function should be called before gnutls_global_init(). @@ -238,7 +238,8 @@ gnutls_crypto_rnd_register2 (int priority, int version, * * This function will register a MAC algorithm to be used by gnutls. * Any algorithm registered will override the included algorithms and - * by convention kernel implemented algorithms have priority of 90. + * by convention kernel implemented algorithms have priority of 90 + * and CPU-assisted of 80. * The algorithm with the lowest priority will be used by gnutls. * * This function should be called before gnutls_global_init(). @@ -280,7 +281,7 @@ _gnutls_get_crypto_mac (gnutls_mac_algorithm_t algo) * This function will register a digest (hash) algorithm to be used by * gnutls. Any algorithm registered will override the included * algorithms and by convention kernel implemented algorithms have - * priority of 90. The algorithm with the lowest priority will be + * priority of 90 and CPU-assisted of 80. The algorithm with the lowest priority will be * used by gnutls. * * This function should be called before gnutls_global_init(). @@ -409,7 +410,7 @@ gnutls_crypto_pk_register2 (int priority, int version, * This function will register a cipher interface to be used by * gnutls. Any interface registered will override the included engine * and by convention kernel implemented interfaces should have - * priority of 90. The interface with the lowest priority will be used + * priority of 90 and CPU-assisted of 80. The interface with the lowest priority will be used * by gnutls. * * This function should be called before gnutls_global_init(). @@ -450,7 +451,7 @@ gnutls_crypto_cipher_register2 (int priority, int version, * This function will register a mac interface to be used by * gnutls. Any interface registered will override the included engine * and by convention kernel implemented interfaces should have - * priority of 90. The interface with the lowest priority will be used + * priority of 90 and CPU-assisted of 80. The interface with the lowest priority will be used * by gnutls. * * This function should be called before gnutls_global_init(). @@ -491,7 +492,7 @@ gnutls_crypto_mac_register2 (int priority, int version, * This function will register a digest interface to be used by * gnutls. Any interface registered will override the included engine * and by convention kernel implemented interfaces should have - * priority of 90. The interface with the lowest priority will be used + * priority of 90 and CPU-assisted of 80. The interface with the lowest priority will be used * by gnutls. * * This function should be called before gnutls_global_init(). diff --git a/lib/includes/gnutls/crypto.h b/lib/includes/gnutls/crypto.h index 0b2b00bb6a..f1312eeeb7 100644 --- a/lib/includes/gnutls/crypto.h +++ b/lib/includes/gnutls/crypto.h @@ -43,7 +43,7 @@ extern "C" int gnutls_cipher_decrypt2 (gnutls_cipher_hd_t handle, const void *ciphertext, size_t ciphertextlen, void *text, size_t textlen); - int gnutls_cipher_encrypt2 (gnutls_cipher_hd_t handle, void *text, + int gnutls_cipher_encrypt2 (gnutls_cipher_hd_t handle, const void *text, size_t textlen, void *ciphertext, size_t ciphertextlen);