50 RC6(
const std::vector<uint8_t> &key);
57 std::vector<uint8_t>
encrypt(
const std::vector<uint8_t> &plaintext);
64 std::vector<uint8_t>
decrypt(
const std::vector<uint8_t> &ciphertext);
71 std::vector<uint32_t>
S;
84 std::vector<uint32_t>
expand(
const std::vector<uint8_t> &key);
92 uint32_t
rotl(uint32_t val,
int shift);
100 uint32_t
rotr(uint32_t val,
int shift);
107 void encrypt_block(
const uint32_t plaintext[2], uint32_t ciphertext[2]);
114 void decrypt_block(
const uint32_t ciphertext[2], uint32_t plaintext[2]);
Class implementing the RC6 cipher algorithm.
std::vector< uint8_t > encrypt(const std::vector< uint8_t > &plaintext)
Encrypts plaintext using RC6 algorithm.
std::vector< uint32_t > expand(const std::vector< uint8_t > &key)
Performs key expansion.
std::vector< uint8_t > decrypt(const std::vector< uint8_t > &ciphertext)
Decrypts ciphertext using RC6 algorithm.
void key_schedule(const std::vector< uint8_t > &key)
Generates the key schedule from the given key.
std::vector< uint32_t > S
uint32_t rotl(uint32_t val, int shift)
Performs left rotation.
void decrypt_block(const uint32_t ciphertext[2], uint32_t plaintext[2])
Decrypts a single block of ciphertext.
void encrypt_block(const uint32_t plaintext[2], uint32_t ciphertext[2])
Encrypts a single block of plaintext.
RC6(const std::vector< uint8_t > &key)
Constructor for RC6 class.
uint32_t rotr(uint32_t val, int shift)
Performs right rotation.