CoreComponents 3.0.0
A Modern C++ Toolkit
Loading...
Searching...
No Matches
BlockCipher::State Struct Referenceabstract

Internal state. More...

#include <BlockCipher>

Inheritance diagram for BlockCipher::State:

Public Member Functions

 State (int blockSize)
 Initialize with given blockSize.
 
int blockSize () const
 Block size in bytes (required for encode() and decode())
 
virtual void encode (const Bytes &p, Out< Bytes > c)=0
 Encipher plaintext block p into ciphertext block c.
 
virtual void decode (const Bytes &c, Out< Bytes > p)=0
 Decipher ciphertext block c into plaintext block p.
 
- Public Member Functions inherited from Object::State
 State ()=default
 Default constructor.
 
 State (const State &)
 Copy constructor.
 
virtual ~State ()
 Virtual destructor.
 
long useCount () const
 Reference count.
 
const Stateoperator= (const State &) const
 
template<class T >
bool is () const
 Check if this state is of type T.
 
template<class T >
T & as ()
 Statically cast this state to a different type T.
 
template<class T >
const T & as () const
 Statically cast this state to a different type T.
 

Detailed Description

Internal state.

Constructor & Destructor Documentation

◆ State()

State ( int blockSize)
explicit

Initialize with given blockSize.

Member Function Documentation

◆ blockSize()

int blockSize ( ) const

Block size in bytes (required for encode() and decode())

◆ encode()

virtual void encode ( const Bytes & p,
Out< Bytes > c )
pure virtual

Encipher plaintext block p into ciphertext block c.

Note
Both the plaintext block and the ciphertext block must have the proper block size.

◆ decode()

virtual void decode ( const Bytes & c,
Out< Bytes > p )
pure virtual

Decipher ciphertext block c into plaintext block p.

Note
Both the plaintext block and the ciphertext block must have the proper block size.