#encryption #protection

no-std sysfunc-blockcipher-xtea

Simple XTEA block cipher implementation #![no_std]

2 releases

0.1.1 Apr 28, 2019
0.1.0 Apr 27, 2019

#328 in No standard library

ISC license

12KB
137 lines

XTEA

Simple XTEA implementation (pure Rust).

Heavily (internally) documented implementation of XTEA for the purposes of having a liberally licensed version of it available for general use. Implemented against the original public domain code by David Wheeler and Roger Needham.

API is simple, with the DELTA and passed into the functions as needed, allowing for non-standard delta to be used (as is surprisingly common).

    /// Enciphers the blocks in place.
    pub fn encipher(blocks: &mut [u32], key: &[u32], delta: u32, rounds: usize);

    /// Deciphers the blocks in place.
    pub fn decipher(blocks: &mut [u32], key: &[u32], delta: u32, rounds: usize);

Usage

Typically this cipher is weak, and has known attacks against it.

Licence

This project is licensed under the ISC Licence. See LICENCE.


lib.rs:

Simple XTEA implementation in Rust.

Minimal protection is afforded by the use of wrapping_add and wrapping_sub functions of Rust's core. Generally speaking the code should not have any troubles (and this code has been moderately used in production).

No runtime deps