Coder Social home page Coder Social logo

enigmap's Introduction

Oblivious Data Structure Library

A library providing external memory efficient, cpu instruction and memory access trace oblivious algorithms.

Prerequisites:

Install cmake, ninja and intel sgx sdk, or use the cppbuilder docker image.

How to build the builder docker image:

cd ./tools/docker/cppbuilder
docker build -t cppbuilder:latest .

How to enter the docker environment to build under the builder:

docker run -it --rm -v $PWD:/builder -u $(id -u) cppbuilder

An example for SGX

docker run --device=/dev/sgx_enclave -v /tmp/bucketfile:/ssdmount -it --rm -v $PWD:/builder cppbuilder

How to enter the docker environment to build under the builder and run in SGX:

docker run --device=/dev/sgx_enclave -it --rm -v $PWD:/builder cppbuilder

How to run the unit tests

rm -rf build
cmake -B build -G Ninja
ninja -C build
ninja -C build test
ninja -C build cppcheck

How to do a release compilation:

rm -rf build # Needed after the CC/CXX export or after changing the CMAKE_BUILD_TYPE
export CC=/usr/bin/clang
export CXX=/usr/bin/clang++
cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Release
ninja -C build

Build the signal example enclave

source /startsgxenv.sh
cd applications/signal
make

Performance graph on latest build

Map

map perf graph

map perf graph

External Memory Sorting

sorting perf graph time sorting perf graph page swaps sorting perf graph instructions

Intrinsics performance graphs

latest perf graph

Folder structure high level details

ods - C++ odsl library code tests - C++ tests modules applications - Enclaves using odsl tools - tools used to generate graphs or test sets tools/docker - dockerfiles used for reproducible builds

Ods folder structure:

common - common c++ utilies, cpu abstractions, cryptography abstractions and tracing code external_memory - external memory abstraction and sorting algorithms external_memory/server - server abstraction for different external memory scenarios (sgx, file system, ram) oram - oram implementations otree - oblivious binary search tree recoram - recursive oram implementations

Links to view flamegraph files:

https://www.speedscope.app/

chrome://tracing/

It's also possible to view in qt creator as described here: https://doc.qt.io/qtcreator/creator-ctf-visualizer.html

At last: https://ui.perfetto.dev/ seems ok also

Profiling code

  1. Compile with ENABLE_PROFILING

  2. For the functions that need profiling, add PROFILE_F(); at as the first line of the function code. Additionally add the function name to trace_events.hxx

  3. Use PROFILER_SET(false); to disable profiling, use PROFILER_RESET() to write the profile to the log file (see profiling related functions in profiling_test to confirm).

  4. Use any of the tools in "Links to view flamegraph files" above to look at the profiling, adjust uncached IO time based on the results of the benchmarks enclave (benchmark_sgx).

enigmap's People

Contributors

obliviousstl avatar xtrm0 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.