Mixes for Privacy and Anonymity in the Internet
Public Member Functions | Static Public Member Functions | List of all members
CASymChannelCipher Class Referenceabstract
Inheritance diagram for CASymChannelCipher:
CALockAble CASymCipherCTR CASymCipherNull CASymCipherOFB

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

Member Function Documentation

◆ crypt1()

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

◆ crypt2()

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

◆ getAlgorithmName()

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

◆ isKeyValid()

virtual bool CASymChannelCipher::isKeyValid ( )
pure virtual

Implemented in CASymCipherOFB, CASymCipherNull, and CASymCipherCTR.

Referenced by CALocalProxy::loop().

◆ 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().

◆ 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().

◆ 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().

◆ 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().