aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/stream/ctr/ctr.h
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2017-10-20 20:15:16 -0400
committerJack Lloyd <[email protected]>2017-10-20 20:15:16 -0400
commitcba904d7a474ef4151654c762d110ffd19841b33 (patch)
treec49b12f2017607c43723465c2965b11a271e23e9 /src/lib/stream/ctr/ctr.h
parenta6e051bea6e7341f8f7b8ab40e042e1e099b9b8b (diff)
Allow setting CTR width via string
Prohibit very small counter widths (under 4 bytes), since they lead to trivial keystream reuse. Add tests. Fix clone which always returned an object with a block-wide counter.
Diffstat (limited to 'src/lib/stream/ctr/ctr.h')
-rw-r--r--src/lib/stream/ctr/ctr.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/stream/ctr/ctr.h b/src/lib/stream/ctr/ctr.h
index 3ff63b8e5..c4c598161 100644
--- a/src/lib/stream/ctr/ctr.h
+++ b/src/lib/stream/ctr/ctr.h
@@ -34,7 +34,7 @@ class BOTAN_PUBLIC_API(2,0) CTR_BE final : public StreamCipher
std::string name() const override;
CTR_BE* clone() const override
- { return new CTR_BE(m_cipher->clone()); }
+ { return new CTR_BE(m_cipher->clone(), m_ctr_size); }
void clear() override;