Crates.io | xkcp-sys |
lib.rs | xkcp-sys |
version | 0.0.3 |
source | src |
created_at | 2023-10-13 21:58:06.233303 |
updated_at | 2023-10-22 18:15:17.565328 |
description | Native bindings to the XKCP library |
homepage | https://github.com/DaniPopes/xkcp-rs/tree/master/crates/xkcp-sys |
repository | https://github.com/DaniPopes/xkcp-rs |
max_upload_size | |
id | 1002668 |
size | 2,760,968 |
Bindings and wrappers to the eXtended Keccak Code Package (XKCP) library.
[!IMPORTANT] The xkcp-rs API will never be considered stable, and is subject to change at any time without prior warning.
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 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.
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?}");
}
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}
.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.
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.