# flutterindiadev1/flutter_pqc architecture

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

- Interactive diagram: https://gitdiagram.com/flutterindiadev1/flutter_pqc
- Repository: https://github.com/flutterindiadev1/flutter_pqc

## Overview

flutter_pqc is a Flutter FFI wrapper for post-quantum key encapsulation and digital signatures. The documented workflows are key generation plus KEM encapsulation/decapsulation to establish a shared secret, and key generation plus signing/verification of a message. The README describes liboqs as the native cryptographic engine; sampled C source contains only sum demonstration functions, so its cryptographic wiring cannot be confirmed from those excerpts.

Main entry points: [`lib/flutter_pqc.dart`](https://github.com/flutterindiadev1/flutter_pqc/blob/main/lib/flutter_pqc.dart) (KEM operations), [`lib/flutter_pqc_sig.dart`](https://github.com/flutterindiadev1/flutter_pqc/blob/main/lib/flutter_pqc_sig.dart) (Signature operations), [`lib/flutter_pqc_bindings_generated.dart`](https://github.com/flutterindiadev1/flutter_pqc/blob/main/lib/flutter_pqc_bindings_generated.dart) (FFI bindings), [`src/flutter_pqc.c`](https://github.com/flutterindiadev1/flutter_pqc/blob/main/src/flutter_pqc.c) (Native C source)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["Dart API"]
  node_facade["Public API<br/>[flutter_pqc.dart]"]
  node_kem["KEM operations<br/>[flutter_pqc.dart]"]
  node_signature["Signature operations"]
end

subgraph group_ffi["Native interface"]
  node_bindings["FFI bindings"]
  node_native["Native C source<br/>[flutter_pqc.c]"]
end

subgraph group_crypto["Cryptography"]
  node_oqs["liboqs"]
end

node_app(("Flutter app"))
node_peer(("Remote peer"))

node_app -->|"uses"| node_facade
node_facade -->|"creates"| node_kem
node_app -->|"uses"| node_signature
node_kem -->|"FFI calls"| node_bindings
node_signature -->|"FFI calls"| node_bindings
node_peer -->|"exchanges ciphertext"| node_kem
node_kem -->|"shares ciphertext"| node_peer
node_native -.-> node_oqs

click node_facade "https://github.com/flutterindiadev1/flutter_pqc/blob/main/lib/flutter_pqc.dart"
click node_kem "https://github.com/flutterindiadev1/flutter_pqc/blob/main/lib/flutter_pqc.dart"
click node_signature "https://github.com/flutterindiadev1/flutter_pqc/blob/main/lib/flutter_pqc_sig.dart"
click node_bindings "https://github.com/flutterindiadev1/flutter_pqc/blob/main/lib/flutter_pqc_bindings_generated.dart"
click node_native "https://github.com/flutterindiadev1/flutter_pqc/blob/main/src/flutter_pqc.c"
click node_oqs "https://github.com/flutterindiadev1/flutter_pqc/tree/main/src/liboqs"

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_facade,node_kem,node_signature toneBlue
class node_bindings,node_native toneAmber
class node_oqs toneMint
class node_app,node_peer toneIndigo
```

## Components

### Dart API

- [Public API](https://github.com/flutterindiadev1/flutter_pqc/blob/main/lib/flutter_pqc.dart): `lib/flutter_pqc.dart`
- [KEM operations](https://github.com/flutterindiadev1/flutter_pqc/blob/main/lib/flutter_pqc.dart): `lib/flutter_pqc.dart`
- [Signature operations](https://github.com/flutterindiadev1/flutter_pqc/blob/main/lib/flutter_pqc_sig.dart): `lib/flutter_pqc_sig.dart`

### Native interface

- [FFI bindings](https://github.com/flutterindiadev1/flutter_pqc/blob/main/lib/flutter_pqc_bindings_generated.dart): `lib/flutter_pqc_bindings_generated.dart`
- [Native C source](https://github.com/flutterindiadev1/flutter_pqc/blob/main/src/flutter_pqc.c): `src/flutter_pqc.c`

### Cryptography

- [liboqs](https://github.com/flutterindiadev1/flutter_pqc/tree/main/src/liboqs): `src/liboqs`

### Other components

- **Flutter app**
- **Remote peer**

## Connections

- Flutter app → Public API: uses
- Public API → KEM operations: creates
- Flutter app → Signature operations: uses
- KEM operations → FFI bindings: FFI calls
- Signature operations → FFI bindings: FFI calls
- Remote peer → KEM operations: exchanges ciphertext
- KEM operations → Remote peer: shares ciphertext
- Native C source → liboqs
