Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/stratis-storage/libcryptsetup-rs
Bindings for libcryptsetup using bindgen and a higher level API wrapper
https://github.com/stratis-storage/libcryptsetup-rs
Last synced: about 6 hours ago
JSON representation
Bindings for libcryptsetup using bindgen and a higher level API wrapper
- Host: GitHub
- URL: https://github.com/stratis-storage/libcryptsetup-rs
- Owner: stratis-storage
- License: mpl-2.0
- Created: 2019-07-29T19:33:56.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-10-28T13:53:09.000Z (16 days ago)
- Last Synced: 2024-11-06T03:47:45.342Z (7 days ago)
- Language: Rust
- Size: 553 KB
- Stars: 19
- Watchers: 7
- Forks: 12
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGES.txt
- License: LICENSE
Awesome Lists containing this project
README
[![Latest Version](https://img.shields.io/crates/v/libcryptsetup-rs.svg)](https://crates.io/crates/libcryptsetup-rs)
[![Documentation](https://docs.rs/libcryptsetup-rs/badge.svg)](https://docs.rs/libcryptsetup-rs/)# libcryptsetup-rs
This crate provides Rust bindings for libcryptsetup.
### Note on thread-safety
libcryptsetup is *not* thread-safe and also depends on libraries that are not
thread-safe. Any use of libcryptsetup by default in a multithreaded environment will
result in undefined behavior.As a workaround, this library provides a feature (`mutex`) to cause all calls to
libcryptsetup to acquire a crate-level mutex. This will enforce single threaded
access to all invocations of the libcryptsetup API.Rust's decision to make pointers `!Send` should be respected. Any data structure that
contains a pointer is *not* safe to send across threads. Providing an `unsafe
impl Send {}` for any data structure provided by libcryptsetup-rs that is not `Send`
may result in undefined behavior.### Building
The libcryptsetup bindings require some dependencies outside of cargo to build
properly:
1. cryptsetup (provided by `cryptsetup` on Fedora)
2. cryptsetup development headers (provided by `cryptsetup-devel` on Fedora)
3. libclang (provided by `clang` on Fedora)### Sanity testing bindings
There is one test that actually invokes libcryptsetup and can be used for basic sanity
testing of the bindings as it will only succeed if low level bindings are correctly generated,
the high level bindings build, and libcryptsetup successfully encrypts a loopback device.This can be invoked as follows:
```
make test-loopback
```