ERUCES::TECipher
#include <tecipher.h>
The TECipher class is an abstract interface for cryptographic operations.
The TECipher class allows one to set and manage cryptographic operations.
Public Types
enum Operation
| Value | Description |
|---|---|
ENCRYPT | Encrypt Operation. |
DECRYPT | Decrypt Operation. |
enum Mode
The block cipher mode of operation.
| Value | Description |
|---|---|
ECB | ECB. |
CBC | CBC. |
CTR | CTR. |
GCM | GCM. |
DEFAULT | The use the Key Service default. |
Static Public Member Functions
| Member | Description |
|---|---|
TECipher * instance() | The instance method retrieves the TECipher instance. |
Public Member Functions
| Member | Description |
|---|---|
void init(uint64_t keyhandle, Operation operation, Mode mode=DEFAULT)=0 | The init method initializes a TECipher object. |
void update(const Data &in, Data &out)=0 | The update method updates TECipher with data. |
void finalize(Data &out, bool append=false)=0 | The finalize method finalizes the output buffer. |
void process(const Data &in, Data &out)=0 | The process method proccess the data. |
size_t process(const byte_t *in, size_t insize, byte_t *out, bool finalize=true)=0 | The process method proccess the data. |
Data iv() const =0 | The iv method retrieves the IV. |
void iv(const Data &iv)=0 | The iv method sets the IV. |
size_t block_size()=0 | The block_size method retrieves the block size. |
Operation operation() const =0 | The operation method retrieves the operation ID. |
const _TESTD string ttag() const =0 | The ttag method retrieves the TTag. |
~TECipher() | The TECipher destructor is the class destructor. |
Member Function Documentation
TECipher * instance()
The instance method retrieves the TECipher instance.
void init(uint64_t keyhandle, Operation operation, Mode mode=DEFAULT)=0
The init method initializes a TECipher object.
Parameters
| Parameter | Description |
|---|---|
keyhandle | An integer representing the key handle from TEKey::createKeyHandle() |
operation | An Operation object representing the operation. |
mode | A Mode object representing the mode of operation. |
void update(const Data &in, Data &out)=0
The update method updates TECipher with data.
Parameters
| Parameter | Description |
|---|---|
in | - input data |
out | - output buffer |
void finalize(Data &out, bool append=false)=0
The finalize method finalizes the output buffer.
Parameters
| Parameter | Description |
|---|---|
out | - output buffer |
append | - indicates that processed data will be appended to existing |
void process(const Data &in, Data &out)=0
The process method proccess the data.
Parameters
| Parameter | Description |
|---|---|
in | - input data |
out | - output buffer |
size_t process(const byte_t *in, size_t insize, byte_t *out, bool finalize=true)=0
The process method proccess the data.
Parameters
| Parameter | Description |
|---|---|
in | - input data pointer, NULL is acceptable for final block |
insize | - size of input data |
out | - output data pointer, buffer must be enough to hold processed data |
finalize | - indicates last block |
Data iv() const =0
The iv method retrieves the IV.
return current IV /Counter
See also: IV
void iv(const Data &iv)=0
The iv method sets the IV.
set current IV /Counter
Parameters
| Parameter | Description |
|---|---|
iv | A Data object representing the initialization vector. |
See also: IV
size_t block_size()=0
The block_size method retrieves the block size.
Operation operation() const =0
The operation method retrieves the operation ID.
const _TESTD string ttag() const =0
The ttag method retrieves the TTag.
Returns: get TTag in binary format
~TECipher()
The TECipher destructor is the class destructor.