From f8cbe97fa18223f037c882a470b58750935748d6 Mon Sep 17 00:00:00 2001 From: Rene Meusel Date: Tue, 21 Nov 2023 17:53:12 +0100 Subject: [PATCH] bitvector<> with basic functionality --- src/lib/utils/bitvector.h | 1442 ++++++++++++++++++++++++++++ src/lib/utils/info.txt | 1 + src/tests/test_utils_bitvector.cpp | 1275 ++++++++++++++++++++++++ 3 files changed, 2718 insertions(+) create mode 100644 src/lib/utils/bitvector.h create mode 100644 src/tests/test_utils_bitvector.cpp diff --git a/src/lib/utils/bitvector.h b/src/lib/utils/bitvector.h new file mode 100644 index 00000000000..2c21a332bf7 --- /dev/null +++ b/src/lib/utils/bitvector.h @@ -0,0 +1,1442 @@ +/* + * An abstraction for an arbitrarily large bitvector that can + * optionally use the secure_allocator. All bitwise accesses and all + * constructors are implemented in constant time. Otherwise, only methods + * with the "ct_" pre-fix run in constant time. + * + * (C) 2023-2024 Jack Lloyd + * (C) 2023-2024 René Meusel, Rohde & Schwarz Cybersecurity + * + * Botan is released under the Simplified BSD License (see license.txt) + */ + +#ifndef BOTAN_BIT_VECTOR_H_ +#define BOTAN_BIT_VECTOR_H_ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +namespace Botan { + +template