Skip to content

Getting Started

Claudio Lucisano edited this page Sep 22, 2026 · 1 revision

Getting Started

This page gets you from a fresh clone to a working build on the two platforms that CI tests on every change: Linux (Ubuntu) and Windows (MSYS2/MinGW64). Other platforms (older distros, macOS, Android) are covered in docs/installation.md.

How the build works

  • . ./env sets up the environment (ZROOT, library paths). Every build and test command needs it, in every new shell. If you forget it, make stops with ZROOT is undefined. Need to source env file: . ./env.
  • make builds the bundled dependencies first (RELIC 0.7.0, OpenSSL 4.0.1 and GoogleTest, into deps/root/), then the library (src/), the CLI tools (cli/) and the examples (examples/).
  • The library and its headers end up in root/; make install copies them to INSTALL_PREFIX (default /usr/local).

The first build takes a while because it compiles OpenSSL and RELIC twice (see RELIC Dual Build). Later builds reuse them.

Linux (Ubuntu)

Install the system packages. This is the same list CI uses:

sudo apt-get update
sudo apt-get install -y --no-install-recommends \
  build-essential gcc g++ make bison flex libfl-dev pkg-config \
  libgmp-dev libssl-dev libboost-system-dev libboost-thread-dev libgtest-dev \
  python3 python3-pip python3-dev python3-venv \
  ca-certificates git wget unzip cmake

Build and test:

git clone https://github.com/Claudiocli/openabe.git
cd openabe
. ./env
make
make test
make -C examples test

Install (optional):

sudo -E make install                          # to /usr/local
make install INSTALL_PREFIX="$HOME/.local"    # or anywhere else, no sudo

Windows (MSYS2 / MinGW64)

  1. Install MSYS2 and open the MSYS2 MinGW x64 shell (the prompt says MINGW64). Other MSYS2 shells (UCRT64, MSYS) are not tested.

  2. Install the toolchain and libraries. This is the same list CI uses:

    pacman -Syu
    pacman -S --needed base-devel git make bison flex python python-pip \
      mingw-w64-x86_64-toolchain mingw-w64-x86_64-cmake \
      mingw-w64-x86_64-openssl mingw-w64-x86_64-gmp \
      mingw-w64-x86_64-boost mingw-w64-x86_64-gtest
  3. Build and test exactly as on Linux:

    . ./env
    make
    make test
    make -C examples test

On Windows, DLLs are found through PATH, not LD_LIBRARY_PATH. env adds deps/root/bin, deps/root/lib and root/lib to PATH for you, which is one more reason to always source it. The CLI tools are built as oabe_*.exe.

Check that it works

cd examples
./test_cp     # prints "Recovered message: hello world!"
./test_kp
./test_pk
./test_km     # keystore demo; the last decryption is expected to fail

Or try the command-line tools:

cd cli
echo "hello world!" > input.txt
./oabe_setup  -s CP -p demo
./oabe_keygen -s CP -p demo -i "Doctor|Floor=3" -o alice
./oabe_enc    -s CP -p demo -e "Doctor and Floor in {1-5}" -i input.txt -o input.cpabe
./oabe_dec    -s CP -p demo -k alice.key -i input.cpabe -o output.txt
cat output.txt

Next steps

Clone this wiki locally