4 releases

0.2.0 Apr 23, 2024
0.1.2 Jan 10, 2024
0.1.1 Jan 10, 2024
0.1.0 Jan 10, 2024

#1690 in Cryptography

Download history 27/week @ 2024-01-10 2/week @ 2024-02-14 8/week @ 2024-02-21 18/week @ 2024-02-28 10/week @ 2024-03-27 147/week @ 2024-04-03 7/week @ 2024-04-10 73/week @ 2024-04-17 76/week @ 2024-04-24

310 downloads per month
Used in 2 crates (via symcrypt)

MIT/Apache

130KB
4K SLoC

SymCrypt Rust/C FFI Bindings

symcrypt-sys provides Rust/C FFI bindings for the SymCrypt library.

This crate is supplementary to the symcryptcrate.

The bindings are checked into this crate in order to have better control over the binding generation as well as the exposed APIs from SymCrypt. To speed up the common case build process, the binding generation has been separated to symcrypt-bindgen

Changelog

To view a detailed list of changes please see the releases page.

Usage

Recommended usage is to take advantage of the symcrypt crate, which provides safe and rust idiomatic wrappers over the bindings.

However, If you want to access the bindings directly, you can add symcrypt-sys as a dependency in your rust project.

In your Cargo.toml

symcrypt-sys = "0.2.0"

Then you can call the underlying SymCrypt code directly via the FFIs.

unsafe {
    // SAFETY: FFI calls
	symcrypt_sys::SymCryptSha384(
	data.as_ptr(),
	data.len() as  symcrypt_sys::SIZE_T,
	result.as_mut_ptr(),
	);
}

Dependencies

~43KB