oxicrypt 0.26.1

Rust interface to the separately built and signed oxicrypt shared library (liboxicrypt_ffi). Outside the cryptographic boundary and not the module itself: holds no cryptographic code and depends on no oxicrypt-* crate.
Documentation
  • Coverage
  • 100%
    112 out of 112 items documented1 out of 1 items with examples
  • Size
  • Source code size: 320.9 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.4 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 4s Average build duration of successful builds.
  • all releases: 11s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • oxiforge/oxicrypt
    2 0 43
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • caraka

oxicrypt

The Rust interface to liboxicrypt_ffi, the oxicrypt cryptographic module delivered as a separately built and signed shared library. This crate is outside the module's cryptographic boundary and is not the module itself: the module is the oxicrypt-* crates, built into that library and signed. This crate contains no cryptographic code and depends on no oxicrypt-* crate; it declares the library's C functions, links your program to the library, and gives typed Rust over them.

Use

  1. Get a signed library: download a project release and pin the release key's fingerprint, or build oxicrypt-ffi yourself and sign it with your own key (docs/integrity-signing.md in the repository).
  2. Build your program with OXICRYPT_LIB_DIR=<directory holding the library> (the library under its versioned name, liboxicrypt_ffi.so.<ABI>, with liboxicrypt_ffi.so a link to it, as release tarballs ship it) and OXICRYPT_LIB_FINGERPRINT=sha256:<…>, the fingerprint oxicrypt-integrity-sign --show <library> prints. OXICRYPT_LIB_UNPINNED=1 is the explicit alternative to the fingerprint.
  3. Give your program a run-time search path for the library (for example -C link-arg=-Wl,--enable-new-dtags -C link-arg=-Wl,-rpath,<dir> on Linux), or deploy the library where the loader looks.
use oxicrypt::{Module, Profile};

let module = Module::init(Profile::Cnsa2)?;
let digest = module.sha384(b"abc")?;

The library tests its own integrity when it is initialised, whatever program loaded it, so your program is never signed. Check that it holds no module code of its own: oxicrypt-integrity-sign --show <program> reports no integrity slot, and cargo tree -i oxicrypt-module on your program's graph prints nothing.

The crate documentation covers every build variable, the per-platform loader behaviour, which C functions this release wraps, and where key-generation seeds must come from.

License

Apache-2.0 OR MIT.