TSDuck v3.40-4033
MPEG Transport Stream Toolkit
Loading...
Searching...
No Matches
ts::CTR< CIPHER > Class Template Reference

Counter (CTR) chaining mode. More...

#include <tsCTR.h>

Inheritance diagram for ts::CTR< CIPHER >:
Collaboration diagram for ts::CTR< CIPHER >:

Public Member Functions

 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.
 

Static Protected Member Functions

static const BlockCipherPropertiesPROPERTIES ()
 Properties of this algorithm.
 

Detailed Description

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
CIPHERA subclass of ts::BlockCipher, the underlying block cipher.

Constructor & Destructor Documentation

◆ CTR()

template<class CIPHER >
ts::CTR< CIPHER >::CTR ( size_t  counter_bits = 0)

Constructor.

Parameters
[in]counter_bitsNumber of bits of the counter part in the IV. See setCounterBits() for an explanation of this value.

Member Function Documentation

◆ 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_bitsNumber 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()

template<class CIPHER >
static const BlockCipherProperties & ts::CTR< CIPHER >::PROPERTIES ( )
inlinestaticprotected

Properties of this algorithm.

Returns
A constant reference to the properties.

The documentation for this class was generated from the following file: