Code Monkey home page Code Monkey logo

heaan-python's Introduction

PYHEAAN

This is a Python wrapper for HEAAN library.

HEAAN is a software library that implements homomorphic encryption (HE) that supports fixed point arithmetics. This library supports approximate operations between rational numbers. The approximate error depends on some parameters and almost same with floating point operation errors. The scheme in this library is on the paper.

Build

  • Environment

    CMake (>= 3.12), GNU G++ (>= 6.0) or Clang++ (>= 5.0)

    sudo apt-get update && sudo apt-get install git build-essential cmake python3 python3-dev python3.6-pip
    
    git clone https://github.com/Huelse/HEAAN-Python.git
  • GMP

    gmp-6.1.2

    cd gmp-6.1.2
    ./configure SHARED=on # default install in /usr/local, option --prefix=/path/to/extends
    make
    make check  # optional
    make install
  • NTL

    ntl-11.4.3

    cd NTL/src
    ./configure SHARED=on  # default install in /usr/local, option DEF_PREFIX=/path/to/extends
    make
    make check  # optional
    sudo make install
  • HEAAN

    HEAAN-2.1

    In "Params.h", 'pbnd' value is 59.0 by default. If you are using NTL with "NTL_ENABLE_AVX_FFT=on", This option reduces that small-prime size bound from 60 bits to 50 bits, see. For this reason, you need to change the setting to 49.0.

    cd HEAAN/lib
    make all
  • pybind11

    pybind11

    # Option 1 to run setup.py
    pip3 install -r requirements.txt
    
    # Option 2 to run cmake
    cd pybind11
    mkdir build && cd build
    cmake ..
    make
    sudo make install
  • HEAAN-Python

    • Option 1
    python3 setup.py build_ext -i
    
    python3 setup.py install  # global install
    • Option 2
    cd src
    cmake .
    make

    If success, you will get the dynamic link library in the folder, which name HEAAN.cpython-<version>.so.

Test

make sure you already installed the library globally or the file HEAAN.cpython-<version>.so in the current directory.

python3 test.py

FAQ

  1. ImportError: libntl.so.43: cannot find

    • export LD_LIBRARY_PATH=/path/to/extends/lib

    • add the /path/to/extends/lib to /etc/ld.so.conf and refresh it sudo ldconfig

    • install the NTL and gmp in /usr/local as default

  2. MakeError: /usr/bin/ld: cannot find libntl.so or libHEAAN.a

    Change to absolute path.

About

This lib is still in the experimental stage.

If any problems, email or Issue.

Email: [email protected].

Contributing

heaan-python's People

Contributors

huelse 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.