79 template<
class RangeT>
99 template<
class RangeT1,
class RangeT2>
122 std::string
key()
const;
125 std::string
iv()
const;
127 template<
class RangeT>
159 class = std::enable_if_t<!std::is_same_v<std::decay_t<RangeT>,
DataT>,
int>>
161 using ActualRangeT = std::decay_t<RangeT>;
162 auto [next, res] =
process(
DataT(begin(data), end(data)));
163 return { next, ActualRangeT(res.begin(), res.end()) };
180 class = std::enable_if_t<!std::is_same_v<std::decay_t<RangeT>,
DataT>,
int>>
182 using ActualRangeT = std::decay_t<RangeT>;
183 auto [next, res] = std::move(*this).process(
DataT(begin(data), end(data)));
184 return { next, ActualRangeT(res.begin(), res.end()) };
200 class = std::enable_if_t<!std::is_same_v<std::decay_t<RangeT>,
DataT>,
int>>
202 using ActualRangeT = std::decay_t<RangeT>;
204 return ActualRangeT(res.begin(), res.end());
210 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
static AES256CTRDesc fromRaw(RangeT1 key, RangeT2 iv)
Generate a new AES-256-CTR cipher from raw data.
Definition: aes-256-ctr.hpp:100
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:201
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:128
ResultBase< std::decay_t< RangeT > > process(RangeT data) &&
Encrypts or decrypts data and derives the next cipher state.
Definition: aes-256-ctr.hpp:181
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:160
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:130
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