Botan 3.6.1
Crypto and TLS for C&
ct_utils.h File Reference

Internal Header. More...

#include <botan/concepts.h>
#include <botan/secmem.h>
#include <botan/internal/bit_ops.h>
#include <botan/internal/stl_util.h>
#include <optional>
#include <span>
#include <type_traits>

Go to the source code of this file.

Classes

class  Botan::CT::Choice
 
class  Botan::CT::Mask< T >
 
class  Botan::CT::Option< T >
 

Namespaces

namespace  Botan
 
namespace  Botan::CT
 

Concepts

concept  Botan::CT::poisonable
 
concept  Botan::CT::unpoisonable
 
concept  Botan::CT::ct_conditional_assignable
 

Functions

template<typename T >
constexpr CT::Mask< TBotan::CT::all_zeros (const T elem[], size_t len)
 
template<typename T >
constexpr Mask< TBotan::CT::conditional_assign_mem (Choice cnd, T *sink, const T *src, size_t elems)
 
template<typename T >
constexpr Mask< TBotan::CT::conditional_assign_mem (T cnd, T *sink, const T *src, size_t elems)
 
template<typename T >
constexpr Mask< TBotan::CT::conditional_copy_mem (Mask< T > mask, T *to, const T *from0, const T *from1, size_t elems)
 
template<typename T >
constexpr Mask< TBotan::CT::conditional_copy_mem (T cnd, T *to, const T *from0, const T *from1, size_t elems)
 
template<typename T >
constexpr void Botan::CT::conditional_swap (bool cnd, T &x, T &y)
 
template<typename T >
constexpr void Botan::CT::conditional_swap_ptr (bool cnd, T &x, T &y)
 
BOTAN_TEST_API CT::Option< size_t > Botan::CT::copy_output (CT::Choice accept, std::span< uint8_t > output, std::span< const uint8_t > input, size_t offset)
 
size_t Botan::CT::count_leading_zero_bytes (std::span< const uint8_t > input)
 
template<typename T >
constexpr CT::Mask< TBotan::CT::is_equal (const T x[], const T y[], size_t len)
 
template<typename T >
constexpr CT::Mask< TBotan::CT::is_not_equal (const T x[], const T y[], size_t len)
 
secure_vector< uint8_t > Botan::CT::strip_leading_zeros (std::span< const uint8_t > input)
 
template<typename T >
constexpr T Botan::CT::value_barrier (T x)
 
Constant Time Check Annotation Helpers
template<typename T >
constexpr void Botan::CT::poison (const T *p, size_t n)
 
bool Botan::CT::poison_has_effect ()
 
template<typename T >
constexpr void Botan::CT::unpoison (const T *p, size_t n)
 
Constant Time Check Annotation Convenience overloads
template<typename T >
requires requires(const T& v) { ::Botan::CT::poison(v); }
constexpr void Botan::CT::poison (const std::optional< T > &x)
 
template<typename T >
requires requires(const T& x) { x._const_time_poison(); }
constexpr void Botan::CT::poison (const T &x)
 
template<ranges::spanable_range R>
requires std::is_trivially_copyable_v<std::ranges::range_value_t<R>>
constexpr void Botan::CT::poison (R &&r)
 
template<std::integral T>
constexpr void Botan::CT::poison (T &p)
 
template<typename T >
requires requires(const T& v) { ::Botan::CT::unpoison(v); }
constexpr void Botan::CT::unpoison (const std::optional< T > &x)
 
template<typename T >
requires requires(const T& x) { x._const_time_unpoison(); }
constexpr void Botan::CT::unpoison (const T &x)
 
template<ranges::spanable_range R>
requires std::is_trivially_copyable_v<std::ranges::range_value_t<R>>
constexpr void Botan::CT::unpoison (R &&r)
 
template<std::integral T>
constexpr void Botan::CT::unpoison (T &p)
 
Higher-level Constant Time Check Annotation Helpers
template<poisonable T>
requires (std::is_rvalue_reference_v<decltype(v)>)
decltype(auto) Botan::CT::driveby_poison (T &&v)
 
template<unpoisonable T>
requires (std::is_rvalue_reference_v<decltype(v)>)
decltype(auto) Botan::CT::driveby_unpoison (T &&v)
 
template<poisonable... Ts>
requires (sizeof...(Ts) > 0)
constexpr void Botan::CT::poison_all (Ts &&... ts)
 
template<std::ranges::range R>
requires poisonable<std::ranges::range_value_t<R>>
constexpr void Botan::CT::poison_range (R &&r)
 
template<typename... Ts>
requires (sizeof...(Ts) > 0) && (poisonable<Ts> && ...) && (unpoisonable<Ts> && ...)
constexpr auto Botan::CT::scoped_poison (const Ts &... xs)
 
template<unpoisonable... Ts>
requires (sizeof...(Ts) > 0)
constexpr void Botan::CT::unpoison_all (Ts &&... ts)
 
template<std::ranges::range R>
requires unpoisonable<std::ranges::range_value_t<R>>
constexpr void Botan::CT::unpoison_range (R &&r)
 

Detailed Description

Internal Header.

Definition in file ct_utils.h.