aboutsummaryrefslogtreecommitdiffstats
path: root/src/block/block_cipher.h
diff options
context:
space:
mode:
authorlloyd <[email protected]>2010-02-25 06:04:42 +0000
committerlloyd <[email protected]>2010-02-25 06:04:42 +0000
commitdb1b57b499ad34a49adf4a2c53651d79c470b4f2 (patch)
tree29f2a209ce43549981ceab0e6c0b079691984970 /src/block/block_cipher.h
parent3ed1e1f8e9928d7242c233919e1255ffb6b41144 (diff)
Instead of the mode parallelism being specified via macros, have it
depend on the particular implementation. Add a new virtual function to BlockCipher named parallelism that returns the number of blocks the cipher object could or might want to process in parallel. Currently set to 1 by default but may make sense to increase this for even scalar implementations since it seems like better caching behavior makes it a win.
Diffstat (limited to 'src/block/block_cipher.h')
-rw-r--r--src/block/block_cipher.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/block/block_cipher.h b/src/block/block_cipher.h
index 06e8c5cea..b3e1b0e31 100644
--- a/src/block/block_cipher.h
+++ b/src/block/block_cipher.h
@@ -24,6 +24,11 @@ class BOTAN_DLL BlockCipher : public SymmetricAlgorithm
const u32bit BLOCK_SIZE;
/**
+ * @return the preferred parallelism of this cipher
+ */
+ virtual u32bit parallelism() const { return 1; }
+
+ /**
* Encrypt a block.
* @param in The plaintext block to be encrypted as a byte array.
* Must be of length BLOCK_SIZE.