Mixe for Privacy and Anonymity in the Internet
Public Member Functions | Static Public Member Functions | List of all members
CASymChannelCipher Class Referenceabstract

#include <CASymChannelCipher.hpp>

Inheritance diagram for CASymChannelCipher:
Collaboration diagram for CASymChannelCipher:

Public Member Functions

virtual SINT32 crypt1 (const UINT8 *in, UINT8 *out, UINT32 len)=0
 
virtual SINT32 crypt2 (const UINT8 *in, UINT8 *out, UINT32 len)=0
 
virtual SINT32 setKey (const UINT8 *key)=0
 Sets the keys for crypt1() and crypt2() to the same key. More...
 
virtual SINT32 setKeys (const UINT8 *key, UINT32 keysize)=0
 Sets the keys for crypt1() and crypt2() either to the same key (if keysize==KEY_SIZE) or to different values, if keysize==2* KEY_SIZE. More...
 
virtual SINT32 setIVs (const UINT8 *p_iv)=0
 Sets iv1 and iv2 to p_iv. More...
 
virtual SINT32 setIV2 (const UINT8 *p_iv)=0
 Sets iv2 to p_iv. More...
 
virtual bool isKeyValid ()=0
 
- Public Member Functions inherited from CALockAble
 CALockAble ()
 
virtual ~CALockAble ()
 
SINT32 lock ()
 Locks the lockable object by threadsafe incrementing a reference counter. More...
 
SINT32 unlock ()
 Unlocks the lockable object by threadsafe decrementing a reference counter. More...
 

Static Public Member Functions

static const UINT8 *const getAlgorithmName (SYMCHANNELCIPHER_ALGORITHM alg)
 

Additional Inherited Members

- Protected Member Functions inherited from CALockAble
SINT32 waitForDestroy ()
 If called checks if the reference counter equals zero. More...
 

Detailed Description

Definition at line 63 of file CASymChannelCipher.hpp.

Member Function Documentation

◆ crypt1()

virtual SINT32 CASymChannelCipher::crypt1 ( const UINT8 in,
UINT8 out,
UINT32  len 
)
pure virtual

Implemented in CASymCipherOFB, CASymCipherNull, and CASymCipherCTR.

Referenced by CACryptoBenchmark::benchmarkThread(), CALocalProxy::loop(), CAFirstMixA::loop(), CALastMixA::loop(), and CAFirstMixB::loop().

Here is the caller graph for this function:

◆ crypt2()

virtual SINT32 CASymChannelCipher::crypt2 ( const UINT8 in,
UINT8 out,
UINT32  len 
)
pure virtual

Implemented in CASymCipherOFB, CASymCipherNull, and CASymCipherCTR.

Referenced by CALocalProxy::loop(), CAFirstMixA::loop(), CALastMixA::loop(), CAFirstMixB::loop(), and CAChain::processDownstream().

Here is the caller graph for this function:

◆ getAlgorithmName()

static const UINT8* const CASymChannelCipher::getAlgorithmName ( SYMCHANNELCIPHER_ALGORITHM  alg)
inlinestatic

Definition at line 71 of file CASymChannelCipher.hpp.

72  {
73  switch (alg)
74  {
75  case OFB:
77  case CTR:
79  case NULL_CIPHER:
81  case UNDEFINED_CIPHER:
82  return NULL;
83  }
84  return NULL;
85  }
@ NULL_CIPHER
@ UNDEFINED_CIPHER
const UINT8 *const SYMCHANNELCIPHER_ALG_NAME_OFB
const UINT8 *const SYMCHANNELCIPHER_ALG_NAME_NULL
const UINT8 *const SYMCHANNELCIPHER_ALG_NAME_CTR

References CTR, NULL_CIPHER, OFB, SYMCHANNELCIPHER_ALG_NAME_CTR, SYMCHANNELCIPHER_ALG_NAME_NULL, SYMCHANNELCIPHER_ALG_NAME_OFB, and UNDEFINED_CIPHER.

Referenced by CACmdLnOptions::setSymChannelCipherAlgorithm().

Here is the caller graph for this function:

◆ isKeyValid()

virtual bool CASymChannelCipher::isKeyValid ( )
pure virtual

Implemented in CASymCipherOFB, CASymCipherNull, and CASymCipherCTR.

Referenced by CALocalProxy::loop().

Here is the caller graph for this function:

◆ setIV2()

virtual SINT32 CASymChannelCipher::setIV2 ( const UINT8 p_iv)
pure virtual

Sets iv2 to p_iv.

Parameters
p_iv16 random bytes used for new iv2.
Return values
E_SUCCESS

Implemented in CASymCipherOFB, CASymCipherNull, and CASymCipherCTR.

Referenced by CALocalProxy::loop(), and CAFirstMixA::loop().

Here is the caller graph for this function:

◆ setIVs()

virtual SINT32 CASymChannelCipher::setIVs ( const UINT8 p_iv)
pure virtual

Sets iv1 and iv2 to p_iv.

Parameters
p_iv16 random bytes used for new iv1 and iv2.
Return values
E_SUCCESS

Implemented in CASymCipherOFB, CASymCipherNull, and CASymCipherCTR.

Referenced by CACryptoBenchmark::benchmarkThread(), CAFirstMix::doUserLogin_internal(), and CALocalProxy::processKeyExchange().

Here is the caller graph for this function:

◆ setKey()

virtual SINT32 CASymChannelCipher::setKey ( const UINT8 key)
pure virtual

Sets the keys for crypt1() and crypt2() to the same key.

Implemented in CASymCipherOFB, CASymCipherNull, and CASymCipherCTR.

Referenced by CAFirstMix::doUserLogin_internal(), and CALocalProxy::processKeyExchange().

Here is the caller graph for this function:

◆ setKeys()

virtual SINT32 CASymChannelCipher::setKeys ( const UINT8 key,
UINT32  keysize 
)
pure virtual

Sets the keys for crypt1() and crypt2() either to the same key (if keysize==KEY_SIZE) or to different values, if keysize==2* KEY_SIZE.

Implemented in CASymCipherOFB, CASymCipherNull, and CASymCipherCTR.

Referenced by CACryptoBenchmark::benchmarkThread(), CALocalProxy::loop(), and CAFirstMixA::loop().

Here is the caller graph for this function:

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