25 releases (1 stable)

1.20250506.0 Aug 5, 2025
0.11.1 Feb 25, 2025
0.11.0 Aug 28, 2024
0.10.5 Jul 14, 2023
0.1.2 Jul 27, 2018

#1692 in Cryptography

Download history 1442/week @ 2025-10-16 1290/week @ 2025-10-23 838/week @ 2025-10-30 1922/week @ 2025-11-06 1810/week @ 2025-11-13 1823/week @ 2025-11-20 1628/week @ 2025-11-27 1760/week @ 2025-12-04 2294/week @ 2025-12-11 2078/week @ 2025-12-18 810/week @ 2025-12-25 960/week @ 2026-01-01 1469/week @ 2026-01-08 2049/week @ 2026-01-15 3980/week @ 2026-01-22 3074/week @ 2026-01-29

10,811 downloads per month
Used in 20 crates (via botan)

MIT license

190KB
4K SLoC

C++ 2.5K SLoC // 0.1% comments Rust 1.5K SLoC // 0.0% comments Python 291 SLoC // 0.1% comments Shell 10 SLoC // 0.2% comments C 8 SLoC

botan-sys

This crate contains the FFI declarations for calling the C API included in the Botan cryptography library as well as the rules for linking to it.

A high level Rust interface built on these declarations is included in the botan crate.

This crate is always no_std

Features

  • vendored: Build against the botan-src crate
  • static: Statically link the library. This is always used if vendored is set
  • pkg-config: Use pkg-config instead of probing to find the library

Exported cfg

This crate will detect which version of the FFI interface is supported and enable features on that basis. The feature sets can be checked using

  • #[cfg(botan_ffi_20230403)]: Botan 3.0
  • #[cfg(botan_ffi_20240408)]: Botan 3.4
  • #[cfg(botan_ffi_20250506)]: Botan 3.8

Environment Variables

The following environment variables are used to guide features

  • BOTAN_INCLUDE_DIR the base path to where the relevant library includes are found. For example if the headers are in /opt/foo/botan-3/botan, this variable should be set to /opt/foo. If not set, tries a few common locations. This variable is ignored if the pkg-config or vendored features are used.
  • BOTAN_LIB_DIR the directory to search for pre-build shared or static libraries.

Dependencies

~235KB