xkcp-rs

Crates.ioxkcp-rs
lib.rsxkcp-rs
version0.0.3
sourcesrc
created_at2023-10-13 21:58:39.227736
updated_at2023-10-22 18:15:36.00212
descriptionSafe wrappers to the XKCP library
homepagehttps://github.com/DaniPopes/xkcp-rs/tree/master/crates/xkcp-rs
repositoryhttps://github.com/DaniPopes/xkcp-rs
max_upload_size
id1002669
size24,867
(DaniPopes)

documentation

https://danipopes.github.io/xkcp-rs/xkcp_rs

README

xkcp-rs

Bindings and wrappers to the eXtended Keccak Code Package (XKCP) library.

Documentation

[!IMPORTANT] The xkcp-rs API will never be considered stable, and is subject to change at any time without prior warning.

Requirements

To build on Linux or macOS, the following tools are needed:

Windows is not supported at the moment.

CC flags are selected using cc-rs. Refer to their documentation on how to configure cc-rs externally.

XKCP targets

XKCP targets are automatically selected through CARGO_* environment variables. This behavior can be overridden by using feature flags (see below) or by directly specifying the XKCP target with the XKCP_RS_TARGET environment variable.

Refer to the XKCP documentation for more details.

Usage

Cargo.toml:

[dependencies]
xkcp-rs = "0.0.2"

src/main.rs:

fn main() {
    let mut output = [0u8; 32];
    xkcp_rs::sha3_256(b"Hello, World!", &mut output);
    println!("{output:x?}");
}

Feature flags

xkcp-rs only:

  • std: Enable std-only features, like implementations of std::error::Error. Enabled by default.

xkcp-rs and xkcp-sys:

  • avr8: Forces building for the AVR8 (8-bit AVR) XKCP target.
  • force-compact: Forces building for the compact XKCP target. WARNING: this is generally much slower than anything else.
  • force-generic: Forces building for the generic32 or generic64 XKCP target. Falls back to compact if not building for a 32 or 64 bit architecture.
  • generic-lc: Uses the generic{32,64}lc XKCP targets instead of generic{32,64}.

Supported Rust Versions

xkcp-rs will keep a rolling MSRV (minimum supported rust version) policy of at least 6 months. When increasing the MSRV, the new Rust version must have been released at least six months ago. The current MSRV is 1.65.0.

Note that the MSRV is not increased automatically, and only as part of a minor release.

License

xkcp-rs redistributes the XKCP library, libXKCP, which is mostly released to the public domain and associated to the CC0 deed, but there are exceptions. Please refer to the LICENSE file for more information.

Commit count: 56

cargo fmt