Go to the documentation of this file.
75 template<
class RangeT>
97 std::string
key()
const;
100 std::string
iv()
const;
102 template<
class RangeT>
134 class = std::enable_if_t<!std::is_same_v<std::decay_t<RangeT>,
DataT>,
int>>
136 using ActualRangeT = std::decay_t<RangeT>;
137 auto [next, res] =
process(
DataT(begin(data), end(data)));
138 return { next, ActualRangeT(res.begin(), res.end()) };
155 class = std::enable_if_t<!std::is_same_v<std::decay_t<RangeT>,
DataT>,
int>>
157 using ActualRangeT = std::decay_t<RangeT>;
158 auto [next, res] = std::move(*this).process(
DataT(begin(data), end(data)));
159 return { next, ActualRangeT(res.begin(), res.end()) };
175 class = std::enable_if_t<!std::is_same_v<std::decay_t<RangeT>,
DataT>,
int>>
177 using ActualRangeT = std::decay_t<RangeT>;
179 return ActualRangeT(res.begin(), res.end());
185 std::unique_ptr<Private> m_d;
Result process(DataT data) const &
Encrypts or decrypts data and derives the next cipher state.
Definition: aes-256-ctr.cpp:104
std::string key() const
Definition: aes-256-ctr.cpp:94
std::string DataT
Definition: aes-256-ctr.hpp:37
Definition: aes-256-ctr.hpp:26
@ Private
Definition: client-model.hpp:41
Definition: location.hpp:10
bool valid() const
Definition: aes-256-ctr.cpp:89
std::decay_t< RangeT > processInPlace(RangeT data)
Encrypt or decrypt data and modify the state of the cipher in-place.
Definition: aes-256-ctr.hpp:176
#define KAZV_DECLARE_COPYABLE(typeName)
Definition: copy-helper.hpp:10
ResultBase< std::decay_t< RangeT > > process(RangeT data) &&
Encrypts or decrypts data and derives the next cipher state.
Definition: aes-256-ctr.hpp:156
A RangeT is an ordered collection that can be iterated through.
Definition: range-t.hpp:20
auto begin() const
The beginning iterator of this range.
static AES256CTRDesc fromRandom(RangeT random)
Generate a new AES-256-CTR cipher from random data.
Definition: aes-256-ctr.hpp:76
static const int optimalBlockSize
The optimal block size for this cipher.
Definition: aes-256-ctr.hpp:30
std::pair< AES256CTRDesc, RangeT > ResultBase
Definition: aes-256-ctr.hpp:103
ResultBase< std::decay_t< RangeT > > process(RangeT data) const &
Encrypts or decrypts data and derives the next cipher state.
Definition: aes-256-ctr.hpp:135
std::string iv() const
Definition: aes-256-ctr.cpp:99
DataT processInPlace(DataT data)
Encrypt or decrypt data and modify the state of the cipher in-place.
Definition: aes-256-ctr.cpp:118
static const int ivSize
The iv size for this cipher.
Definition: aes-256-ctr.hpp:34
ResultBase< DataT > Result
Definition: aes-256-ctr.hpp:105
static const int keySize
The key size for this cipher.
Definition: aes-256-ctr.hpp:32
static const int randomSize
Random size to generate a new cipher, provided in fromRandom().
Definition: aes-256-ctr.hpp:36