4 releases
0.0.3 | Oct 22, 2023 |
---|---|
0.0.2 | Oct 14, 2023 |
0.0.1 | Oct 14, 2023 |
0.0.0 | Oct 13, 2023 |
#1786 in Cryptography
34 downloads per month
Used in xkcp-rs
2.5MB
69K
SLoC
xkcp-rs
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.
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
: Enablestd
-only features, like implementations ofstd::error::Error
. Enabled by default.
xkcp-rs
and xkcp-sys
:
avr8
: Forces building for theAVR8
(8-bit AVR) XKCP target.force-compact
: Forces building for thecompact
XKCP target. WARNING: this is generally much slower than anything else.force-generic
: Forces building for thegeneric32
orgeneric64
XKCP target. Falls back tocompact
if not building for a 32 or 64 bit architecture.generic-lc
: Uses thegeneric{32,64}lc
XKCP targets instead ofgeneric{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.
No runtime deps
~0–2.1MB
~43K SLoC