Expand description
§sqlcipher-src
The SQLCipher amalgamation and the libtomcrypt crypto provider as C source for -sys crates.
Native builds compile SOURCE_FILE with their own crypto provider and flags:
let dir = sqlcipher_src::source_dir();
assert!(dir.join(sqlcipher_src::SOURCE_FILE).is_file());
assert!(dir.join(sqlcipher_src::HEADER_FILE).is_file());Builds without a system crypto library compile SOURCE_FILE with -DSQLITE_HAS_CODEC -DSQLCIPHER_CRYPTO_LIBTOMCRYPT and each file in LIBTOMCRYPT_SOURCES as its own translation unit with -DLTC_SOURCE, all with LIBTOMCRYPT_INCLUDE_DIR on the include path and one shared set of LTC_* switches:
let dir = sqlcipher_src::source_dir();
assert!(dir.join(sqlcipher_src::LIBTOMCRYPT_INCLUDE_DIR).join("tomcrypt.h").is_file());
for source in sqlcipher_src::LIBTOMCRYPT_SOURCES {
assert!(dir.join(source).is_file());
}The sqlcipher feature of sqlite-wasm-rs builds this way for wasm32-unknown-unknown.
The sources are generated from signed SQLCipher and libtomcrypt releases by upgrade.sh and ship as released, except that SOURCE_FILE skips SQLCipher’s .fini_array finalizer on __wasm__, which cannot hold that section, until sqlcipher/sqlcipher#622 is released. CI runs SQLCipher’s and rusqlite’s SQLCipher tests on them natively, and checks through sqlite-wasm-rs that files written natively and in Node, Chrome and Firefox open on both sides.
The crate is MIT, SQLCipher is BSD-3-Clause, SQLite is public domain, and libtomcrypt is public domain or WTFPL.
Constants§
- HEADER_
FILE - Public SQLCipher header inside
source_dir. - LIBTOMCRYPT_
INCLUDE_ DIR - libtomcrypt’s header directory inside
source_dir, which SQLCipher’s<tomcrypt.h>and every file inLIBTOMCRYPT_SOURCESneed on the include path. - LIBTOMCRYPT_
SOURCES - libtomcrypt files inside
source_dir, each compiled as its own translation unit. - LIBTOMCRYPT_
VERSION - libtomcrypt release providing the ciphers, hashes and random generator.
- SOURCE_
FILE - SQLCipher amalgamation inside
source_dir, with the crypto provider left to the build. - SQLCIPHER_
VERSION - SQLCipher release the vendored amalgamation is generated from.
- SQLITE_
VERSION - SQLite release that SQLCipher release is based on.
Functions§
- source_
dir - Directory holding the sources, at the path this crate was compiled from.