7#include <botan/internal/ct_utils.h>
9#include <botan/mem_ops.h>
14 std::span<uint8_t> output,
15 std::span<const uint8_t> input,
52 for(
size_t i = 0; i != input.size(); ++i) {
63 const size_t this_loop = offset + i;
69 for(
size_t j = i; j != input.size(); ++j) {
70 const uint8_t
b = input[j];
72 output[i] |= is_eq.if_set_return(
b);
77 const size_t output_bytes = input.size() - offset;
85 size_t leading_zeros = 0;
86 auto only_zeros = Mask<uint8_t>::set();
87 for(
size_t i = 0; i != input.size(); ++i) {
89 leading_zeros += only_zeros.if_set_return(1);
106 output.resize(written.value_or(0));
#define BOTAN_ARG_CHECK(expr, msg)
static constexpr Choice yes()
static constexpr Mask< T > is_lte(T x, T y)
static constexpr Mask< T > from_choice(Choice c)
static constexpr Mask< T > is_equal(T x, T y)
static constexpr Mask< T > is_zero(T x)
secure_vector< uint8_t > strip_leading_zeros(std::span< const uint8_t > input)
constexpr void unpoison_all(Ts &&... ts)
BOTAN_TEST_API CT::Option< size_t > copy_output(CT::Choice accept, std::span< uint8_t > output, std::span< const uint8_t > input, size_t offset)
size_t count_leading_zero_bytes(std::span< const uint8_t > input)
constexpr void poison(const T *p, size_t n)
std::vector< T, secure_allocator< T > > secure_vector
constexpr void clear_mem(T *ptr, size_t n)