# sachaservan/pacl architecture

> Architecture diagram of the GitHub repository sachaservan/pacl, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sachaservan/pacl
- Repository: https://github.com/sachaservan/pacl

## Overview

##### Project type and purpose
- This is a research‐oriented cryptographic library and benchmarking suite. It implements Private Access Control Lists (PACLs) on top of Distributed Point Functions (DPFs) and Verifiable DPFs (VDPFs). The repo contains:
- A C implementation of the core DPF/VDPF primitives (“vdpf/src”)
- Go packages for algebraic primitives, elliptic‐curve wrappers, SPoSS proofs, and two flavours of PACLs (public‐key and secret‐key)
- Benchmark harnesses (FSS, anonymous comms, authentication, PIR) that exercise the PACL constructions
- A results folder with raw JSON output and Python plotting scripts for paper figures

##### File structure
- Top‐level “vdpf” submodule (C code, built via CMake) provides DPF/VDPF operations
- Go packages in order of dependency
- algebra/ (finite fields, groups)
- ec/ (P256 wrapper, uses OpenSSL/GMP)
- sposs/ (Schnorr Proof over Secret Shares)
- pacl-pk/, pacl-sk/, pacl-sposs/ (three PACL constructions, import algebra, ec, sposs)
- Benchmarks under bench-*/ directories: each is a small Go program + bash script that runs experiments and emits JSON
- paper_results/: raw JSON + Python scripts that load JSON and generate plots

##### Insights from the README
- Dependencies: GMP, OpenSSL, Go ≥1.13, CMake, Make, Clang
- Build sequence:
1. `git submodule update ...` to pull in vdpf
2. `cd vdpf/src && make` to compile C code
3. `go mod tidy` && `go build` for Go packages
4. Run each bench-*/run.sh to produce JSON
5. Run Python scripts in paper_results to generate figures

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "External Dependencies"
        GMP["GMP\n(big-int library)"]:::external
        OPENSSL["OpenSSL\n(ECC)"]:::external
        CLANG["Clang\n(C compiler)"]:::external
    end

    subgraph "C Core (VDPF/DPF)"
        VDPF["vdpf/src"]:::core
    end

    subgraph "Go Primitive Layer"
        ALGE["algebra/\nFinite fields & groups"]:::core
        EC["ec/\nP256 wrapper"]:::core
    end

    subgraph "Proof Layer"
        SPOSS["sposs/\nSchnorr Proof"]:::proof
    end

    subgraph "PACL Constructions"
        PK["pacl-pk/\nPublic-key PACL"]:::pacl
        SK["pacl-sk/\nSecret-key PACL"]:::pacl
        PK_SPOS["pacl-sposs/\nSPoSS-based PACL"]:::pacl
    end

    subgraph "Benchmark Harnesses"
        FSS["bench-fss/\nFSS Benchmark"]:::bench
        ANON["bench-anon/\nAnonymous Comms"]:::bench
        AUTH["bench-auth/\nAuthentication"]:::bench
        PIR["bench-pir/\nPIR Benchmark"]:::bench
    end

    subgraph "Results & Plotting"
        JSON["JSON Files"]:::results
        PLOTS["Python Scripts\nPlot Figures"]:::results
    end

    GMP --> VDPF
    OPENSSL --> VDPF
    CLANG --> VDPF

    VDPF --> ALGE
    VDPF --> EC

    ALGE --> SPOSS
    EC --> SPOSS

    ALGE --> PK
    ALGE --> SK
    ALGE --> PK_SPOS

    EC --> PK
    EC --> SK
    EC --> PK_SPOS

    SPOSS --> PK_SPOS

    PK --> FSS
    PK --> ANON
    PK --> AUTH
    PK --> PIR

    SK --> FSS
    SK --> ANON
    SK --> AUTH
    SK --> PIR

    PK_SPOS --> FSS
    PK_SPOS --> ANON
    PK_SPOS --> AUTH
    PK_SPOS --> PIR

    FSS --> JSON
    ANON --> JSON
    AUTH --> JSON
    PIR --> JSON

    JSON --> PLOTS

    click VDPF "https://github.com/sachaservan/pacl/tree/main/vdpf/src"
    click ALGE "https://github.com/sachaservan/pacl/tree/main/algebra/"
    click EC "https://github.com/sachaservan/pacl/tree/main/ec/"
    click SPOSS "https://github.com/sachaservan/pacl/tree/main/sposs/"
    click PK "https://github.com/sachaservan/pacl/tree/main/pacl-pk/"
    click SK "https://github.com/sachaservan/pacl/tree/main/pacl-sk/"
    click PK_SPOS "https://github.com/sachaservan/pacl/tree/main/pacl-sposs/"
    click ANON "https://github.com/sachaservan/pacl/tree/main/bench-anon/"
    click AUTH "https://github.com/sachaservan/pacl/tree/main/bench-auth/"
    click FSS "https://github.com/sachaservan/pacl/tree/main/bench-fss/"
    click PIR "https://github.com/sachaservan/pacl/tree/main/bench-pir/"
    click PLOTS "https://github.com/sachaservan/pacl/tree/main/paper_results/"

    classDef external fill:#cccccc,stroke:#333,stroke-width:1px
    classDef core fill:#B3CDE3,stroke:#333,stroke-width:1px
    classDef proof fill:#C7E9C0,stroke:#333,stroke-width:1px
    classDef pacl fill:#FDCC8A,stroke:#333,stroke-width:1px
    classDef bench fill:#F4A582,stroke:#333,stroke-width:1px
    classDef results fill:#CAB2D6,stroke:#333,stroke-width:1px
```
