diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2013-12-15 21:18:05 +0100 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2013-12-15 21:38:12 +0100 |
commit | ca5b8a57febb8601c0d3cd1c66f75ca8dc746b99 (patch) | |
tree | 041c220accf14e6df31cb0b5846b482998c8c522 /lib/algorithms | |
parent | fd561405d5dc3782ee03e46b974d52b970f36634 (diff) | |
download | gnutls-ca5b8a57febb8601c0d3cd1c66f75ca8dc746b99.tar.gz |
Align on 16-byte boundaries the buffers provided to cryptodev.
When gnutls is compiled with support for cryptodev, the buffers
provided to crypto backend are ensured to be 16-byte aligned
(except the ones provided by the user). That increases performance
in several crypto accelerators.
Diffstat (limited to 'lib/algorithms')
-rw-r--r-- | lib/algorithms/ciphers.c | 62 |
1 files changed, 27 insertions, 35 deletions
diff --git a/lib/algorithms/ciphers.c b/lib/algorithms/ciphers.c index a99273fe79..ebec727a7b 100644 --- a/lib/algorithms/ciphers.c +++ b/lib/algorithms/ciphers.c @@ -35,63 +35,55 @@ */ static const cipher_entry_st algorithms[] = { {"AES-256-CBC", GNUTLS_CIPHER_AES_256_CBC, 16, 32, CIPHER_BLOCK, - 16, 16, 0}, + 0, 16, 16, 0}, {"AES-192-CBC", GNUTLS_CIPHER_AES_192_CBC, 16, 24, CIPHER_BLOCK, - 16, 16, 0}, + 0, 16, 16, 0}, {"AES-128-CBC", GNUTLS_CIPHER_AES_128_CBC, 16, 16, CIPHER_BLOCK, - 16, 16, 0}, + 0, 16, 16, 0}, {"AES-128-GCM", GNUTLS_CIPHER_AES_128_GCM, 16, 16, CIPHER_STREAM, - AEAD_IMPLICIT_DATA_SIZE, 12, 1}, + 4, 8, 12, 1}, {"AES-256-GCM", GNUTLS_CIPHER_AES_256_GCM, 16, 32, CIPHER_STREAM, - AEAD_IMPLICIT_DATA_SIZE, 12, 1}, - {"ARCFOUR-128", GNUTLS_CIPHER_ARCFOUR_128, 1, 16, CIPHER_STREAM, 0, - 0, 0}, + 4, 8, 12, 1}, + {"ARCFOUR-128", GNUTLS_CIPHER_ARCFOUR_128, 1, 16, CIPHER_STREAM, + 0, 0, 0, 0}, {"ESTREAM-SALSA20-256", GNUTLS_CIPHER_ESTREAM_SALSA20_256, 64, 32, - CIPHER_STREAM, 8, 8, 0}, + CIPHER_STREAM, 0, 0, 8, 0}, {"SALSA20-256", GNUTLS_CIPHER_SALSA20_256, 64, 32, CIPHER_STREAM, - 8, 8, 0}, + 0, 0, 8, 0}, {"CAMELLIA-256-CBC", GNUTLS_CIPHER_CAMELLIA_256_CBC, 16, 32, - CIPHER_BLOCK, - 16, 16, 0}, + CIPHER_BLOCK, 0, 16, 16, 0}, {"CAMELLIA-192-CBC", GNUTLS_CIPHER_CAMELLIA_192_CBC, 16, 24, - CIPHER_BLOCK, - 16, 16, 0}, + CIPHER_BLOCK, 0, 16, 16, 0}, {"CAMELLIA-128-CBC", GNUTLS_CIPHER_CAMELLIA_128_CBC, 16, 16, - CIPHER_BLOCK, - 16, 16, 0}, + CIPHER_BLOCK, 0, 16, 16, 0}, {"CAMELLIA-128-GCM", GNUTLS_CIPHER_CAMELLIA_128_GCM, 16, 16, - CIPHER_STREAM, AEAD_IMPLICIT_DATA_SIZE, 12, 1}, + CIPHER_STREAM, 4, 8, 12, 1}, {"CAMELLIA-256-GCM", GNUTLS_CIPHER_CAMELLIA_256_GCM, 16, 32, - CIPHER_STREAM, AEAD_IMPLICIT_DATA_SIZE, 12, 1}, - {"3DES-CBC", GNUTLS_CIPHER_3DES_CBC, 8, 24, CIPHER_BLOCK, 8, 8, 0}, - {"DES-CBC", GNUTLS_CIPHER_DES_CBC, 8, 8, CIPHER_BLOCK, 8, 8, 0}, - {"ARCFOUR-40", GNUTLS_CIPHER_ARCFOUR_40, 1, 5, CIPHER_STREAM, 0, 0, - 0}, - {"RC2-40", GNUTLS_CIPHER_RC2_40_CBC, 8, 5, CIPHER_BLOCK, 8, 8, 0}, + CIPHER_STREAM, 4, 8, 12, 1}, + {"3DES-CBC", GNUTLS_CIPHER_3DES_CBC, 8, 24, CIPHER_BLOCK, 0, 8, 8, 0}, + {"DES-CBC", GNUTLS_CIPHER_DES_CBC, 8, 8, CIPHER_BLOCK, 0, 8, 8, 0}, + {"ARCFOUR-40", GNUTLS_CIPHER_ARCFOUR_40, 1, 5, CIPHER_STREAM, 0, 0, 0, 0}, + {"RC2-40", GNUTLS_CIPHER_RC2_40_CBC, 8, 5, CIPHER_BLOCK, 0, 8, 8, 0}, #ifdef ENABLE_OPENPGP {"IDEA-PGP-CFB", GNUTLS_CIPHER_IDEA_PGP_CFB, 8, 16, CIPHER_BLOCK, - 8, 8, 0}, + 0, 8, 8, 0}, {"3DES-PGP-CFB", GNUTLS_CIPHER_3DES_PGP_CFB, 8, 24, CIPHER_BLOCK, - 8, 8, 0}, + 0, 8, 8, 0}, {"CAST5-PGP-CFB", GNUTLS_CIPHER_CAST5_PGP_CFB, 8, 16, CIPHER_BLOCK, - 8, 8, 0}, + 0, 8, 8, 0}, {"BLOWFISH-PGP-CFB", GNUTLS_CIPHER_BLOWFISH_PGP_CFB, 8, - 16 /*actually unlimited */ , CIPHER_BLOCK, 8, 8, 0}, + 16 /*actually unlimited */ , CIPHER_BLOCK, 0, 8, 8, 0}, {"SAFER-SK128-PGP-CFB", GNUTLS_CIPHER_SAFER_SK128_PGP_CFB, 8, 16, - CIPHER_BLOCK, 8, 8, 0}, + CIPHER_BLOCK, 0, 8, 8, 0}, {"AES-128-PGP-CFB", GNUTLS_CIPHER_AES128_PGP_CFB, 16, 16, - CIPHER_BLOCK, 16, - 16, 0}, + CIPHER_BLOCK, 0, 16, 16, 0}, {"AES-192-PGP-CFB", GNUTLS_CIPHER_AES192_PGP_CFB, 16, 24, - CIPHER_BLOCK, 16, - 16, 0}, + CIPHER_BLOCK, 0, 16, 16, 0}, {"AES-256-PGP-CFB", GNUTLS_CIPHER_AES256_PGP_CFB, 16, 32, - CIPHER_BLOCK, 16, - 16, 0}, + CIPHER_BLOCK, 0, 16, 16, 0}, {"TWOFISH-PGP-CFB", GNUTLS_CIPHER_TWOFISH_PGP_CFB, 16, 16, - CIPHER_BLOCK, 16, - 16, 0}, + CIPHER_BLOCK, 0, 16, 16, 0}, #endif #ifndef ENABLE_FIPS140 |