Skip to main content

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.

© Pi Soft, 2018-2026 · Tricryption Engine 8.1

Public Types​

enum Operation

ValueDescription
ENCRYPTEncrypt Operation.
DECRYPTDecrypt Operation.

enum Mode

The block cipher mode of operation.

ValueDescription
ECBECB.
CBCCBC.
CTRCTR.
GCMGCM.
DEFAULTThe use the Key Service default.

Static Public Member Functions​

MemberDescription
TECipher * instance()The instance method retrieves the TECipher instance.

Public Member Functions​

MemberDescription
void init(uint64_t keyhandle, Operation operation, Mode mode=DEFAULT)=0The init method initializes a TECipher object.
void update(const Data &in, Data &out)=0The update method updates TECipher with data.
void finalize(Data &out, bool append=false)=0The finalize method finalizes the output buffer.
void process(const Data &in, Data &out)=0The process method proccess the data.
size_t process(const byte_t *in, size_t insize, byte_t *out, bool finalize=true)=0The process method proccess the data.
Data iv() const =0The iv method retrieves the IV.
void iv(const Data &iv)=0The iv method sets the IV.
size_t block_size()=0The block_size method retrieves the block size.
Operation operation() const =0The operation method retrieves the operation ID.
const _TESTD string ttag() const =0The 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

ParameterDescription
keyhandleAn integer representing the key handle from TEKey::createKeyHandle()
operationAn Operation object representing the operation.
modeA Mode object representing the mode of operation.

void update(const Data &in, Data &out)=0​

The update method updates TECipher with data.

Parameters

ParameterDescription
in- input data
out- output buffer

void finalize(Data &out, bool append=false)=0​

The finalize method finalizes the output buffer.

Parameters

ParameterDescription
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

ParameterDescription
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

ParameterDescription
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

ParameterDescription
ivA 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.