7#include <botan/mem_ops.h>
8#include <botan/internal/ct_utils.h>
12#if defined(BOTAN_HAS_LOCKING_ALLOCATOR)
13 #include <botan/internal/locking_allocator.h>
20 if(elems == 0 || elem_size == 0)
24 const size_t total_size = elems * elem_size;
26 if(total_size < elems || total_size < elem_size)
27 throw std::bad_alloc();
29#if defined(BOTAN_HAS_LOCKING_ALLOCATOR)
34#if defined(BOTAN_TARGET_OS_HAS_ALLOC_CONCEAL)
35 void *ptr = ::calloc_conceal(elems, elem_size);
37 void* ptr = std::calloc(elems, elem_size);
40 throw std::bad_alloc();
51#if defined(BOTAN_HAS_LOCKING_ALLOCATOR)
60#if defined(BOTAN_HAS_LOCKING_ALLOCATOR)
69 volatile uint8_t difference = 0;
71 for(
size_t i = 0; i != len; ++i)
72 difference = difference | (x[i] ^ y[i]);
static Mask< T > is_zero(T x)
static mlock_allocator & instance()
BOTAN_MALLOC_FN void * allocate_memory(size_t elems, size_t elem_size)
void deallocate_memory(void *p, size_t elems, size_t elem_size)
void secure_scrub_memory(void *ptr, size_t n)
uint8_t ct_compare_u8(const uint8_t x[], const uint8_t y[], size_t len)
void initialize_allocator()