summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2007-11-27 14:33:24 +0100
committerHerbert Xu <herbert@gondor.apana.org.au>2008-01-10 22:16:43 +0100
commit23508e11ab3bb405dca66bf4d77e488bf2b07b0c (patch)
treef1eead8ce9115097e4c2a73d5cbaf8264085a296
parent[CRYPTO] skcipher: Add givcrypt operations and givcipher type (diff)
downloadlinux-23508e11ab3bb405dca66bf4d77e488bf2b07b0c.tar.xz
linux-23508e11ab3bb405dca66bf4d77e488bf2b07b0c.zip
[CRYPTO] skcipher: Added geniv field
This patch introduces the geniv field which indicates the default IV generator for each algorithm. It should point to a string that is not freed as long as the algorithm is registered. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-rw-r--r--crypto/ablkcipher.c2
-rw-r--r--crypto/blkcipher.c2
-rw-r--r--include/linux/crypto.h4
3 files changed, 8 insertions, 0 deletions
diff --git a/crypto/ablkcipher.c b/crypto/ablkcipher.c
index e403d8137ecd..8f48b4d58fca 100644
--- a/crypto/ablkcipher.c
+++ b/crypto/ablkcipher.c
@@ -96,6 +96,7 @@ static void crypto_ablkcipher_show(struct seq_file *m, struct crypto_alg *alg)
seq_printf(m, "min keysize : %u\n", ablkcipher->min_keysize);
seq_printf(m, "max keysize : %u\n", ablkcipher->max_keysize);
seq_printf(m, "ivsize : %u\n", ablkcipher->ivsize);
+ seq_printf(m, "geniv : %s\n", ablkcipher->geniv ?: "<default>");
}
const struct crypto_type crypto_ablkcipher_type = {
@@ -142,6 +143,7 @@ static void crypto_givcipher_show(struct seq_file *m, struct crypto_alg *alg)
seq_printf(m, "min keysize : %u\n", ablkcipher->min_keysize);
seq_printf(m, "max keysize : %u\n", ablkcipher->max_keysize);
seq_printf(m, "ivsize : %u\n", ablkcipher->ivsize);
+ seq_printf(m, "geniv : %s\n", ablkcipher->geniv ?: "<built-in>");
}
const struct crypto_type crypto_givcipher_type = {
diff --git a/crypto/blkcipher.c b/crypto/blkcipher.c
index 7939504dfd8b..7a3e1a308074 100644
--- a/crypto/blkcipher.c
+++ b/crypto/blkcipher.c
@@ -496,6 +496,8 @@ static void crypto_blkcipher_show(struct seq_file *m, struct crypto_alg *alg)
seq_printf(m, "min keysize : %u\n", alg->cra_blkcipher.min_keysize);
seq_printf(m, "max keysize : %u\n", alg->cra_blkcipher.max_keysize);
seq_printf(m, "ivsize : %u\n", alg->cra_blkcipher.ivsize);
+ seq_printf(m, "geniv : %s\n", alg->cra_blkcipher.geniv ?:
+ "<default>");
}
const struct crypto_type crypto_blkcipher_type = {
diff --git a/include/linux/crypto.h b/include/linux/crypto.h
index 3656a24ea7f0..facafa1bd8ca 100644
--- a/include/linux/crypto.h
+++ b/include/linux/crypto.h
@@ -183,6 +183,8 @@ struct ablkcipher_alg {
int (*givencrypt)(struct skcipher_givcrypt_request *req);
int (*givdecrypt)(struct skcipher_givcrypt_request *req);
+ const char *geniv;
+
unsigned int min_keysize;
unsigned int max_keysize;
unsigned int ivsize;
@@ -209,6 +211,8 @@ struct blkcipher_alg {
struct scatterlist *dst, struct scatterlist *src,
unsigned int nbytes);
+ const char *geniv;
+
unsigned int min_keysize;
unsigned int max_keysize;
unsigned int ivsize;