Skip to content
Snippets Groups Projects
Daniel Mario Reynaldi's avatar
c532d0e7

TA-Daniel

Getting started

  1. Make sure G++ and NVCC is installed in your system
  2. Follow the instructions here to install G++: https://linuxhint.com/install-g-compiler-on-ubuntu/?__cf_chl_tk=DfyJYl418VFCcW70kYdO2o_bR6jSd2HzEj2e9W91mAg-1681342297-0-gaNycGzNC-U
  3. Follow the instructions here to install nvcc: https://docs.nvidia.com/cuda/cuda-installation-guide-linux/

How To Code and Run (Serial):

  1. Put your code in test.cpp
  2. execute $ chmod +x test.sh
  3. execute $ chmod +x /comptest.sh
  4. execute $ chmod +x /src/compile.sh
  5. Run ./test.sh to automatically compile and run the code

How to Code and Run (Parallel):

  1. Navigate to /cuda
  2. Put your code in test.cu
  3. execute $ chmod +x run.sh
  4. Run ./run.sh to automatically compile and run the code

Function and Class Use

  1. Encoder: Class to encode input into polynom and decode it back to input vector
    • Serial: Encoder.cpp
    • Parallel: Parallel.cu
    • Methods:
      • Encode: To encode complex vectors into integer polynom
      • Decode: To decode polynom into vector of complex numbers
  2. PubKey, SecKey, EvalKey: Class to generate and store public, secret and evaluation key
    • serial: evalkey.cpp, pubkey.cpp, seckey.cpp
    • parallel: evalkey.cu, pubkey.cu, seckey.cu
    • Methods:
      • Constructors: To instantiate the key objects
  3. Ciphertext: Class that holds ciphertext
    • serial: ciphertext.cpp
    • parallel: ciphertext.cu
    • Methods:
      • Constructor: To create ciphertext
  4. CKKS: The class containing homomorphic operation of CKKS
    • serial: ckks.cpp
    • parallel: ckks.cu
    • Methods:
      • Encrypt: Encrypt polynom into ciphertext
      • Decrypt: Decrypt ciphertext back to plaintext
      • Mult: To multiply 2 ciphertext homomophically (include relin and rescaling)
      • MultNTT: To multiply 2 ciphertext homomophically (include relin and rescaling) with NTT approach
      • Add: To add 2 ciphertext homomorphically