aboutsummaryrefslogtreecommitdiffstats
path: root/src/utils/xor_buf.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils/xor_buf.h')
-rw-r--r--src/utils/xor_buf.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/utils/xor_buf.h b/src/utils/xor_buf.h
index 3c96dea70..b67d84c50 100644
--- a/src/utils/xor_buf.h
+++ b/src/utils/xor_buf.h
@@ -9,6 +9,7 @@
#define BOTAN_XOR_BUF_H__
#include <botan/types.h>
+#include <vector>
namespace Botan {
@@ -70,6 +71,31 @@ inline void xor_buf(byte out[],
out[i] = in[i] ^ in2[i];
}
+template<typename Alloc, typename Alloc2>
+void xor_buf(std::vector<byte, Alloc>& out,
+ const std::vector<byte, Alloc2>& in,
+ size_t n)
+ {
+ xor_buf(&out[0], &in[0], n);
+ }
+
+template<typename Alloc>
+void xor_buf(std::vector<byte, Alloc>& out,
+ const byte* in,
+ size_t n)
+ {
+ xor_buf(&out[0], in, n);
+ }
+
+template<typename Alloc, typename Alloc2>
+void xor_buf(std::vector<byte, Alloc>& out,
+ const byte* in,
+ const std::vector<byte, Alloc2>& in2,
+ size_t n)
+ {
+ xor_buf(&out[0], &in[0], &in2[0], n);
+ }
+
}
#endif