# secertcrypto/dynamic-secure-graph architecture

> Architecture diagram of the GitHub repository secertcrypto/dynamic-secure-graph, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/secertcrypto/dynamic-secure-graph
- Repository: https://github.com/secertcrypto/dynamic-secure-graph

## Overview

Graphiti is a C++ secure graph-computation protocol. Its documented user-facing workload is multi-party message passing; the repository also includes GraphSC evaluation, graph-oriented circuit workloads, shuffle functionality, and cryptographic backends. The source excerpts show online gate evaluation using circuit definitions and network communication, and Spiral client operations using polynomial routines. Several documented capabilities lack their runtime entry points in the supplied tree, so those branches are shown without inferred call chains; dashed links mark unverified integration.

Main entry points: [`src/graphsc/online_evaluator_load_balanced.cpp`](https://github.com/secertcrypto/dynamic-secure-graph/blob/master/src/graphsc/online_evaluator_load_balanced.cpp) (Online Evaluator), [`src/spiral/src/client.cpp`](https://github.com/secertcrypto/dynamic-secure-graph/blob/master/src/spiral/src/client.cpp) (Spiral Client), [`src/sfssgen/backend.h`](https://github.com/secertcrypto/dynamic-secure-graph/blob/master/src/sfssgen/backend.h) (SFSS Backend), [`src/graphsc/preproc.h`](https://github.com/secertcrypto/dynamic-secure-graph/blob/master/src/graphsc/preproc.h) (Preprocessing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workloads["Graph Workloads"]
  node_message_passing["Message Passing"]
  node_darkpool["Darkpool<br/>[darkpool.h]"]
  node_liquidity["Liquidity Matching"]
  node_neural_network["Neural Network<br/>[neural_network.h]"]
  node_scatter["Scatter Workload<br/>[scatter.h]"]
end

subgraph group_graphsc["GraphSC Protocol"]
  node_graphsc_offline["Offline Evaluator"]
  node_graphsc_online["Online Evaluator"]
  node_circuit["Circuit Engine<br/>[circuit.h]"]
  node_sharing["Additive Sharing<br/>[sharing.h]"]
  node_preprocessing["Preprocessing<br/>[preproc.h]"]
  node_random_pool["Random Pool<br/>[rand_gen_pool.h]"]
end

subgraph group_crypto["Cryptographic Backends"]
  node_sfss_dpf["DPF<br/>[dpf.cpp]"]
  node_sfss_backend["SFSS Backend<br/>[backend.h]"]
  node_lwr_khprf["LWR Key PRF<br/>[lwr_khprf.h]"]
  node_spiral_client["Spiral Client<br/>[client.cpp]"]
  node_polynomial["Polynomial Operations<br/>[poly.cpp]"]
  node_spiral_core["Spiral Core<br/>[core.cpp]"]
end

subgraph group_support["Protocol Support"]
  node_network["Party Network<br/>[netmp.h]"]
end

node_participant(("Protocol Participant"))

node_participant -->|"runs workload"| node_message_passing
node_participant -.->|"uses workload"| node_darkpool
node_participant -.->|"uses workload"| node_liquidity
node_participant -.->|"uses workload"| node_neural_network
node_participant -.->|"uses workload"| node_scatter
node_graphsc_online -->|"evaluates gates"| node_circuit
node_graphsc_online -->|"sends data"| node_network
node_graphsc_online -.->|"uses preprocessing"| node_preprocessing
node_graphsc_online -.->|"uses randomness"| node_random_pool
node_graphsc_online -.->|"uses shares"| node_sharing
node_graphsc_offline -.->|"prepares data"| node_preprocessing
node_sfss_dpf -.->|"uses backend"| node_sfss_backend
node_sfss_backend -.->|"uses PRF"| node_lwr_khprf
node_spiral_client -->|"uses operations"| node_polynomial
node_spiral_client -.->|"uses primitives"| node_spiral_core

click node_message_passing "https://github.com/secertcrypto/dynamic-secure-graph/tree/master/src"
click node_darkpool "https://github.com/secertcrypto/dynamic-secure-graph/blob/master/src/utils/darkpool.h"
click node_liquidity "https://github.com/secertcrypto/dynamic-secure-graph/blob/master/src/utils/liquidity_matching.h"
click node_neural_network "https://github.com/secertcrypto/dynamic-secure-graph/blob/master/src/utils/neural_network.h"
click node_scatter "https://github.com/secertcrypto/dynamic-secure-graph/blob/master/src/utils/scatter.h"
click node_graphsc_offline "https://github.com/secertcrypto/dynamic-secure-graph/blob/master/src/graphsc/offline_evaluator.cpp"
click node_graphsc_online "https://github.com/secertcrypto/dynamic-secure-graph/blob/master/src/graphsc/online_evaluator_load_balanced.cpp"
click node_circuit "https://github.com/secertcrypto/dynamic-secure-graph/blob/master/src/utils/circuit.h"
click node_sharing "https://github.com/secertcrypto/dynamic-secure-graph/blob/master/src/graphsc/sharing.h"
click node_preprocessing "https://github.com/secertcrypto/dynamic-secure-graph/blob/master/src/graphsc/preproc.h"
click node_random_pool "https://github.com/secertcrypto/dynamic-secure-graph/blob/master/src/graphsc/rand_gen_pool.h"
click node_network "https://github.com/secertcrypto/dynamic-secure-graph/blob/master/src/io/netmp.h"
click node_sfss_dpf "https://github.com/secertcrypto/dynamic-secure-graph/blob/master/src/sfssgen/dpf.cpp"
click node_sfss_backend "https://github.com/secertcrypto/dynamic-secure-graph/blob/master/src/sfssgen/backend.h"
click node_lwr_khprf "https://github.com/secertcrypto/dynamic-secure-graph/blob/master/src/sfssgen/lwr_khprf.h"
click node_spiral_client "https://github.com/secertcrypto/dynamic-secure-graph/blob/master/src/spiral/src/client.cpp"
click node_polynomial "https://github.com/secertcrypto/dynamic-secure-graph/blob/master/src/spiral/src/poly.cpp"
click node_spiral_core "https://github.com/secertcrypto/dynamic-secure-graph/blob/master/src/spiral/src/core.cpp"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_message_passing,node_darkpool,node_liquidity,node_neural_network,node_scatter toneBlue
class node_graphsc_offline,node_graphsc_online,node_circuit,node_sharing,node_preprocessing,node_random_pool toneAmber
class node_sfss_dpf,node_sfss_backend,node_lwr_khprf,node_spiral_client,node_polynomial,node_spiral_core toneMint
class node_network toneRose
class node_participant toneIndigo
```

## Components

### Graph Workloads

- [Message Passing](https://github.com/secertcrypto/dynamic-secure-graph/tree/master/src): `src`
- [Darkpool](https://github.com/secertcrypto/dynamic-secure-graph/blob/master/src/utils/darkpool.h): `src/utils/darkpool.h`
- [Liquidity Matching](https://github.com/secertcrypto/dynamic-secure-graph/blob/master/src/utils/liquidity_matching.h): `src/utils/liquidity_matching.h`
- [Neural Network](https://github.com/secertcrypto/dynamic-secure-graph/blob/master/src/utils/neural_network.h): `src/utils/neural_network.h`
- [Scatter Workload](https://github.com/secertcrypto/dynamic-secure-graph/blob/master/src/utils/scatter.h): `src/utils/scatter.h`

### GraphSC Protocol

- [Offline Evaluator](https://github.com/secertcrypto/dynamic-secure-graph/blob/master/src/graphsc/offline_evaluator.cpp): `src/graphsc/offline_evaluator.cpp`
- [Online Evaluator](https://github.com/secertcrypto/dynamic-secure-graph/blob/master/src/graphsc/online_evaluator_load_balanced.cpp): `src/graphsc/online_evaluator_load_balanced.cpp`
- [Circuit Engine](https://github.com/secertcrypto/dynamic-secure-graph/blob/master/src/utils/circuit.h): `src/utils/circuit.h`
- [Additive Sharing](https://github.com/secertcrypto/dynamic-secure-graph/blob/master/src/graphsc/sharing.h): `src/graphsc/sharing.h`
- [Preprocessing](https://github.com/secertcrypto/dynamic-secure-graph/blob/master/src/graphsc/preproc.h): `src/graphsc/preproc.h`
- [Random Pool](https://github.com/secertcrypto/dynamic-secure-graph/blob/master/src/graphsc/rand_gen_pool.h): `src/graphsc/rand_gen_pool.h`

### Cryptographic Backends

- [DPF](https://github.com/secertcrypto/dynamic-secure-graph/blob/master/src/sfssgen/dpf.cpp): `src/sfssgen/dpf.cpp`
- [SFSS Backend](https://github.com/secertcrypto/dynamic-secure-graph/blob/master/src/sfssgen/backend.h): `src/sfssgen/backend.h`
- [LWR Key PRF](https://github.com/secertcrypto/dynamic-secure-graph/blob/master/src/sfssgen/lwr_khprf.h): `src/sfssgen/lwr_khprf.h`
- [Spiral Client](https://github.com/secertcrypto/dynamic-secure-graph/blob/master/src/spiral/src/client.cpp): `src/spiral/src/client.cpp`
- [Polynomial Operations](https://github.com/secertcrypto/dynamic-secure-graph/blob/master/src/spiral/src/poly.cpp): `src/spiral/src/poly.cpp`
- [Spiral Core](https://github.com/secertcrypto/dynamic-secure-graph/blob/master/src/spiral/src/core.cpp): `src/spiral/src/core.cpp`

### Protocol Support

- [Party Network](https://github.com/secertcrypto/dynamic-secure-graph/blob/master/src/io/netmp.h): `src/io/netmp.h`

### Other components

- **Protocol Participant**

## Connections

- Protocol Participant → Message Passing: runs workload (evidence: `README.md`)
- Protocol Participant → Darkpool: uses workload
- Protocol Participant → Liquidity Matching: uses workload
- Protocol Participant → Neural Network: uses workload
- Protocol Participant → Scatter Workload: uses workload
- Online Evaluator → Circuit Engine: evaluates gates (evidence: `src/graphsc/online_evaluator_load_balanced.cpp`)
- Online Evaluator → Party Network: sends data (evidence: `src/graphsc/online_evaluator_load_balanced.cpp`)
- Online Evaluator → Preprocessing: uses preprocessing
- Online Evaluator → Random Pool: uses randomness
- Online Evaluator → Additive Sharing: uses shares
- Offline Evaluator → Preprocessing: prepares data
- DPF → SFSS Backend: uses backend
- SFSS Backend → LWR Key PRF: uses PRF (evidence: `src/sfssgen/backend.h`)
- Spiral Client → Polynomial Operations: uses operations (evidence: `src/spiral/src/client.cpp`)
- Spiral Client → Spiral Core: uses primitives
