论文地址

CCS21:zkCNN: Zero Knowledge Proofs for Convolutional Neural Network Predictions and Accuracy | Proceedings of the 2021 ACM SIGSAC Conference on Computer and Communications Security

论文概述

代码复现

环境:Ubuntu 18.04 and 20.04

zkCNN

TAMUCrypto/zkCNN: A GKR-based zero-knowledge proof protocol for CNN model inference. 一般使用了 submodules 的,使用git clone --recurse-submodules 仓库地址 即可,但是本文仓库设置有点小问题。

  1. 下载

    由于该仓库使用了 submodule,但是其由于该仓库 .gitmodules 使用 SSH 协议指定的仓库位置,但我们显然没有被授权过,因此没有权限下载 submodules。解决办法:

    1. (推荐) 先 git clone 仓库,然后把 .gitmodules 的链接改成 HTTPS 的,然后递归初始化并更新 submodules 推荐:递归初始化,并更新: git submodule update --init --recursive

      不推荐:git submodule update 只更新子项目代码,在一些旧版本没有初始化的 submodules 不会被更新

      1
      2
      git clone https://github.com/TAMUCrypto/zkCNN.git
      git submodule update --init --recursive

    2. (凑活) 只使用 git clone,直接找 submodules 的仓库门,自行下载到指定的嵌套的 submodules 文件夹位置

  2. 安装缺少的依赖

    安装 GMP library

    1
    sudo apt-get install libgmp3-dev

    cmake --version 查看版本是否满足 cmake >= 3.10,满足 gcc --version 查看 gcc 版本是否支持 C++14

    according to GCC's Standards Support page--which shows full C++14 support since GCC v5

  3. 编译运行

    1
    2
    3
    cd scripts
    chmod +777 ./*
    ./demo_lenet.sh

调试

CMake + VSCode 调试 配置 CMake 选择 zkCNN 主目录下的 CMakeLists.txt 先 build 配置 CMake:build Target 为想要运行的可执行文件 demo_lenet_run

参考

  1. Git update submodules recursively - Stack Overflow
  2. software installation - How to install the latest gmp library in 12.04? - Ask Ubuntu