|
px-fwlib 0.10.0
Cross-platform embedded library and documentation for 8/16/32-bit microcontrollers generated with Doxygen 1.9.2
|
Block cipher encryption/decryption algorithm.
File(s):
Macros | |
| #define | XTEA_KEY_SIZE_BYTES 16 |
| Key size in bytes. More... | |
| #define | XTEA_BLOCK_SIZE_BYTES 8 |
| Data block size in bytes. More... | |
Functions | |
| void | px_xtea_init (const uint32_t key[4]) |
| Initialise 128-bit key for encryption/decryption. More... | |
| void | px_xtea_encrypt (uint32_t data[2]) |
| Encrypt 64-bit data with 128-bit key. More... | |
| size_t | px_xtea_encrypt_data_ecb (const uint8_t *data_in, uint8_t *data_out, size_t nr_of_bytes) |
| Encrypt a data buffer using Electronic Codebook (ECB) block cipher operation. More... | |
| void | px_xtea_decrypt (uint32_t data[2]) |
| Decrypt 64-bit data with 128-bit key. More... | |
| size_t | px_xtea_decrypt_data_ecb (const uint8_t *data_in, uint8_t *data_out, size_t nr_of_bytes) |
| Decrypt a data buffer using Electronic Codebook (ECB) block cipher operation. More... | |
| void px_xtea_init | ( | const uint32_t | key[4] | ) |
| void px_xtea_encrypt | ( | uint32_t | data[2] | ) |
| size_t px_xtea_encrypt_data_ecb | ( | const uint8_t * | data_in, |
| uint8_t * | data_out, | ||
| size_t | nr_of_bytes | ||
| ) |
Encrypt a data buffer using Electronic Codebook (ECB) block cipher operation.
If the data_in is not an exact multiple of the block size (8 bytes), zero padding is used for the last block. The data_out buffer MUST be a multiple of 8 bytes.
The data can be encrypted in place by setting both the data_in and data_out pointer to the start of the buffer to be encrypted.
| data_in | Pointer to data buffer to be encrypted |
| data_out | Pointer to data buffer to contain encrypted data |
| nr_of_bytes | Number of bytes to encrypt |
| void px_xtea_decrypt | ( | uint32_t | data[2] | ) |
| size_t px_xtea_decrypt_data_ecb | ( | const uint8_t * | data_in, |
| uint8_t * | data_out, | ||
| size_t | nr_of_bytes | ||
| ) |
Decrypt a data buffer using Electronic Codebook (ECB) block cipher operation.
If the data_in is not an exact multiple of the block size (8 bytes), zero padding is used for the last block. The data_out buffer MUST be a multiple of 8 bytes.
The data can be decrypted in place by setting both the data_in and data_out pointer to the start of the buffer to be decrypted.
| data_in | Pointer to data buffer to be decrypted |
| data_out | Pointer to data buffer to contain decrypted data |
| nr_of_bytes | Number of bytes to decrypt |