Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 157939
b: refs/heads/master
c: 0b67fb6
h: refs/heads/master
i:
  157937: 2cc1b6a
  157935: 5b7b291
v: v3
  • Loading branch information
Herbert Xu committed Jun 25, 2009
1 parent 20c1b0e commit f57f9f2
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 435578aeaad5859dda8657e3ed2c1a5bc1e524ec
refs/heads/master: 0b67fb65d1b2ba1396de69112b8b9bc95d8d5feb
20 changes: 19 additions & 1 deletion trunk/crypto/ablkcipher.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
*/

#include <crypto/internal/skcipher.h>
#include <linux/cpumask.h>
#include <linux/err.h>
#include <linux/init.h>
#include <linux/kernel.h>
Expand All @@ -25,6 +26,8 @@

#include "internal.h"

static const char *skcipher_default_geniv __read_mostly;

static int setkey_unaligned(struct crypto_ablkcipher *tfm, const u8 *key,
unsigned int keylen)
{
Expand Down Expand Up @@ -180,7 +183,8 @@ EXPORT_SYMBOL_GPL(crypto_givcipher_type);

const char *crypto_default_geniv(const struct crypto_alg *alg)
{
return alg->cra_flags & CRYPTO_ALG_ASYNC ? "eseqiv" : "chainiv";
return alg->cra_flags & CRYPTO_ALG_ASYNC ?
"eseqiv" : skcipher_default_geniv;
}

static int crypto_givcipher_default(struct crypto_alg *alg, u32 type, u32 mask)
Expand Down Expand Up @@ -361,3 +365,17 @@ struct crypto_ablkcipher *crypto_alloc_ablkcipher(const char *alg_name,
return ERR_PTR(err);
}
EXPORT_SYMBOL_GPL(crypto_alloc_ablkcipher);

static int __init skcipher_module_init(void)
{
skcipher_default_geniv = num_possible_cpus() > 1 ?
"eseqiv" : "chainiv";
return 0;
}

static void skcipher_module_exit(void)
{
}

module_init(skcipher_module_init);
module_exit(skcipher_module_exit);

0 comments on commit f57f9f2

Please sign in to comment.