Repository navigation
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.
-
. ./envsets up the environment (ZROOT, library paths). Every build and test command needs it, in every new shell. If you forget it,makestops withZROOT is undefined. Need to source env file: . ./env. -
makebuilds the bundled dependencies first (RELIC 0.7.0, OpenSSL 4.0.1 and GoogleTest, intodeps/root/), then the library (src/), the CLI tools (cli/) and the examples (examples/). - The library and its headers end up in
root/;make installcopies them toINSTALL_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.
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 cmakeBuild and test:
git clone https://github.com/Claudiocli/openabe.git
cd openabe
. ./env
make
make test
make -C examples testInstall (optional):
sudo -E make install # to /usr/local
make install INSTALL_PREFIX="$HOME/.local" # or anywhere else, no sudo-
Install MSYS2 and open the MSYS2 MinGW x64 shell (the prompt says
MINGW64). Other MSYS2 shells (UCRT64, MSYS) are not tested. -
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
-
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.
cd examples
./test_cp # prints "Recovered message: hello world!"
./test_kp
./test_pk
./test_km # keystore demo; the last decryption is expected to failOr 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- Write your first program: Tutorial: CP-ABE
- Learn the policy language: Policy and Attribute Syntax
- Something failed? See the FAQ.
OpenABE · AGPL-3.0 · Found a mistake in this wiki? Open an issue.
Using OpenABE
Reference
Contributing
Design notes
Help