Counter (CTR) chaining mode.
More...
#include <tsCTR.h>
|
| CTR (size_t counter_bits=0) |
| Constructor.
|
|
size_t | counterBits () const |
| Get the size of the counter part in the IV.
|
|
void | setCounterBits (size_t counter_bits) |
| Set the size of the counter part in the IV.
|
|
template<class CIPHER>
requires std::derived_from<CIPHER,
ts::BlockCipher>
class ts::CTR< CIPHER >
Counter (CTR) chaining mode.
CTR can process a residue. The plain text and cipher text can have any size.
- Template Parameters
-
◆ CTR()
template<class CIPHER >
ts::CTR< CIPHER >::CTR |
( |
size_t |
counter_bits = 0 | ) |
|
Constructor.
- Parameters
-
[in] | counter_bits | Number of bits of the counter part in the IV. See setCounterBits() for an explanation of this value. |
◆ setCounterBits()
template<class CIPHER >
void ts::CTR< CIPHER >::setCounterBits |
( |
size_t |
counter_bits | ) |
|
Set the size of the counter part in the IV.
- Parameters
-
[in] | counter_bits | Number of bits of the counter part in the IV. In CTR mode, the IV is considered as an integer in big-endian representation. The counter part of the IV uses the least significant bits of the IV. The default value (when specified as zero) is half the size of the IV. |
◆ counterBits()
template<class CIPHER >
size_t ts::CTR< CIPHER >::counterBits |
( |
| ) |
const |
|
inline |
Get the size of the counter part in the IV.
- Returns
- Number of bits of the counter part in the IV. See setCounterBits() for an explanation of this value.
◆ PROPERTIES()
Properties of this algorithm.
- Returns
- A constant reference to the properties.
The documentation for this class was generated from the following file: