#cargo #usage #implementation #build #add

no-std keccakf

An implementation of the keccak-F[1600,800,400,200]

4 releases

✓ Uses Rust 2018 edition

0.1.3 May 15, 2019
0.1.2 May 14, 2019
0.1.1 May 14, 2019
0.1.0 May 14, 2019

26 downloads per month

CC0 license

13KB
275 lines

keccakf

An implementation of the keccak-F[1600,800,400,200].

Building

cargo build

Usage

Add this to your Cargo.toml:

[dependencies]
keccakf = "0.1.3"

and this to your crate root:

extern crate keccakf;

choose which function you want to use:

use keccakf::KeccakF1600State; // Optional
use keccakf::Permutation;
//...
let state = [0u64;25];
state.permute();

Changelog

  • 0.1.3 - Add bits and nbytes in parameter. Change trait Permutable to Permutation.

lib.rs:

An implementation of the keccak-F[1600,800,400,200].

All Keccak-F[] permutation is fully unrolled; it's nearly as fast as the Keccak team's optimized permutation. I use macro to generate functions Keccak-F[] with different parameters.

Building

cargo build

Usage

Add this to your Cargo.toml:

[dependencies]
keccakf = "0.1.2"

and this to your crate root:

extern crate keccakf;

then you can use this code:

use keccakf::KeccakF1600State; // Optional
use keccakf::Permutation;
// ...
let mut state = [0u64;25];
state.permute();

Original implemntation in Rust: tiny-keccak

Test vectors: XKCP

Add macro and more parameters: tiannian (dtiannian@aliyun.com, dtiannian@gmail.com)

License: CC0

Dependencies

~10KB