-
Notifications
You must be signed in to change notification settings - Fork 27
C Documentation
No implementation of Miscreant in C is presently available, however the Rust implementation of Miscreant exposes a C ABI which can be used in conjunction with C/C++ projects:
https://github.com/miscreant/miscreant/tree/master/rust
This guide will take you through installing Rust, building the Rust implementation of Miscreant as a static library, and provide an overview of the C API/ABI.
You will need the Rust nightly toolchain. This can be installed with:
$ curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain nightly
For more information on installing Rust, please see https://rustup.rs/
After installing Rust, clone the Miscreant repo:
$ git clone [email protected]:miscreant/miscreant.git
Inside of the rust/
subdirectory of this repo, run the following command to build libmiscreant.a
:
cargo build --no-default-features --features=staticlib --release
This will create target/release/libmiscreant.a
which exposes a C ABI and has no runtime dependencies. Link it as you normally would any static library, e.g.
cc -o myprog myprog.c libmiscreant.a
The Miscreant Rust FFI tests include an example Makefile for a Miscreant C project.