# mko-x/sharedaes-gcm architecture

> Architecture diagram of the GitHub repository mko-x/sharedaes-gcm, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mko-x/sharedaes-gcm
- Repository: https://github.com/mko-x/sharedaes-gcm

## Overview

SharedAES-GCM is a cross-platform AES-GCM library, exposing a C convenience API and an Objective-C interface. The runtime path shown by the excerpts is a caller invoking the C wrapper, which delegates encryption or decryption to the GCM implementation; GCM uses the AES block-cipher implementation. The Objective-C header declares encrypt/decrypt methods, but its implementation was not sampled, so its connection to the C API is not asserted. The test harness is excluded as non-product code.

Main entry points: [`Sources/aes-gcm.c`](https://github.com/mko-x/sharedaes-gcm/blob/master/Sources/aes-gcm.c) (C convenience API), [`Sources/gcm.c`](https://github.com/mko-x/sharedaes-gcm/blob/master/Sources/gcm.c) (AES-GCM), [`Sources/aes.c`](https://github.com/mko-x/sharedaes-gcm/blob/master/Sources/aes.c) (AES cipher)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["Public APIs"]
  node_objc["Objective-C API<br/>[AES-GCM_ObjC.h]"]
  node_cwrap["C convenience API<br/>[aes-gcm.c]"]
end

subgraph group_crypto["Cryptographic engine"]
  node_gcm["AES-GCM<br/>[gcm.c]"]
  node_aes["AES cipher<br/>[aes.c]"]
end

node_caller(("Library caller"))

node_caller -->|"calls"| node_cwrap
node_cwrap -->|"delegates to"| node_gcm
node_gcm -->|"uses block cipher"| node_aes

click node_objc "https://github.com/mko-x/sharedaes-gcm/blob/master/Classes/AES-GCM_ObjC.h"
click node_cwrap "https://github.com/mko-x/sharedaes-gcm/blob/master/Sources/aes-gcm.c"
click node_gcm "https://github.com/mko-x/sharedaes-gcm/blob/master/Sources/gcm.c"
click node_aes "https://github.com/mko-x/sharedaes-gcm/blob/master/Sources/aes.c"

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_objc,node_cwrap toneBlue
class node_gcm,node_aes toneAmber
class node_caller toneIndigo
```

## Components

### Public APIs

- [Objective-C API](https://github.com/mko-x/sharedaes-gcm/blob/master/Classes/AES-GCM_ObjC.h): `Classes/AES-GCM_ObjC.h`
- [C convenience API](https://github.com/mko-x/sharedaes-gcm/blob/master/Sources/aes-gcm.c): `Sources/aes-gcm.c`

### Cryptographic engine

- [AES-GCM](https://github.com/mko-x/sharedaes-gcm/blob/master/Sources/gcm.c): `Sources/gcm.c`
- [AES cipher](https://github.com/mko-x/sharedaes-gcm/blob/master/Sources/aes.c): `Sources/aes.c`

### Other components

- **Library caller**

## Connections

- Library caller → C convenience API: calls (evidence: `Sources/aes-gcm.c`)
- C convenience API → AES-GCM: delegates to (evidence: `Sources/aes-gcm.c`)
- AES-GCM → AES cipher: uses block cipher (evidence: `Sources/gcm.c`)
