#bindings #low-level #libkcapi #kcapi

sys kcapi-sys

Official low-level Rust bindings for libkcapi

8 releases (5 stable)

1.4.1 Jun 17, 2022
1.4.0 Jun 16, 2022
1.3.0 Feb 7, 2022
1.1.0 Nov 9, 2021
0.0.3 Dec 18, 2014

#2042 in Cryptography

23 downloads per month
Used in kcapi

BSD-3-Clause

335KB
9K SLoC

C 7K SLoC // 0.1% comments Rust 2K SLoC // 0.1% comments Automake 251 SLoC M4 123 SLoC // 0.4% comments XSL 9 SLoC

Contains (obscure autoconf code, 8KB) libkcapi/configure.ac

The Raw Rust Bindings for libkcapi

CI Badge License Badge Crate Badge

This repository contains the official raw low-level bindings for libkcapi. DO NOT use these bindings directly in your project. Instead, a safe Rusty API will be provided as a part of the kcapi crate.

Pre-requisites

Prior to building this project, clone this repository, and also checkout all it's included submodules recursively.

git clone https://github.com/puru1761/kcapi-sys.git --recurse-submodules

Install all build dependencies. These are:

  • autotools
  • autoconf
  • llvm-dev
  • libtool
  • build-essential

RPM based package manager

sudo yum install automake autoconf llvm-devel

Debian based package manager

sudo apt-get install \
    autotools-dev \
    autoconf \
    llvm-dev \
    libtool \
    build-essential \

If LLVM_CONFIG_PATH is not set, then set it with:

export LLVM_CONFIG_PATH="/path/to/llvm-config"

Build

We use cargo as our build system for building this crate. Build it using:

cargo build

Build With Local libkcapi

To build this crate with the locally installed version of libkcapi, you can use the local-kcapi feature. In your Cargo.toml:

kcapi-sys = { version = "1.4.0", default-features = false, features = ["local-kcapi"] }

NOTE: This has been tested only with libkcapi v1.4.0 and is not guaranteed to work with older libkcapi versions.

Test

We have a few sanity tests written to make sure that the bindings work as expected. Run these tests using:

cargo test

Author

No runtime deps

~0–2MB
~38K SLoC