79 template<
class RangeT>
103 std::string
key()
const;
106 std::string
iv()
const;
108 template<
class RangeT>
140 class = std::enable_if_t<!std::is_same_v<std::decay_t<RangeT>,
DataT>,
int>>
142 using ActualRangeT = std::decay_t<RangeT>;
143 auto [next, res] =
process(
DataT(begin(data), end(data)));
144 return { next, ActualRangeT(res.begin(), res.end()) };
161 class = std::enable_if_t<!std::is_same_v<std::decay_t<RangeT>,
DataT>,
int>>
163 using ActualRangeT = std::decay_t<RangeT>;
164 auto [next, res] = std::move(*this).process(
DataT(begin(data), end(data)));
165 return { next, ActualRangeT(res.begin(), res.end()) };
181 class = std::enable_if_t<!std::is_same_v<std::decay_t<RangeT>,
DataT>,
int>>
183 using ActualRangeT = std::decay_t<RangeT>;
185 return ActualRangeT(res.begin(), res.end());
191 std::unique_ptr<Private> m_d;
Definition: aes-256-ctr.hpp:27
static AES256CTRDesc fromRandom(RangeT random)
Generate a new AES-256-CTR cipher from random data.
Definition: aes-256-ctr.hpp:80
static const int randomSize
Random size to generate a new cipher, provided in fromRandom().
Definition: aes-256-ctr.hpp:40
Result process(DataT data) const &
Encrypts or decrypts data and derives the next cipher state.
Definition: aes-256-ctr.cpp:104
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:182
static const int optimalBlockSize
The optimal block size for this cipher.
Definition: aes-256-ctr.hpp:30
static const int ivSizeInit
The size used for initialization of the iv for this cipher.
Definition: aes-256-ctr.hpp:38
std::pair< AES256CTRDesc, RangeT > ResultBase
Definition: aes-256-ctr.hpp:109
ResultBase< std::decay_t< RangeT > > process(RangeT data) &&
Encrypts or decrypts data and derives the next cipher state.
Definition: aes-256-ctr.hpp:162
DataT processInPlace(DataT data)
Encrypt or decrypt data and modify the state of the cipher in-place.
Definition: aes-256-ctr.cpp:118
std::string key() const
Definition: aes-256-ctr.cpp:94
static const int keySize
The key size for this cipher.
Definition: aes-256-ctr.hpp:32
static const int ivSize
The iv size for this cipher.
Definition: aes-256-ctr.hpp:34
ResultBase< std::decay_t< RangeT > > process(RangeT data) const &
Encrypts or decrypts data and derives the next cipher state.
Definition: aes-256-ctr.hpp:141
bool valid() const
Definition: aes-256-ctr.cpp:89
std::string iv() const
Definition: aes-256-ctr.cpp:99
std::string DataT
Definition: aes-256-ctr.hpp:41
ResultBase< DataT > Result
Definition: aes-256-ctr.hpp:111
A RangeT is an ordered collection that can be iterated through.
Definition: range-t.hpp:21
auto begin() const
The beginning iterator of this range.
#define KAZV_DECLARE_COPYABLE(typeName)
Definition: copy-helper.hpp:10
Definition: location.hpp:10
@ Private
Definition: client-model.hpp:41