TSDuck v3.40-3963
MPEG Transport Stream Toolkit
Loading...
Searching...
No Matches
ts::BlockCipherProperties Class Reference

Properties of a block cipher. More...

#include <tsBlockCipherProperties.h>

Public Member Functions

 BlockCipherProperties (const BlockCipherProperties &base, const UChar *name, bool residue, size_t min_message, size_t work_blocks, size_t min_iv, size_t max_iv=0)
 Constructor for chaining block ciphers.
 
 BlockCipherProperties (const BlockCipherProperties &base, const UChar *name, const void *fixed_iv, size_t fixed_iv_size)
 Constructor which overrides a few fields.
 
 BlockCipherProperties (const UChar *name, size_t block, size_t min_key, size_t max_key=0)
 Constructor for a basic block cipher.
 
void assertCompatibleBase (const BlockCipherProperties &other) const
 Assert the compatibility of the base block cipher with another set of properties.
 
void assertCompatibleChaining (const BlockCipherProperties &other) const
 Assert the compatibility of the chained block cipher with another set of properties.
 

Public Attributes

size_t block_size
 Block size in bytes.
 
bool chaining
 If true, includes a chaining mode. If false, can process only one block.
 
const UCharchaining_name
 Chaining mode name.
 
const void * fixed_iv
 If not null, point to a fixed IV for that algorithm.
 
size_t fixed_iv_size
 Size in bytes of the fixed IV.
 
size_t max_iv_size
 Maximum initialization vector size in bytes (chaining).
 
size_t max_key_size
 Maximum key size in bytes.
 
size_t min_iv_size
 Minimum initialization vector size in bytes (chaining).
 
size_t min_key_size
 Minimum key size in bytes.
 
size_t min_message_size
 Minimum message size. Shorter data cannot be ciphered in this mode (chaining).
 
const UCharname
 Algorithm name.
 
bool residue_allowed
 The chaining mode can process residue after the last multiple of the block size.
 
size_t work_blocks
 Temporary work buffer size in multiples of cipher block size (chaining).
 

Detailed Description

Properties of a block cipher.

Constructor & Destructor Documentation

◆ BlockCipherProperties() [1/3]

ts::BlockCipherProperties::BlockCipherProperties ( const UChar name,
size_t  block,
size_t  min_key,
size_t  max_key = 0 
)

Constructor for a basic block cipher.

Parameters
[in]nameAlgorithm name.
[in]blockSize in bytes of the daa block.
[in]min_keyThe minimum key sizes in bytes.
[in]max_keyThe maximum key sizes in bytes. If zero, same as min_key_size.

◆ BlockCipherProperties() [2/3]

ts::BlockCipherProperties::BlockCipherProperties ( const BlockCipherProperties base,
const UChar name,
bool  residue,
size_t  min_message,
size_t  work_blocks,
size_t  min_iv,
size_t  max_iv = 0 
)

Constructor for chaining block ciphers.

Parameters
[in]baseProperties of the base cipher.
[in]nameChaining mode name.
[in]residueThe chaining mode can process residue after the last multiple of the block size.
[in]min_messageMinimum message size. Shorter data cannot be ciphered in this mode.
[in]work_blocksTemporary work buffer size in multiples of cipher block size.
[in]min_ivMinimum initialization vector size in bytes.
[in]max_ivMaximum initialization vector size in bytes. If zero, same as min_iv.

◆ BlockCipherProperties() [3/3]

ts::BlockCipherProperties::BlockCipherProperties ( const BlockCipherProperties base,
const UChar name,
const void *  fixed_iv,
size_t  fixed_iv_size 
)

Constructor which overrides a few fields.

Parameters
[in]baseProperties of the base cipher.
[in]nameIf not null, override full algorithm name, including chaining name.
[in]fixed_ivIf not null, point to a fixed IV for that algorithm.
[in]fixed_iv_sizeSize in bytes of the fixed IV.

Member Function Documentation

◆ assertCompatibleBase()

void ts::BlockCipherProperties::assertCompatibleBase ( const BlockCipherProperties other) const
inline

Assert the compatibility of the base block cipher with another set of properties.

Parameters
other[in] Other properties to compare with.

◆ assertCompatibleChaining()

void ts::BlockCipherProperties::assertCompatibleChaining ( const BlockCipherProperties other) const
inline

Assert the compatibility of the chained block cipher with another set of properties.

Parameters
other[in] Other properties to compare with.

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