Botan 3.5.0
Crypto and TLS for C&
int_utils.h File Reference

Internal Header. More...

#include <botan/concepts.h>
#include <botan/exceptn.h>
#include <botan/types.h>
#include <limits>
#include <optional>

Go to the source code of this file.

Classes

struct  Botan::detail::unwrap_type< T >
 
struct  Botan::detail::unwrap_type< T >
 

Namespaces

namespace  Botan
 
namespace  Botan::detail
 

Concepts

concept  Botan::detail::int_or_strong_type
 

Macros

#define BOTAN_CHECKED_ADD(x, y)   checked_add(x, y, __FILE__, __LINE__)
 
#define BOTAN_CHECKED_MUL(x, y)   checked_mul(x, y)
 

Typedefs

template<int_or_strong_type T>
using Botan::detail::unwrap_type_t = typename unwrap_type<T>::type
 

Functions

template<std::unsigned_integral T>
constexpr std::optional< TBotan::checked_add (T a, T b)
 
template<std::unsigned_integral T, std::unsigned_integral... Ts>
requires all_same_v<T, Ts...>
constexpr std::optional< TBotan::checked_add (T a, T b, Ts... rest)
 
template<detail::int_or_strong_type RT, detail::int_or_strong_type AT>
constexpr RT Botan::checked_cast_to (AT i)
 
template<detail::int_or_strong_type RT, typename ExceptionType , detail::int_or_strong_type AT>
constexpr RT Botan::checked_cast_to_or_throw (AT i, std::string_view error_msg_on_fail)
 
template<std::unsigned_integral T>
constexpr std::optional< TBotan::checked_mul (T a, T b)
 
template<int_or_strong_type T>
constexpr auto Botan::detail::unwrap (T t) -> unwrap_type_t< T >
 
template<int_or_strong_type T>
constexpr auto Botan::detail::wrap (unwrap_type_t< T > t) -> T
 

Detailed Description

Internal Header.

Definition in file int_utils.h.

Macro Definition Documentation

◆ BOTAN_CHECKED_ADD

#define BOTAN_CHECKED_ADD ( x,
y )   checked_add(x, y, __FILE__, __LINE__)

Definition at line 113 of file int_utils.h.

◆ BOTAN_CHECKED_MUL

#define BOTAN_CHECKED_MUL ( x,
y )   checked_mul(x, y)

Definition at line 114 of file int_utils.h.