# grqz/aes architecture

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

- Interactive diagram: https://gitdiagram.com/grqz/aes
- Repository: https://github.com/grqz/aes

## Overview

This repository contains low-level AES implementations for 128-, 192-, and 256-bit keys, plus a GHASH routine. The visible AES source includes its implementation and shows the cipher invoking round transformations; `ghash.S` is present, but its contents and relationship to AES are not shown. The README is empty, so public usage and any broader workflow cannot be established from the available evidence.

Main entry points: [`aes_impl.c`](https://github.com/grqz/aes/blob/master/aes_impl.c) (AES key and rounds), [`aes.c`](https://github.com/grqz/aes/blob/master/aes.c) (AES inclusion and variants), [`ghash.S`](https://github.com/grqz/aes/blob/master/ghash.S) (GHASH routine)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_aes["AES primitives"]
  node_aes_core["AES key and rounds<br/>[aes_impl.c]"]
  node_aes_transforms["AES state transforms<br/>[aes_impl.c]"]
  node_gf_arithmetic["GF arithmetic<br/>[aes_impl.c]"]
  node_aes_inclusion["AES inclusion and variants<br/>[aes.c]"]
end

subgraph group_ghash["GHASH primitive"]
  node_ghash_impl["GHASH routine<br/>[ghash.S]"]
end

node_consumer(("Cryptography caller"))

node_aes_inclusion -->|"includes implementation"| node_aes_core
node_aes_core -->|"applies rounds"| node_aes_transforms
node_aes_transforms -->|"uses field operations"| node_gf_arithmetic
node_consumer -.->|"uses AES"| node_aes_inclusion
node_consumer -.->|"uses GHASH"| node_ghash_impl

click node_aes_core "https://github.com/grqz/aes/blob/master/aes_impl.c"
click node_aes_transforms "https://github.com/grqz/aes/blob/master/aes_impl.c"
click node_gf_arithmetic "https://github.com/grqz/aes/blob/master/aes_impl.c"
click node_aes_inclusion "https://github.com/grqz/aes/blob/master/aes.c"
click node_ghash_impl "https://github.com/grqz/aes/blob/master/ghash.S"

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_aes_core,node_aes_transforms,node_gf_arithmetic,node_aes_inclusion toneBlue
class node_ghash_impl toneAmber
class node_consumer toneIndigo
```

## Components

### AES primitives

- [AES key and rounds](https://github.com/grqz/aes/blob/master/aes_impl.c): `aes_impl.c`
- [AES state transforms](https://github.com/grqz/aes/blob/master/aes_impl.c): `aes_impl.c`
- [GF arithmetic](https://github.com/grqz/aes/blob/master/aes_impl.c): `aes_impl.c`
- [AES inclusion and variants](https://github.com/grqz/aes/blob/master/aes.c): `aes.c`

### GHASH primitive

- [GHASH routine](https://github.com/grqz/aes/blob/master/ghash.S): `ghash.S`

### Other components

- **Cryptography caller**

## Connections

- AES inclusion and variants → AES key and rounds: includes implementation (evidence: `aes.c`)
- AES key and rounds → AES state transforms: applies rounds (evidence: `aes_impl.c`)
- AES state transforms → GF arithmetic: uses field operations (evidence: `aes_impl.c`)
- Cryptography caller → AES inclusion and variants: uses AES
- Cryptography caller → GHASH routine: uses GHASH
