Bluenet  5.7.0
Bluenet, firmware for nRF52 smart home devices
Loading...
Searching...
No Matches
RC5 Class Reference

Class that implements RC5 encryption. More...

#include <cs_RC5.h>

Public Member Functions

void init ()
 Initialize the class, reads from State. More...
 
bool decrypt (uint16_t *inBuf, uint16_t inBufSize, uint16_t *outBuf, uint16_t outBufSize)
 Decrypt data with RC5. More...
 

Static Public Member Functions

static RC5 & getInstance ()
 Use static variant of singleton, no dynamic memory allocation. More...
 

Private Member Functions

 RC5 ()
 
 RC5 (RC5 const &)
 
void operator= (RC5 const &)
 
bool initKey (EncryptionAccessLevel accessLevel)
 Expands the key of given access level. More...
 
bool prepareKey (uint8_t *key, uint8_t keyLength)
 Expands key into round subkey words, which are cached. More...
 

Private Attributes

uint16_t _subKeys [RC5_NUM_SUBKEYS]
 The round subkey words. More...
 

Detailed Description

Class that implements RC5 encryption.

  • Block size is 32 bit (so 16 bit words).
  • Only has decrypt method implemented, but encrypt would be possible too.

Constructor & Destructor Documentation

◆ RC5() [1/2]

RC5::RC5 ( )
private

◆ RC5() [2/2]

RC5::RC5 ( RC5 const &  )
private

Member Function Documentation

◆ decrypt()

bool RC5::decrypt ( uint16_t *  inBuf,
uint16_t  inBufSize,
uint16_t *  outBuf,
uint16_t  outBufSize 
)

Decrypt data with RC5.

Parameters
[in]inBufInput buffer with the encrypted data.
[in]inBufSizeSize of the input buffer in bytes.
[out]outBufOutput buffer to decrypt to.
[in]outBufSizeSize of the output buffer in bytes.

◆ getInstance()

static RC5 & RC5::getInstance ( )
inlinestatic

Use static variant of singleton, no dynamic memory allocation.

◆ init()

void RC5::init ( )

Initialize the class, reads from State.

◆ initKey()

bool RC5::initKey ( EncryptionAccessLevel  accessLevel)
private

Expands the key of given access level.

◆ operator=()

void RC5::operator= ( RC5 const &  )
private

◆ prepareKey()

bool RC5::prepareKey ( uint8_t *  key,
uint8_t  keyLength 
)
private

Expands key into round subkey words, which are cached.

Member Data Documentation

◆ _subKeys

uint16_t RC5::_subKeys[RC5_NUM_SUBKEYS]
private

The round subkey words.


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