Botan 3.4.0
Crypto and TLS for C&
|
Classes | |
struct | AutoDetect |
class | Strong_Adapter |
class | Strong_Adapter< T > |
class | Strong_Base |
Concepts | |
concept | unsigned_integralish |
Enumerations | |
enum class | Endianness : bool { Big , Little } |
Functions | |
template<Endianness endianness, unsigned_integralish T> | |
size_t | copy_out_any_word_aligned_portion (std::span< uint8_t > &out, std::span< const T > &in) |
template<Endianness endianness, std::unsigned_integral OutT, ranges::contiguous_range< uint8_t > InR> | |
constexpr OutT | fallback_load_any (InR &&in_range) |
template<Endianness endianness, std::unsigned_integral InT, ranges::contiguous_output_range< uint8_t > OutR> | |
constexpr void | fallback_store_any (InT in, OutR &&out_range) |
constexpr bool | is_native (Endianness endianness) |
constexpr bool | is_opposite (Endianness endianness) |
template<Endianness endianness, unsigned_integralish OutT> | |
constexpr OutT | load_any (const uint8_t in[], size_t off) |
template<Endianness 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<Endianness 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 (InR &&in, Ts &... outs) |
template<Endianness endianness, std::unsigned_integral OutT, ranges::contiguous_range< uint8_t > InR> | |
constexpr OutT | load_any (InR &&in_range) |
template<Endianness endianness, typename OutT , ranges::contiguous_range< uint8_t > InR> requires (std::is_enum_v<OutT> && std::unsigned_integral<std::underlying_type_t<OutT>>) | |
constexpr OutT | load_any (InR &&in_range) |
template<Endianness 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<Endianness 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, InR &&in) |
template<Endianness 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) |
template<Endianness endianness> | |
constexpr bool | native_endianness_is_unknown () |
template<Endianness 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<Endianness endianness, std::unsigned_integral InT, ranges::contiguous_output_range< uint8_t > OutR> | |
constexpr void | store_any (InT in, OutR &&out_range) |
template<Endianness endianness, typename InT , ranges::contiguous_output_range< uint8_t > OutR> requires (std::is_enum_v<InT> && std::unsigned_integral<std::underlying_type_t<InT>>) | |
constexpr void | store_any (InT in, OutR &&out_range) |
template<Endianness 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, InR &&in) |
template<Endianness 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<Endianness 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<Endianness 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<Endianness endianness, typename OutR , unsigned_integralish... Ts> requires all_same_v<Ts...> | |
constexpr auto | store_any (Ts... ins) |
template<Endianness 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) |
Variables | |
template<typename CapabilityT , typename... Tags> | |
constexpr bool | has_capability = (std::is_same_v<CapabilityT, Tags> || ...) |
|
strong |
Enumerator | |
---|---|
Big | |
Little |
Definition at line 126 of file loadstor.h.
size_t Botan::detail::copy_out_any_word_aligned_portion | ( | std::span< uint8_t > & | out, |
std::span< const T > & | in ) |
Definition at line 718 of file loadstor.h.
References BOTAN_ASSERT_NOMSG, and T.
|
inlineconstexpr |
Manually load a word from a range in either big or little endian byte order. This will be used only if the endianness of the target platform is unknown at compile time.
Definition at line 185 of file loadstor.h.
|
inlineconstexpr |
Manually store a word into a range in either big or little endian byte order. This will be used only if the endianness of the target platform is unknown at compile time.
Definition at line 207 of file loadstor.h.
References Big, Botan::get_byte(), and Little.
|
constexpr |
Definition at line 139 of file loadstor.h.
Referenced by load_any(), load_any(), store_any(), and store_any().
|
constexpr |
Definition at line 153 of file loadstor.h.
Referenced by load_any(), and store_any().
|
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 421 of file loadstor.h.
|
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 436 of file loadstor.h.
|
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 299 of file loadstor.h.
References Botan::ranges::assert_exact_byte_length(), and T.
|
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:
Endianness::Big
or Endianness::Little
, that will eventually select the byte order translation mode implemented in this base function.AutoDetect
, an unsigned integer or a container holding an unsigned integer type. AutoDetect
means that the caller did not explicitly specify the type and expects the type to be inferred from the input.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 valueOverload for loading into a strong type holding an unsigned integer
Definition at line 248 of file loadstor.h.
References is_native(), is_opposite(), and Botan::reverse_bytes().
|
inlineconstexpr |
Overload for loading into an enum type that uses an unsigned integer as its underlying type.
Definition at line 286 of file loadstor.h.
|
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 364 of file loadstor.h.
References BOTAN_ARG_CHECK.
|
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 322 of file loadstor.h.
References Botan::ranges::assert_equal_byte_lengths(), is_native(), 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 450 of file loadstor.h.
References T.
|
constexpr |
Definition at line 164 of file loadstor.h.
|
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 629 of file loadstor.h.
|
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.
in | an unsigned integral to be stored |
out_range | a byte range to store the word into |
Overload for loading into a strong type holding an unsigned integer
Definition at line 491 of file loadstor.h.
References is_native(), is_opposite(), Botan::reverse_bytes(), and Botan::typecast_copy().
|
inlineconstexpr |
Overload for storing an enum type that uses an unsigned integer as its underlying type.
Definition at line 531 of file loadstor.h.
|
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 569 of file loadstor.h.
References Botan::ranges::assert_equal_byte_lengths(), is_native(), 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 548 of file loadstor.h.
References Botan::ranges::assert_exact_byte_length(), and T.
|
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 612 of file loadstor.h.
|
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 677 of file loadstor.h.
References T.
|
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 662 of file loadstor.h.
|
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 689 of file loadstor.h.
|
constexpr |
Checks whether the CapabilityT
is included in the Tags
type pack.
Definition at line 31 of file strong_type.h.