aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/stream
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/stream')
-rw-r--r--src/lib/stream/info.txt4
-rw-r--r--src/lib/stream/stream_cipher.cpp24
-rw-r--r--src/lib/stream/stream_cipher.h9
-rw-r--r--src/lib/stream/stream_utils.h9
4 files changed, 10 insertions, 36 deletions
diff --git a/src/lib/stream/info.txt b/src/lib/stream/info.txt
index 15f0e91e5..8dc30936d 100644
--- a/src/lib/stream/info.txt
+++ b/src/lib/stream/info.txt
@@ -1,9 +1,5 @@
define STREAM_CIPHER 20131128
-<requires>
-algo_base
-</requires>
-
<header:public>
stream_cipher.h
</header:public>
diff --git a/src/lib/stream/stream_cipher.cpp b/src/lib/stream/stream_cipher.cpp
deleted file mode 100644
index 72eb63b7c..000000000
--- a/src/lib/stream/stream_cipher.cpp
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
-* Stream Cipher
-* (C) 1999-2010 Jack Lloyd
-*
-* Botan is released under the Simplified BSD License (see license.txt)
-*/
-
-#include <botan/stream_cipher.h>
-
-namespace Botan {
-
-void StreamCipher::set_iv(const byte[], size_t iv_len)
- {
- if(iv_len)
- throw Invalid_Argument("The stream cipher " + name() +
- " does not support resyncronization");
- }
-
-bool StreamCipher::valid_iv_length(size_t iv_len) const
- {
- return (iv_len == 0);
- }
-
-}
diff --git a/src/lib/stream/stream_cipher.h b/src/lib/stream/stream_cipher.h
index 2ca92e467..9768aea70 100644
--- a/src/lib/stream/stream_cipher.h
+++ b/src/lib/stream/stream_cipher.h
@@ -8,6 +8,7 @@
#ifndef BOTAN_STREAM_CIPHER_H__
#define BOTAN_STREAM_CIPHER_H__
+#include <botan/transform.h>
#include <botan/sym_algo.h>
#include <botan/scan_name.h>
@@ -52,13 +53,17 @@ class BOTAN_DLL StreamCipher : public SymmetricAlgorithm
* @param iv the initialization vector
* @param iv_len the length of the IV in bytes
*/
- virtual void set_iv(const byte iv[], size_t iv_len);
+ virtual void set_iv(const byte[], size_t iv_len)
+ {
+ if(iv_len)
+ throw Invalid_IV_Length(name(), iv_len);
+ }
/**
* @param iv_len the length of the IV in bytes
* @return if the length is valid for this algorithm
*/
- virtual bool valid_iv_length(size_t iv_len) const;
+ virtual bool valid_iv_length(size_t iv_len) const { return (iv_len == 0); }
/**
* Get a new object representing the same algorithm as *this
diff --git a/src/lib/stream/stream_utils.h b/src/lib/stream/stream_utils.h
index 7503029f6..2e8f58562 100644
--- a/src/lib/stream/stream_utils.h
+++ b/src/lib/stream/stream_utils.h
@@ -5,10 +5,10 @@
* Botan is released under the Simplified BSD License (see license.txt)
*/
-#ifndef BOTAN_STREAM_CIPHER_UTIL_H__
-#define BOTAN_STREAM_CIPHER_UTIL_H__
+#ifndef BOTAN_STREAM_CIPHER_UTILS_H__
+#define BOTAN_STREAM_CIPHER_UTILS_H__
-#include <botan/algo_registry.h>
+#include <botan/internal/algo_registry.h>
#include <botan/loadstor.h>
#include <botan/rotate.h>
#include <botan/internal/xor_buf.h>
@@ -25,9 +25,6 @@ namespace Botan {
#define BOTAN_REGISTER_STREAM_CIPHER_NAMED_1LEN(type, name, def) \
BOTAN_REGISTER_NAMED_T(StreamCipher, name, type, (make_new_T_1len<type,def>))
-#define BOTAN_REGISTER_STREAM_CIPHER_NOARGS_IF(cond, type, name, provider) \
- BOTAN_COND_REGISTER_NAMED_T_NOARGS(cond, StreamCipher, type, name, provider)
-
}
#endif