A backend for the p≡p Engine built on Sequoia.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

53 lines
2.2 KiB

  1. This library provides an implementation of the [p≡p Engine]'s
  2. [cryptotech] interface using [Sequoia].
  3. [p≡p Engine]: https://gitea.pep.foundation/pEp.foundation/pEpEngine
  4. [cryptotech]: https://gitea.pep.foundation/pEp.foundation/pEpEngine/src/branch/master/src/cryptotech.h
  5. [Sequoia]: https://sequoia-pgp.org
  6. Building
  7. ========
  8. You need at least version 1.48 of `rustc` and `cargo`.
  9. You can build this library as follows:
  10. ```
  11. $ git clone https://gitea.pep.foundation/neal/pEpEngineSequoiaBackend.git
  12. $ cd pEpEngineSequoiaBackend
  13. $ mkdir -p /tmp/pep_engine_sequoia_backend
  14. $ CARGO_TARGET_DIR=/tmp/pep_engine_sequoia_backend cargo build # Add --release for a release build
  15. $ CARGO_TARGET_DIR=/tmp/pep_engine_sequoia_backend cargo test
  16. ```
  17. This will generate, among others
  18. `/tmp/pep_engine_sequoia_backend/debug/pep_engine_sequoia_backend.pc`.
  19. This can be used to easily link to the library *in place*. That is,
  20. no installation is required.
  21. Hence to build and test the engine, we can do:
  22. ```
  23. $ cd ~/src/pEpEngine
  24. $ export PKG_CONFIG_PATH=/tmp/pep_engine_sequoia_backend/debug${PKG_CONFIG_PATH+:$PKG_CONFIG_PATH}
  25. $ make
  26. $ LD_LIBRARY_PATH=$(for p in $(pkg-config pep_engine_sequoia_backend --libs-only-L); do echo ${p#-L}; done | paste -sd ':')${LD_LIBRARY_PATH+:$LD_LIBRARY_PATH} RUST_BACKTRACE=1 make -C test test
  27. ```
  28. Of course when installing the engine, we'll need to distribute the
  29. generated library.
  30. Note: when profiling the library (or doing a release), be sure to
  31. build in release mode! That is, build the library with `cargo build
  32. --release` and replace `debug` with `release` in the second set of
  33. commands.
  34. When built in debug mode, the library always generates trace output.
  35. If you encounter problems in release mode, you can get a trace of the
  36. library's execution by setting the `PEP_TRACE` environment
  37. variable. For example:
  38. ```
  39. $ cd ~/src/pEpEngine/test
  40. $ PKG_CONFIG_PATH=/tmp/pep_engine_sequoia_backend/debug${PKG_CONFIG_PATH+:$PKG_CONFIG_PATH} LD_LIBRARY_PATH=$(for p in $(pkg-config pep_engine_sequoia_backend --libs-only-L); do echo ${p#-L}; done | paste -sd ':')${LD_LIBRARY_PATH+:$LD_LIBRARY_PATH} PEP_TRACE=1 ./EngineTests -- --gtest_filter=DeleteKeyTest.check_delete_single_pubkey
  41. ```