Skip to main content

Crate scintia_96

Crate scintia_96 

Source
Expand description

§Scintia-96

A lightweight, keyed 96-bit permutation based on the Speck cipher.

Scintia-96 is designed for use cases where you need a one-to-one mapping of a 96-bit input (such as a hardware unique ID) to a 96-bit output (such as a USB serial number), ensuring that uniqueness is preserved without collisions.

§Features

  • cipher (optional): Enables the RustCrypto cipher traits implementation for server environments. This includes the Scintia96Cipher struct which precomputes the key schedule for efficiency and enables reversing (decrypting) the permutation.

§Example

use scintia_96::Scintia96;

// 128-bit key (4 x u32)
const KEY: [u32; 4] = [0x01020304, 0x05060708, 0x090a0b0c, 0x0d0e0f10];
const PERMUTATION: Scintia96 = Scintia96::new(KEY);

fn main() {
    // 96-bit block as raw bytes
    let mut block = [0xde, 0xad, 0xbe, 0xef, 0xca, 0xfe, 0xba, 0xbe, 0xfa, 0xce, 0xfe, 0xed];
    PERMUTATION.permute_block(&mut block);
}

For more advanced usage or server-side environments, enable the cipher feature to use Scintia96Cipher.

Structs§

Scintia96
A Scintia-96 instance for performing keyed permutations.
Scintia96Ciphercipher
A Scintia-96 instance optimized for server environments with precomputed key schedule.

Traits§

Scintia96Permuter
A trait for types that can perform the Scintia-96 96-bit keyed permutation.
Scintia96Unpermuter
A trait for types that can perform the inverse Scintia-96 96-bit keyed permutation.