aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlloyd <[email protected]>2010-10-29 12:59:19 +0000
committerlloyd <[email protected]>2010-10-29 12:59:19 +0000
commit2e89e24a4b35172eab4799a3243263bca950a9d2 (patch)
tree0b18c52d28c7796a8b064ad30def1a5014aa9b5f
parenta8de7de2c8e3fc559d050bc3887d9fd12bac58ab (diff)
New way of specifying key lengths
-rw-r--r--doc/examples/new_engine.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/doc/examples/new_engine.cpp b/doc/examples/new_engine.cpp
index ed4abf4d2..4a2339bef 100644
--- a/doc/examples/new_engine.cpp
+++ b/doc/examples/new_engine.cpp
@@ -21,7 +21,12 @@ class XOR_Cipher : public StreamCipher
// return a new object of this type
StreamCipher* clone() const { return new XOR_Cipher; }
- XOR_Cipher() : StreamCipher(1, 32) { mask_pos = 0; }
+ Key_Length_Specification key_spec() const
+ {
+ return Key_Length_Specification(1, 32);
+ }
+
+ XOR_Cipher() : mask_pos(0) {}
private:
void cipher(const byte in[], byte out[], size_t length)
{