Added XTEA and Pearson Hashing.
Improved message encryption for RF24.
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
#ifndef XTEA_H_
|
||||
#define XTEA_H_
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
|
||||
#define XTEA_CYCLES 32
|
||||
|
||||
|
||||
class XTEA {
|
||||
public:
|
||||
void setKey(void* key);
|
||||
|
||||
void setIV(void* iv);
|
||||
void setIV(uint32_t ivh, uint32_t ivl);
|
||||
|
||||
void cbc_encrypt(void *dest, const void *plain, uint16_t nr_blocks);
|
||||
void cbc_decrypt(void *dest, const void *cipher, uint16_t nr_blocks);
|
||||
|
||||
void encrypt_block(void *dest, const void *block);
|
||||
void decrypt_block(void *dest, const void *block);
|
||||
|
||||
private:
|
||||
uint8_t _key[16] = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10 };
|
||||
uint8_t _vector[8] = {0};
|
||||
};
|
||||
|
||||
|
||||
#endif /*XTEA_H_*/
|
||||
Reference in New Issue
Block a user