aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/stream/rc4/rc4.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/stream/rc4/rc4.cpp')
-rw-r--r--src/lib/stream/rc4/rc4.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/lib/stream/rc4/rc4.cpp b/src/lib/stream/rc4/rc4.cpp
index 1a5ad80e9..dcf4af241 100644
--- a/src/lib/stream/rc4/rc4.cpp
+++ b/src/lib/stream/rc4/rc4.cpp
@@ -5,12 +5,23 @@
* Botan is released under the Simplified BSD License (see license.txt)
*/
+#include <botan/internal/stream_utils.h>
#include <botan/rc4.h>
-#include <botan/internal/xor_buf.h>
#include <botan/internal/rounding.h>
namespace Botan {
+BOTAN_REGISTER_NAMED_T(StreamCipher, "RC4", RC4, RC4::make);
+
+RC4* RC4::make(const Spec& spec)
+ {
+ if(spec.algo_name() == "RC4")
+ return new RC4(spec.arg_as_integer(0, 0));
+ if(spec.algo_name() == "RC4_drop")
+ return new RC4(768);
+ return nullptr;
+ }
+
/*
* Combine cipher stream with message
*/