diff mbox

[RFC,1/3] crypto: add interleave option to cipher_alg

Message ID 1391689504-28160-2-git-send-email-ard.biesheuvel@linaro.org
State New
Headers show

Commit Message

Ard Biesheuvel Feb. 6, 2014, 12:25 p.m. UTC
Many ciphers perform better when allowed to operate on data sizes that are
larger than the natural block size of the algorithm.

This patch adds a struct member .cia_interleave which holds the preferred
number of blocks processed in a single invocation. The invocations themselves
should occur through .cia_enc_interleave and .cia_dec_interleave.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
 include/linux/crypto.h | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox

Patch

diff --git a/include/linux/crypto.h b/include/linux/crypto.h
index b92eadf92d72..4f09a10a4efa 100644
--- a/include/linux/crypto.h
+++ b/include/linux/crypto.h
@@ -252,6 +252,10 @@  struct cipher_alg {
 	                  unsigned int keylen);
 	void (*cia_encrypt)(struct crypto_tfm *tfm, u8 *dst, const u8 *src);
 	void (*cia_decrypt)(struct crypto_tfm *tfm, u8 *dst, const u8 *src);
+
+	unsigned int cia_interleave;
+	void (*cia_enc_interleave)(struct crypto_tfm *tfm, u8 *d, const u8 *s);
+	void (*cia_dec_interleave)(struct crypto_tfm *tfm, u8 *d, const u8 *s);
 };
 
 struct compress_alg {