|
Botan 3.13.0
Crypto and TLS for C&
|
#include <strong_type.h>
Public Types | |
| using | const_pointer = typename underlying_span::const_pointer |
| The const pointer type of the underlying span. | |
| using | iterator = typename underlying_span::iterator |
| The iterator type of the underlying span. | |
| using | pointer = typename underlying_span::pointer |
| The pointer type of the underlying span. | |
| using | size_type = typename underlying_span::size_type |
| The size type of the underlying span. | |
| using | value_type = typename underlying_span::value_type |
| The element type of the underlying span. | |
Public Member Functions | |
| decltype(auto) | begin () const noexcept(noexcept(this->m_span.begin())) |
| decltype(auto) | begin () noexcept(noexcept(this->m_span.begin())) |
| decltype(auto) | data () const noexcept(noexcept(this->m_span.data())) |
| decltype(auto) | data () noexcept(noexcept(this->m_span.data())) |
| bool | empty () const noexcept(noexcept(this->m_span.empty())) |
| decltype(auto) | end () const noexcept(noexcept(this->m_span.end())) |
| decltype(auto) | end () noexcept(noexcept(this->m_span.end())) |
| underlying_span | get () |
| underlying_span | get () const |
| StrongSpan & | operator= (const StrongSpan &other)=default |
| StrongSpan & | operator= (StrongSpan &&other)=default |
| decltype(auto) | operator[] (typename underlying_span::size_type i) const noexcept |
| decltype(auto) | size () const noexcept(noexcept(this->m_span.size())) |
| StrongSpan ()=default | |
| Default constructor, creates an empty span. | |
| StrongSpan (const StrongSpan &other)=default | |
| template<concepts::contiguous_strong_type T2> requires (std::is_same_v<T2, std::remove_const_t<T>>) | |
| StrongSpan (const StrongSpan< T2 > &other) | |
| StrongSpan (StrongSpan &&other)=default | |
| StrongSpan (T &strong) | |
| StrongSpan (underlying_span span) | |
| ~StrongSpan ()=default | |
This mimics a std::span but keeps track of the strong-type information. Use this when you would want to use const Strong<...>& as a parameter declaration. In particular this allows assigning strong-type information to slices of a bigger buffer without copying the bytes. E.g:
using Foo = Strong<std::vector<uint8_t>, Foo_>;
void bar(StrongSpan<Foo> foo) { ... }
std::vector<uint8_t> buffer; BufferSlicer slicer(buffer); bar(slicer.take<Foo>()); // This does not copy the data from buffer but // just annotates the 'Foo' strong-type info.
Definition at line 1083 of file strong_type.h.
| using Botan::StrongSpan< T >::const_pointer = typename underlying_span::const_pointer |
The const pointer type of the underlying span.
Definition at line 1101 of file strong_type.h.
| using Botan::StrongSpan< T >::iterator = typename underlying_span::iterator |
The iterator type of the underlying span.
Definition at line 1095 of file strong_type.h.
| using Botan::StrongSpan< T >::pointer = typename underlying_span::pointer |
The pointer type of the underlying span.
Definition at line 1098 of file strong_type.h.
| using Botan::StrongSpan< T >::size_type = typename underlying_span::size_type |
The size type of the underlying span.
Definition at line 1092 of file strong_type.h.
| using Botan::StrongSpan< T >::value_type = typename underlying_span::value_type |
The element type of the underlying span.
Definition at line 1089 of file strong_type.h.
|
default |
Default constructor, creates an empty span.
Referenced by operator=(), operator=(), StrongSpan(), StrongSpan(), and StrongSpan().
|
inlineexplicit |
Annotate a plain span with this strong type's information
| span | the span to annotate |
Definition at line 1108 of file strong_type.h.
|
inline |
Create a span covering the contents of a strong type
| strong | the strong type to view |
Definition at line 1113 of file strong_type.h.
|
inline |
Convert a StrongSpan<T> to a StrongSpan<const T>
| other | the span to convert |
Definition at line 1129 of file strong_type.h.
References get(), and StrongSpan().
|
default |
|
default |
|
default |
|
inlinenoexcept |
Iterate the span
Definition at line 1187 of file strong_type.h.
References begin().
|
inlinenoexcept |
Iterate the span
Definition at line 1183 of file strong_type.h.
References begin().
Referenced by begin(), begin(), Botan::Classic_McEliece_KeyPair_Internal::generate(), and Botan::Sphincs_Hash_Functions_Sha2::PRF_msg().
|
inlinenoexcept |
Access the underlying storage
Definition at line 1171 of file strong_type.h.
|
inlinenoexcept |
Access the underlying storage
Definition at line 1167 of file strong_type.h.
Referenced by Botan::ML_KEM_Decryptor::decapsulate(), Botan::FrodoMatrix::deserialize(), and Botan::FrodoMatrix::sample().
|
inlinenoexcept |
Query whether the span is empty
Definition at line 1179 of file strong_type.h.
References empty().
Referenced by empty().
|
inlinenoexcept |
Iterate the span
Definition at line 1195 of file strong_type.h.
References end().
|
inlinenoexcept |
Iterate the span
Definition at line 1191 of file strong_type.h.
References end().
Referenced by end(), end(), and Botan::Classic_McEliece_KeyPair_Internal::generate().
|
inline |
Access the underlying span
Definition at line 1163 of file strong_type.h.
|
inline |
Access the underlying span
Definition at line 1157 of file strong_type.h.
Referenced by StrongSpan(), and Botan::treehash().
|
default |
|
default |
Move assignment
| other | the span to move from |
References StrongSpan().
|
inlinenoexcept |
Element access
| i | the index of the element |
Definition at line 1200 of file strong_type.h.
|
inlinenoexcept |
Query the size of the span
Definition at line 1175 of file strong_type.h.
Referenced by Botan::compute_root(), Botan::compute_root(), Botan::Classic_McEliece_Field_Ordering::create_field_ordering(), Botan::Kyber_KEM_Decryptor::decapsulate(), Botan::ML_KEM_Decryptor::decapsulate(), Botan::Dilithium_Algos::decode_public_key(), Botan::Kyber_Algos::decompress_ciphertext(), Botan::FrodoMatrix::deserialize(), Botan::FrodoMatrix::encode(), Botan::fors_sign_and_pkgen(), Botan::Classic_McEliece_KeyPair_Internal::generate(), Botan::ht_sign(), Botan::ht_verify(), Botan::FrodoMatrix::pack(), Botan::Kyber_Algos::polynomial_from_message(), Botan::Sphincs_Hash_Functions_Sha2::PRF_msg(), Botan::FrodoMatrix::sample(), Botan::Kyber_Algos::sample_matrix(), Botan::LMOTS_Private_Key::sign(), Botan::LMS_PrivateKey::sign_and_get_pk(), Botan::treehash(), Botan::treehash(), and Botan::FrodoMatrix::unpack().