aboutsummaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authorJussi Kivilinna <jussi.kivilinna@mbnet.fi>2011-11-09 09:26:36 -0500
committerHerbert Xu <herbert@gondor.apana.org.au>2011-11-21 03:13:24 -0500
commit18482053f92b099663bd36a10e8f6bd2c8544669 (patch)
tree5747eb47b1b0ffa59d4ad5c2402021e3b4544a1f /crypto
parent251496dbfc1be38bc43b49651f3d33c02faccc47 (diff)
crypto: serpent-sse2 - add lrw support
Patch adds LRW support for serpent-sse2 by using lrw_crypt(). Patch has been tested with tcrypt and automated filesystem tests. Tcrypt benchmarks results (serpent-sse2/serpent_generic speed ratios): Benchmark results with tcrypt: Intel Celeron T1600 (x86_64) (fam:6, model:15, step:13): size lrw-enc lrw-dec 16B 1.00x 0.96x 64B 1.01x 1.01x 256B 3.01x 2.97x 1024B 3.39x 3.33x 8192B 3.35x 3.33x AMD Phenom II 1055T (x86_64) (fam:16, model:10): size lrw-enc lrw-dec 16B 0.98x 1.03x 64B 1.01x 1.04x 256B 2.10x 2.14x 1024B 2.28x 2.33x 8192B 2.30x 2.33x Intel Atom N270 (i586): size lrw-enc lrw-dec 16B 0.97x 0.97x 64B 1.47x 1.50x 256B 1.72x 1.69x 1024B 1.88x 1.81x 8192B 1.84x 1.79x Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto')
-rw-r--r--crypto/serpent.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/crypto/serpent.c b/crypto/serpent.c
index eb6163041b08..7cc2caeb88a5 100644
--- a/crypto/serpent.c
+++ b/crypto/serpent.c
@@ -206,9 +206,9 @@
206 x1 ^= x4; x3 ^= x4; x4 &= x0; \ 206 x1 ^= x4; x3 ^= x4; x4 &= x0; \
207 x4 ^= x2; 207 x4 ^= x2;
208 208
209int serpent_setkey(struct crypto_tfm *tfm, const u8 *key, unsigned int keylen) 209int __serpent_setkey(struct serpent_ctx *ctx, const u8 *key,
210 unsigned int keylen)
210{ 211{
211 struct serpent_ctx *ctx = crypto_tfm_ctx(tfm);
212 u32 *k = ctx->expkey; 212 u32 *k = ctx->expkey;
213 u8 *k8 = (u8 *)k; 213 u8 *k8 = (u8 *)k;
214 u32 r0,r1,r2,r3,r4; 214 u32 r0,r1,r2,r3,r4;
@@ -349,6 +349,12 @@ int serpent_setkey(struct crypto_tfm *tfm, const u8 *key, unsigned int keylen)
349 349
350 return 0; 350 return 0;
351} 351}
352EXPORT_SYMBOL_GPL(__serpent_setkey);
353
354int serpent_setkey(struct crypto_tfm *tfm, const u8 *key, unsigned int keylen)
355{
356 return __serpent_setkey(crypto_tfm_ctx(tfm), key, keylen);
357}
352EXPORT_SYMBOL_GPL(serpent_setkey); 358EXPORT_SYMBOL_GPL(serpent_setkey);
353 359
354void __serpent_encrypt(struct serpent_ctx *ctx, u8 *dst, const u8 *src) 360void __serpent_encrypt(struct serpent_ctx *ctx, u8 *dst, const u8 *src)