summaryrefslogtreecommitdiff
path: root/cipher/camellia.c
diff options
context:
space:
mode:
authorJussi Kivilinna <jussi.kivilinna@iki.fi>2013-08-16 14:40:34 +0300
committerJussi Kivilinna <jussi.kivilinna@iki.fi>2013-08-16 14:42:47 +0300
commitcafadc1e4fb97581262b0081ba251e05613d4394 (patch)
treef5727820bb5df3e58043ed35dc39c9710fd1817f /cipher/camellia.c
parent31e4b1a96a07e9a3698fcb7be0643a136ebb8e5c (diff)
downloadlibgcrypt-cafadc1e4fb97581262b0081ba251e05613d4394.tar.gz
camellia: add ARMv6 assembly implementation
* cipher/Makefile.am: Add 'camellia-armv6.S'. * cipher/camellia-armv6.S: New file. * cipher/camellia-glue.c [USE_ARMV6_ASM] (_gcry_camellia_armv6_encrypt_block) (_gcry_camellia_armv6_decrypt_block): New prototypes. [USE_ARMV6_ASM] (Camellia_EncryptBlock, Camellia_DecryptBlock) (camellia_encrypt, camellia_decrypt): New functions. * cipher/camellia.c [!USE_ARMV6_ASM]: Compile encryption and decryption routines if USE_ARMV6_ASM macro is _not_ defined. * cipher/camellia.h (USE_ARMV6_ASM): New macro. [!USE_ARMV6_ASM] (Camellia_EncryptBlock, Camellia_DecryptBlock): If USE_ARMV6_ASM is defined, disable these function prototypes. (camellia) [arm]: Add 'camellia-armv6.lo'. -- Add optimized ARMv6 assembly implementation for Camellia. Implementation is tuned for Cortex-A8. Unaligned access handling is done in assembly part. For now. only enable this on little-endian systems as big-endian correctness have not been tested yet. Old vs new. Cortex-A8 (on Debian Wheezy/armhf): ECB/Stream CBC CFB OFB CTR --------------- --------------- --------------- --------------- --------------- CAMELLIA128 1.44x 1.47x 1.35x 1.34x 1.43x 1.39x 1.38x 1.36x 1.38x 1.39x CAMELLIA192 1.60x 1.62x 1.52x 1.47x 1.56x 1.54x 1.52x 1.53x 1.52x 1.53x CAMELLIA256 1.59x 1.60x 1.49x 1.47x 1.53x 1.54x 1.51x 1.50x 1.52x 1.53x Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
Diffstat (limited to 'cipher/camellia.c')
-rw-r--r--cipher/camellia.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/cipher/camellia.c b/cipher/camellia.c
index cd468859..038d9118 100644
--- a/cipher/camellia.c
+++ b/cipher/camellia.c
@@ -869,6 +869,7 @@ void camellia_setup192(const unsigned char *key, u32 *subkey)
}
+#ifndef USE_ARMV6_ASM
/**
* Stuff related to camellia encryption/decryption
*
@@ -1328,6 +1329,8 @@ void camellia_decrypt256(const u32 *subkey, u32 *blocks)
return;
}
+#endif /*!USE_ARMV6_ASM*/
+
/***
*
@@ -1354,6 +1357,7 @@ void Camellia_Ekeygen(const int keyBitLength,
}
+#ifndef USE_ARMV6_ASM
void Camellia_EncryptBlock(const int keyBitLength,
const unsigned char *plaintext,
const KEY_TABLE_TYPE keyTable,
@@ -1414,3 +1418,4 @@ void Camellia_DecryptBlock(const int keyBitLength,
PUTU32(plaintext + 8, tmp[2]);
PUTU32(plaintext + 12, tmp[3]);
}
+#endif /*!USE_ARMV6_ASM*/