Skip to content

Latest commit

 

History

History
101 lines (57 loc) · 3.39 KB

README.md

File metadata and controls

101 lines (57 loc) · 3.39 KB

Arduino CI Arduino-lint GitHub release

XTEA-Cipher library for Arduino

XTEA cipher library with MAC code calculation support for Arduino environment. Supported encryption modes are: ECB, CFB and OCB and for generating message authentication codes is CFB-MAC. 'C' code of this library was optimized for lowest possible use of program memory. Contrary to reference implementation, base data type is uint8_t[] instead of uint32_t.


Constants

Configure library settings in file xtea.h, or better in your sketch, by adding directive #define XTEA_ROUNDS n or/and #define XTEA_MAC_ROUNDS n before directive including this cipher library e.g.:

...
#define XTEA_ROUNDS 48
#define XTEA_MAC_ROUNDS 24

#include "XTEA-Cipher.h"
...
  • XTEA_ROUNDS

    actual number of Feistel rounds during cipher is 2 * XTEA_ROUNDS

    [default value is 32]

  • XTEA_MAC_ROUNDS

    actual number of Feistel rounds during MAC calculation is 2 * XTEA_MAC_ROUNDS

    [default value is 32]


    known attack is on 36 Feistel rounds (18 XTEA_ROUNDS or XTEA_MAC_ROUNDS)

  • XTEA_BLOCK_SIZE

    data block size = 64-bit [8 bytes]

    [Do NOT change its value]

  • XTEA_IV_SIZE

    size of initialization vector [IV] (a.k.a. NONCE) = 64-bit [8 bytes]

    [Do NOT change its value]

  • XTEA_KEY_SIZE

    key size = 128-bit [16 bytes]

    [Do NOT change its value]


Library Content

Read the source code for details.


Examples

  • XTEA Test 'C' style

    Sketch shows examples of calling 'C' code functions and validating them with test vectors.

  • XTEA Test Arduino style

    This sketch shows examples of calling methods of a c++ class and validating them with test vectors.


Installation Guide

Arduino IDE - Additional libraries installation guide.


Reporting bugs

Create an issue on GitHub.


License

Copyright © 2020-2021 Michal Protasowicki

Source: https://github.com/michpro/XTEA-Cipher

This project is released under MIT License.

License: MIT

Support

If You find my projects interesting and You wanted to support my work, You can give me a cup of coffee or a keg of beer :)

PayPal Direct     ko-fi     Coinbase