Botan 3.9.0
Crypto and TLS for C&
|
Classes | |
struct | AutoDetect |
class | bitvector_iterator |
class | Bounded_XOF |
class | Container_Strong_Adapter_Base |
struct | first_type |
class | Strong_Adapter |
class | Strong_Adapter< T > |
class | Strong_Base |
struct | wrapped_type_helper |
struct | wrapped_type_helper< T > |
struct | wrapped_type_helper_with_enum |
struct | wrapped_type_helper_with_enum< T > |
Concepts | |
concept | is_blockwise_processing_callback_return_type |
concept | blockwise_processing_callback_without_mask |
concept | blockwise_processing_callback_with_mask |
concept | blockwise_processing_callback |
concept | manipulating_blockwise_processing_callback |
concept | predicate_blockwise_processing_callback |
concept | custom_loadable |
concept | custom_storable |
concept | unsigned_integralish |
Typedefs | |
template<typename OutT, typename> | |
using | as = OutT |
template<typename FnT, std::unsigned_integral BlockT, typename... ParamTs> | |
using | blockwise_processing_callback_return_type = std::invoke_result_t<FnT, as<BlockT, ParamTs>...> |
template<typename... Ts> | |
using | first_t = typename first_type<Ts...>::type |
template<unsigned_integralish T> | |
using | wrapped_type = typename wrapped_type_helper_with_enum<T>::type |
Functions | |
template<ranges::spanable_range OutR, ranges::spanable_range... Rs> requires (concepts::reservable_container<OutR> || ranges::statically_spanable_range<OutR>) | |
constexpr OutR | concatenate (Rs &&... ranges) |
template<bitvectorish T1, bitvectorish T2> | |
constexpr auto | copy_lhs_allocator_aware (const T1 &lhs, const T2 &) |
template<std::endian endianness, unsigned_integralish T> | |
size_t | copy_out_any_word_aligned_portion (std::span< uint8_t > &out, std::span< const T > &in) |
template<std::endian endianness, std::unsigned_integral OutT, ranges::contiguous_range< uint8_t > InR> | |
constexpr OutT | fallback_load_any (const InR &in_range) |
template<std::endian endianness, std::unsigned_integral InT, ranges::contiguous_output_range< uint8_t > OutR> | |
constexpr void | fallback_store_any (InT in, OutR &&out_range) |
template<std::endian endianness, typename OutT, ranges::contiguous_range< uint8_t > InR, unsigned_integralish... Ts> requires (sizeof...(Ts) > 0) && ((std::same_as<AutoDetect, OutT> && all_same_v<Ts...>) || (unsigned_integralish<OutT> && all_same_v<OutT, Ts...>)) | |
constexpr void | load_any (const InR &in, Ts &... outs) |
template<std::endian endianness, unsigned_integralish WrappedOutT, ranges::contiguous_range< uint8_t > InR> requires (custom_loadable<strong_type_wrapped_type<WrappedOutT>>) | |
constexpr WrappedOutT | load_any (const InR &in_range) |
template<std::endian endianness, unsigned_integralish OutT> | |
constexpr OutT | load_any (const uint8_t in[], size_t off) |
template<std::endian endianness, typename OutT, unsigned_integralish... Ts> requires (sizeof...(Ts) > 0 && all_same_v<Ts...> && ((std::same_as<AutoDetect, OutT> && all_same_v<Ts...>) || (unsigned_integralish<OutT> && all_same_v<OutT, Ts...>))) | |
constexpr void | load_any (const uint8_t in[], Ts &... outs) |
template<std::endian endianness, unsigned_integralish WrappedOutT, ranges::contiguous_range< uint8_t > InR> requires (!custom_loadable<strong_type_wrapped_type<WrappedOutT>>) | |
constexpr WrappedOutT | load_any (InR &&in_range) |
template<std::endian endianness, typename OutT, ranges::contiguous_range< uint8_t > InR> requires (std::same_as<AutoDetect, OutT> || ((ranges::statically_spanable_range<OutT> || concepts::resizable_container<OutT>) && unsigned_integralish<typename OutT::value_type>)) | |
constexpr auto | load_any (InR &&in_range) |
template<std::endian endianness, typename OutT, ranges::contiguous_output_range OutR, ranges::contiguous_range< uint8_t > InR> requires (unsigned_integralish<std::ranges::range_value_t<OutR>> && (std::same_as<AutoDetect, OutT> || std::same_as<OutT, std::ranges::range_value_t<OutR>>)) | |
constexpr void | load_any (OutR &&out, const InR &in) |
template<std::endian endianness, typename OutT, unsigned_integralish T> requires (std::same_as<AutoDetect, OutT> || std::same_as<T, OutT>) | |
constexpr void | load_any (T out[], const uint8_t in[], size_t count) |
consteval std::endian | opposite (std::endian endianness) |
template<std::endian endianness, typename OutR, ranges::spanable_range InR> requires (std::same_as<AutoDetect, OutR> || (ranges::statically_spanable_range<OutR> && std::default_initializable<OutR>) || concepts::resizable_byte_buffer<OutR>) | |
constexpr auto | store_any (InR &&in_range) |
template<std::endian endianness, typename InT, ranges::contiguous_output_range< uint8_t > OutR, ranges::spanable_range InR> requires (std::same_as<AutoDetect, InT> || std::same_as<InT, std::ranges::range_value_t<InR>>) | |
constexpr void | store_any (OutR &&out, const InR &in) |
template<std::endian endianness, typename InT, ranges::contiguous_output_range< uint8_t > OutR, unsigned_integralish... Ts> requires (sizeof...(Ts) > 0) && ((std::same_as<AutoDetect, InT> && all_same_v<Ts...>) || (unsigned_integralish<InT> && all_same_v<InT, Ts...>)) | |
constexpr void | store_any (OutR &&out, Ts... ins) |
template<std::endian endianness, typename InT, unsigned_integralish T, ranges::contiguous_output_range< uint8_t > OutR> requires std::same_as<AutoDetect, InT> | |
constexpr void | store_any (T in, OutR &&out_range) |
template<std::endian endianness, typename InT, unsigned_integralish T> requires (std::same_as<AutoDetect, InT> || std::same_as<T, InT>) | |
constexpr void | store_any (T in, uint8_t out[]) |
template<std::endian endianness, typename OutR, unsigned_integralish... Ts> requires all_same_v<Ts...> | |
constexpr auto | store_any (Ts... ins) |
template<std::endian endianness, typename InT, unsigned_integralish T0, unsigned_integralish... Ts> requires (std::same_as<AutoDetect, InT> || std::same_as<T0, InT>) && all_same_v<T0, Ts...> | |
constexpr void | store_any (uint8_t out[], T0 in0, Ts... ins) |
template<std::endian endianness, unsigned_integralish WrappedInT, ranges::contiguous_output_range< uint8_t > OutR> requires (custom_storable<strong_type_wrapped_type<WrappedInT>>) | |
constexpr void | store_any (WrappedInT wrapped_in, const OutR &out_range) |
template<std::endian endianness, unsigned_integralish WrappedInT, ranges::contiguous_output_range< uint8_t > OutR> requires (!custom_storable<strong_type_wrapped_type<WrappedInT>>) | |
constexpr void | store_any (WrappedInT wrapped_in, OutR &&out_range) |
template<unsigned_integralish InT> | |
constexpr auto | unwrap_strong_type_or_enum (InT t) |
template<unsigned_integralish OutT, std::unsigned_integral T> | |
constexpr auto | wrap_strong_type_or_enum (T t) |
Variables | |
template<typename CapabilityT, typename... Tags> | |
constexpr bool | has_capability = (std::is_same_v<CapabilityT, Tags> || ...) |
using Botan::detail::as = OutT |
Definition at line 74 of file bitvector.h.
using Botan::detail::blockwise_processing_callback_return_type = std::invoke_result_t<FnT, as<BlockT, ParamTs>...> |
Definition at line 77 of file bitvector.h.
using Botan::detail::first_t = typename first_type<Ts...>::type |
Definition at line 63 of file bitvector.h.
using Botan::detail::wrapped_type = typename wrapped_type_helper_with_enum<T>::type |
Definition at line 187 of file loadstor.h.
|
constexpr |
Helper function that performs range size-checks as required given the selected output and input range types. If all lengths are known at compile time, this check will be performed at compile time as well. It will then instantiate an output range and concatenate the input ranges' contents.
Definition at line 196 of file stl_util.h.
References BOTAN_ARG_CHECK, and Botan::unwrap_strong_type().
Referenced by Botan::concat().
|
constexpr |
If one of the allocators is a Botan::secure_allocator, this will always prefer it. Otherwise, the allocator of lhs
will be used as a default.
Definition at line 1313 of file bitvector.h.
Referenced by Botan::operator&(), Botan::operator^(), and Botan::operator|().
|
inline |
Definition at line 752 of file loadstor.h.
References BOTAN_ASSERT_NOMSG, and store_any().
Referenced by Botan::copy_out_be(), and Botan::copy_out_le().
|
inlineconstexpr |
Manually load a word from a range in either big or little endian byte order.
This is only used at compile time.
Definition at line 214 of file loadstor.h.
Referenced by load_any().
|
inlineconstexpr |
Manually store a word into a range in either big or little endian byte order.
This will be used only at compile time.
Definition at line 236 of file loadstor.h.
References Botan::get_byte().
Referenced by store_any().
|
inlineconstexpr |
Load many unsigned integers
in | a fixed-length span to some bytes |
outs | a arbitrary-length parameter list of unsigned integers to be loaded |
Definition at line 332 of file loadstor.h.
References Botan::ranges::assert_exact_byte_length(), and load_any().
|
inlineconstexpr |
Load a custom object from a range in either big or little endian byte order
This is the base implementation for custom objects (e.g. SIMD type wrappres), all other overloads are just convenience overloads.
in_range | a fixed-length byte range |
in_range
, as a big-endian value Definition at line 313 of file loadstor.h.
References Botan::ranges::assert_exact_byte_length(), and Botan::wrap_strong_type().
|
inlineconstexpr |
Load a word from in
at some offset off
in | a pointer to some bytes |
off | an offset into the array |
Definition at line 454 of file loadstor.h.
References load_any().
|
inlineconstexpr |
Load many words from in
in | a pointer to some bytes |
outs | a arbitrary-length parameter list of unsigned integers to be loaded |
Definition at line 469 of file loadstor.h.
References load_any().
|
inlineconstexpr |
Load a word from a range in either big or little endian byte order
This is the base implementation, all other overloads are just convenience wrappers. It is assumed that the range has the correct size for the word.
Template arguments of all overloads of load_any() share the same semantics:
3+. Argument types Typically, those are input and output ranges of bytes or unsigned integers. Or one or more unsigned integers acting as output parameters.
in_range | a fixed-length byte range |
in_range
, as a big-endian value Definition at line 278 of file loadstor.h.
References Botan::ranges::assert_exact_byte_length(), fallback_load_any(), opposite(), Botan::reverse_bytes(), Botan::typecast_copy(), and wrap_strong_type_or_enum().
Referenced by load_any(), load_any(), load_any(), load_any(), load_any(), load_any(), Botan::load_be(), and Botan::load_le().
|
inlineconstexpr |
Load one or more unsigned integers, auto-detect the output type if possible. Otherwise, use the specified integer or integer container type.
in_range | a statically-sized range with some bytes |
Definition at line 397 of file loadstor.h.
References BOTAN_ARG_CHECK, and load_any().
|
inlineconstexpr |
Load a variable number of words from in
into out
. The byte length of the out
and in
ranges must match.
out | the output range of words |
in | the input range of bytes |
Definition at line 355 of file loadstor.h.
References Botan::ranges::assert_equal_byte_lengths(), load_any(), and Botan::typecast_copy().
|
inlineconstexpr |
Load a variable number of words from in
into out
.
out | the output array of words |
in | the input array of bytes |
count | how many words are in in |
Definition at line 483 of file loadstor.h.
References load_any().
|
consteval |
Note this assumes that there are only two endian orderings; we do not supported mixed endian systems
Definition at line 136 of file loadstor.h.
Referenced by load_any(), and store_any().
|
inlineconstexpr |
The caller provided some integer values in a collection but did not provide the output container. Let's create one for them, fill it with one of the overloads above and return it. This will default to a std::array if the caller did not specify the desired output container type.
in_range | a range of words that should be stored |
Definition at line 663 of file loadstor.h.
References store_any().
|
inlineconstexpr |
Store a variable number of words given in in
into out
. The byte lengths of in
and out
must be consistent.
out | the output range of bytes |
in | the input range of words |
Definition at line 603 of file loadstor.h.
References Botan::ranges::assert_equal_byte_lengths(), store_any(), and Botan::typecast_copy().
|
inlineconstexpr |
Store many unsigned integers words into a byte range
out | a sized range of some bytes |
ins | a arbitrary-length parameter list of unsigned integers to be stored |
Definition at line 582 of file loadstor.h.
References Botan::ranges::assert_exact_byte_length(), and store_any().
|
inlineconstexpr |
Infer InT from a single unsigned integer input parameter.
TODO: we might consider dropping this overload (i.e. out-range as second parameter) and make this a "special case" of the overload below, that takes a variadic number of input parameters.
in | an unsigned integer to be stored |
out_range | a range of bytes to store the word into |
Definition at line 646 of file loadstor.h.
References store_any().
|
inlineconstexpr |
Store a single unsigned integer into a raw pointer
in | the input unsigned integer |
out | the byte array to write to |
Definition at line 711 of file loadstor.h.
References store_any().
|
inlineconstexpr |
The caller provided some integer values but did not provide the output container. Let's create one for them, fill it with one of the overloads above and return it. This will default to a std::array if the caller did not specify the desired output container type.
ins | some words that should be stored |
Definition at line 696 of file loadstor.h.
References store_any().
|
inlineconstexpr |
Store many unsigned integers words into a raw pointer
ins | a arbitrary-length parameter list of unsigned integers to be stored |
out | the byte array to write to |
Definition at line 723 of file loadstor.h.
References store_any().
|
inlineconstexpr |
Store a custom word in either big or little endian byte order into a range
This is the base implementation for storing custom objects, all other overloads are just convenience overloads.
wrapped_in | a custom object to be stored |
out_range | a byte range to store the word into |
Definition at line 559 of file loadstor.h.
References Botan::ranges::assert_exact_byte_length(), and unwrap_strong_type_or_enum().
|
inlineconstexpr |
Store a word in either big or little endian byte order into a range
This is the base implementation, all other overloads are just convenience wrappers. It is assumed that the range has the correct size for the word.
Template arguments of all overloads of store_any() share the same semantics as those of load_any(). See the documentation of this function for more details.
wrapped_in | an unsigned integral to be stored |
out_range | a byte range to store the word into |
Definition at line 525 of file loadstor.h.
References Botan::ranges::assert_exact_byte_length(), fallback_store_any(), opposite(), Botan::reverse_bytes(), Botan::typecast_copy(), and unwrap_strong_type_or_enum().
Referenced by copy_out_any_word_aligned_portion(), store_any(), store_any(), store_any(), store_any(), store_any(), store_any(), store_any(), Botan::store_be(), and Botan::store_le().
|
constexpr |
Definition at line 190 of file loadstor.h.
References Botan::unwrap_strong_type().
Referenced by store_any(), and store_any().
|
constexpr |
Definition at line 200 of file loadstor.h.
References Botan::wrap_strong_type().
Referenced by load_any().
|
constexpr |
Checks whether the CapabilityT
is included in the Tags
type pack.
Definition at line 32 of file strong_type.h.