Skip to main content

sqlcipher_src/
lib.rs

1#![doc = include_str!("../README.md")]
2
3use std::path::Path;
4
5/// SQLCipher release the vendored amalgamation is generated from.
6pub const SQLCIPHER_VERSION: &str = "4.19.0";
7
8/// SQLite release that SQLCipher release is based on.
9pub const SQLITE_VERSION: &str = "3.53.4";
10
11/// libtomcrypt release providing the ciphers, hashes and random generator.
12pub const LIBTOMCRYPT_VERSION: &str = "1.18.2";
13
14/// SQLCipher amalgamation inside [`source_dir`], for native builds that pick their own crypto provider.
15pub const AMALGAMATION_FILE: &str = "sqlcipher.c";
16
17/// Public SQLCipher header inside [`source_dir`].
18pub const HEADER_FILE: &str = "sqlite3.h";
19
20/// Single translation unit inside [`source_dir`] that compiles SQLCipher with libtomcrypt for Wasm.
21pub const WASM_SOURCE_FILE: &str = "sqlite3.c";
22
23/// Rust bindings for [`HEADER_FILE`] inside [`source_dir`], from `sqlite-wasm-rs`'s bindgen setup with `SQLITE_HAS_CODEC`, so they declare `sqlite3_key` and `sqlite3_rekey`.
24pub const WASM_BINDINGS_FILE: &str = "sqlcipher_bindgen.rs";
25
26/// Directory holding the sources, at the path this crate was compiled from.
27#[must_use]
28pub fn source_dir() -> &'static Path {
29    Path::new(concat!(env!("CARGO_MANIFEST_DIR"), "/sqlcipher"))
30}