Skip to content

ttpssabc/ACA-Final-Team1-Encrypted-Computing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ACA-Final-Team1-Encrypted-Computing

Introduction

  • The project is encrypted computing, where the encrpyted data is computed
  • We provide
    1. python client code to do encoding, encryption, decryption, decoding and
    2. server host code and kernel code for receiving data from client and sending it into kernel accelerator to do homomorphic computation
  • The implementation is referenced from BFV-RNS
    • One should read it before getting into this project

Major optimization

  • We optimize individual kernel code used in src/kernel to achieve nearly the same performance as this paper did using HLS
    • Lots of code restructure, array partition, unrolling, refer to the docs/doc.txt for further details
  • We parametrized the code so that it can be easily tested under different settings
  • We did not perform system level optimization and intend to do it as future work

Folder hierarchy

├── LICENSE
├── README.md
├── build
│   └── README.md
├── docs
│   └── doc.txt
├── impl_result
│   ├── K_ntt_csynth.rpt
│   ├── NTT_csynth.rpt
│   ├── README.md
│   ├── add_sub_csynth.rpt
│   ├── butterfly_csynth.rpt
│   └── mul_mod_csynth.rpt
├── src
│   ├── client
│   │   ├── README.md                    // see the README.md to set up
│   │   ├── afterDense100_8192.txt
│   │   ├── afterSquare_8192.txt
│   │   ├── bfv_rns.py                   // BFV_RNS scheme python code
│   │   ├── bias100_8192.txt
│   │   ├── client.py                    // client code using BFV-RNS
│   │   ├── cnn8192.txt.zip
│   │   ├── ct.txt
│   │   ├── data.h
│   │   ├── data.py
│   │   ├── defs.py
│   │   ├── dense100_8192.txt
│   │   ├── dense10_8192.txt
│   │   ├── encrypt8192.txt
│   │   ├── gk.txt.partaa
│   │   ├── gk.txt.partab
│   │   ├── gk.txt.partac
│   │   ├── gk.txt.partad
│   │   ├── gk.txt.partae
│   │   ├── inference.py                  // reference code of how to write encrypted inference
│   │   ├── inference_multiprocess.py     // reference code of how to write encrypted inference
│   │   ├── mask8192.txt
│   │   ├── model8192.txt.zip
│   │   ├── rlk.txt
│   │   ├── test.txt.partaa
│   │   ├── test.txt.partab
│   │   ├── test.txt.partac
│   │   ├── test.txt.partad
│   │   ├── test.txt.partae
│   │   └── util.py
│   ├── host
│   │   ├── global.h
│   │   ├── help_functions.cpp
│   │   ├── help_functions.h
│   │   ├── host.cpp                      // Host code for dealing with networking and kernel interaction
│   │   ├── inference.cpp                 // HE primitives or even higher level code examples
│   │   ├── inference.h
│   │   └── model_weight.h
│   └── kernel                            // Kernel functions
│       ├── K_add.cpp
│       ├── K_apply_galois.cpp
│       ├── K_mov.cpp
│       ├── K_mulConst.cpp
│       ├── K_mulWise.cpp
│       ├── K_ntt.cpp
│       ├── lift.cpp
│       ├── mod.cpp
│       ├── mod.h
│       ├── rns.h
│       └── scale.cpp
└── tests
    └── README.md

Build Setup

  • Follow README.md in src/client/ to recover all files needed
    • Check out client.cpp to see how to send and receive
    • text.txt, rlk.txt, gk.txt, and ct.xt are pickled file, where
      • text.txt: class including encoder and encryptor
      • rlk.txt: relinearization key
      • gk.txt: galois key
      • ct.txt: ciphertext
  • Vitis: include host.cpp and all codes under kernel/ and build kernel codes (Emulation-SW, EMulation-HW and Hardware)

Run test

  1. Server run the built code
  2. run client.py under src/client and wait for the result
  3. Change host/inference.cpp to do different tests

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages