Crates.io | symcrypt-sys |
lib.rs | symcrypt-sys |
version | 0.3.0 |
source | src |
created_at | 2024-01-10 23:19:56.179026 |
updated_at | 2024-10-28 23:40:14.966594 |
description | Rust/C Bindings for SymCrypt |
homepage | https://github.com/microsoft/SymCrypt |
repository | https://github.com/microsoft/rust-symcrypt |
max_upload_size | |
id | 1095677 |
size | 804,281 |
symcrypt-sys provides Rust/C FFI bindings for the SymCrypt library.
This crate is supplementary to the symcrypt
crate.
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
To view a detailed list of changes please see the releases page.
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.
You must also configure your system to pick up the SymCrypt lib on your machine, please see: INSTALL.md for more info.
In your Cargo.toml
symcrypt-sys = "0.3.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(),
);
}