diff options
author | Jack Lloyd <[email protected]> | 2018-09-18 14:11:23 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2018-09-18 14:11:23 -0400 |
commit | 4ffa60d1bd7904e2b7ce7b39b977dc6e93210ce5 (patch) | |
tree | a357438596e37fd35a009e41f4ee6ce66f44fd2a /src | |
parent | 189b1270b640a92e733ddc87660d0506dcc18f19 (diff) |
Use an Alloc template to reduce duplication in Filter::send
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/filters/filter.h | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/src/lib/filters/filter.h b/src/lib/filters/filter.h index a0857c589..94b9c6ccd 100644 --- a/src/lib/filters/filter.h +++ b/src/lib/filters/filter.h @@ -67,28 +67,20 @@ class BOTAN_PUBLIC_API(2,0) Filter /** * @param in some input for the filter */ - void send(const secure_vector<uint8_t>& in) { send(in.data(), in.size()); } - - /** - * @param in some input for the filter - */ - void send(const std::vector<uint8_t>& in) { send(in.data(), in.size()); } - - /** - * @param in some input for the filter - * @param length the number of bytes of in to send - */ - void send(const secure_vector<uint8_t>& in, size_t length) + template<typename Alloc> + void send(const std::vector<uint8_t, Alloc>& in) { - send(in.data(), length); + send(in.data(), in.size()); } /** * @param in some input for the filter * @param length the number of bytes of in to send */ - void send(const std::vector<uint8_t>& in, size_t length) + template<typename Alloc> + void send(const std::vector<uint8_t, Alloc>& in, size_t length) { + BOTAN_ASSERT_NOMSG(length <= in.size()); send(in.data(), length); } |