# boschresearch/pq-wolfssl architecture

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

- Interactive diagram: https://gitdiagram.com/boschresearch/pq-wolfssl
- Repository: https://github.com/boschresearch/pq-wolfssl

## Overview

pq-wolfSSL is a wolfSSL 4.7.0 fork that adds post-quantum cryptography to TLS 1.3, X.509 certificates, and cryptographic benchmarking. The principal workflow is a TLS peer using wolfSSL’s TLS implementation, which relies on wolfCrypt for cryptographic operations; the fork additionally integrates PQ key exchange and signatures into handshakes and certificate operations. The tree also contains many embedded-platform examples and compatibility headers. Relationships among unsampled PQ and certificate internals are based on README capability statements, not inspected implementation details.

Main entry points: [`src/tls13.c`](https://github.com/boschresearch/pq-wolfssl/blob/master/src/tls13.c) (TLS 1.3 handshake), [`wolfcrypt/src`](https://github.com/boschresearch/pq-wolfssl/tree/master/wolfcrypt/src) (PQC benchmarks), [`wolfssl/wolfcrypt/asn.h`](https://github.com/boschresearch/pq-wolfssl/blob/master/wolfssl/wolfcrypt/asn.h) (ASN.1 certificates), [`wolfssl/ssl.h`](https://github.com/boschresearch/pq-wolfssl/blob/master/wolfssl/ssl.h) (TLS API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_tls["TLS protocol"]
  node_tls_core["TLS engine<br/>[ssl.c]"]
  node_tls_versions["TLS versions<br/>[tls.c]"]
  node_tls13["TLS 1.3 handshake<br/>[tls13.c]"]
end

subgraph group_crypto["Cryptography"]
  node_crypt_api["Crypto API<br/>[settings.h]"]
  node_kyber["Kyber KEM<br/>[kyber.c]"]
  node_dilithium["Dilithium signatures<br/>[dilithium.c]"]
  node_falcon["Falcon signatures<br/>[falcon.c]"]
  node_sphincs["SPHINCS+ signatures<br/>[sphincs.c]"]
  node_xmss["XMSS signatures<br/>[xmss.c]"]
  node_misc["Crypto utilities<br/>[misc.c]"]
  node_benchmark["PQC benchmarks"]
end

subgraph group_cert["Certificates and API"]
  node_tls_api["TLS API<br/>[ssl.h]"]
  node_asn["ASN.1 certificates<br/>[asn.h]"]
  node_ocsp["OCSP support<br/>[ocsp.h]"]
end

subgraph group_platform["Embedded examples"]
  node_micrium["Micrium TLS client<br/>[client_wolfssl.c]"]
  node_micrium_header["Micrium client interface<br/>[client_wolfssl.h]"]
  node_renesas["Renesas TLS demo<br/>[wolf_client.c]"]
  node_renesas_header["Renesas demo interface<br/>[wolf_demo.h]"]
  node_stm32["STM32 example<br/>[main.c]"]
  node_stm32_header["STM32 example interface<br/>[wolfssl_example.h]"]
  node_azure_client["Azure client<br/>[client.c]"]
  node_azure_header["Azure client interface<br/>[client.h]"]
  node_mqx_client["MQX TLS client<br/>[main.c]"]
  node_mqx_benchmark["MQX crypto benchmark<br/>[main.c]"]
  node_mqx_tests["MQX crypto tests<br/>[main.c]"]
  node_mcapi_settings["MCAPI configuration<br/>[user_settings.h]"]
end

node_peer(("TLS peer"))

node_peer -->|"uses TLS"| node_tls_api
node_tls_api -->|"exposes OCSP"| node_ocsp
node_tls_api -->|"references ASN.1"| node_asn
node_tls_core -.->|"uses protocol"| node_tls_versions
node_tls13 -.->|"uses key exchange"| node_kyber
node_tls13 -.->|"uses authentication"| node_dilithium
node_tls13 -.->|"uses authentication"| node_falcon
node_tls13 -.->|"uses authentication"| node_sphincs
node_tls13 -.->|"uses authentication"| node_xmss
node_asn -.->|"supports PQ certificates"| node_dilithium
node_asn -.->|"supports PQ certificates"| node_falcon
node_asn -.->|"supports PQ certificates"| node_sphincs
node_asn -.->|"supports PQ certificates"| node_xmss
node_benchmark -.->|"benchmarks algorithms"| node_kyber
node_benchmark -.->|"benchmarks algorithms"| node_dilithium
node_benchmark -.->|"benchmarks algorithms"| node_falcon
node_benchmark -.->|"benchmarks algorithms"| node_sphincs
node_benchmark -.->|"benchmarks algorithms"| node_xmss
node_crypt_api -->|"includes settings"| node_mcapi_settings
node_micrium -->|"includes interface"| node_micrium_header
node_renesas -->|"includes interface"| node_renesas_header
node_stm32 -->|"includes interface"| node_stm32_header
node_azure_client -->|"includes interface"| node_azure_header

click node_tls_api "https://github.com/boschresearch/pq-wolfssl/blob/master/wolfssl/ssl.h"
click node_tls_core "https://github.com/boschresearch/pq-wolfssl/blob/master/src/ssl.c"
click node_tls_versions "https://github.com/boschresearch/pq-wolfssl/blob/master/src/tls.c"
click node_tls13 "https://github.com/boschresearch/pq-wolfssl/blob/master/src/tls13.c"
click node_crypt_api "https://github.com/boschresearch/pq-wolfssl/blob/master/wolfssl/wolfcrypt/settings.h"
click node_kyber "https://github.com/boschresearch/pq-wolfssl/blob/master/wolfcrypt/src/kyber.c"
click node_dilithium "https://github.com/boschresearch/pq-wolfssl/blob/master/wolfcrypt/src/dilithium.c"
click node_falcon "https://github.com/boschresearch/pq-wolfssl/blob/master/wolfcrypt/src/falcon.c"
click node_sphincs "https://github.com/boschresearch/pq-wolfssl/blob/master/wolfcrypt/src/sphincs.c"
click node_xmss "https://github.com/boschresearch/pq-wolfssl/blob/master/wolfcrypt/src/xmss.c"
click node_misc "https://github.com/boschresearch/pq-wolfssl/blob/master/wolfcrypt/src/misc.c"
click node_asn "https://github.com/boschresearch/pq-wolfssl/blob/master/wolfssl/wolfcrypt/asn.h"
click node_ocsp "https://github.com/boschresearch/pq-wolfssl/blob/master/wolfssl/ocsp.h"
click node_benchmark "https://github.com/boschresearch/pq-wolfssl/tree/master/wolfcrypt/src"
click node_micrium "https://github.com/boschresearch/pq-wolfssl/blob/master/IDE/ECLIPSE/MICRIUM/client_wolfssl.c"
click node_micrium_header "https://github.com/boschresearch/pq-wolfssl/blob/master/IDE/ECLIPSE/MICRIUM/client_wolfssl.h"
click node_renesas "https://github.com/boschresearch/pq-wolfssl/blob/master/IDE/Renesas/cs%2B/Projects/t4_demo/wolf_client.c"
click node_renesas_header "https://github.com/boschresearch/pq-wolfssl/blob/master/IDE/Renesas/cs%2B/Projects/t4_demo/wolf_demo.h"
click node_stm32 "https://github.com/boschresearch/pq-wolfssl/blob/master/IDE/STM32Cube/main.c"
click node_stm32_header "https://github.com/boschresearch/pq-wolfssl/blob/master/IDE/STM32Cube/wolfssl_example.h"
click node_azure_client "https://github.com/boschresearch/pq-wolfssl/blob/master/IDE/VS-AZURE-SPHERE/client/client.c"
click node_azure_header "https://github.com/boschresearch/pq-wolfssl/blob/master/IDE/VS-AZURE-SPHERE/client/client.h"
click node_mqx_client "https://github.com/boschresearch/pq-wolfssl/blob/master/mqx/wolfssl_client/Sources/main.c"
click node_mqx_benchmark "https://github.com/boschresearch/pq-wolfssl/blob/master/mqx/wolfcrypt_benchmark/Sources/main.c"
click node_mqx_tests "https://github.com/boschresearch/pq-wolfssl/blob/master/mqx/wolfcrypt_test/Sources/main.c"
click node_mcapi_settings "https://github.com/boschresearch/pq-wolfssl/blob/master/mcapi/user_settings.h"

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_tls_core,node_tls_versions,node_tls13 toneBlue
class node_crypt_api,node_kyber,node_dilithium,node_falcon,node_sphincs,node_xmss,node_misc,node_benchmark toneAmber
class node_tls_api,node_asn,node_ocsp toneMint
class node_micrium,node_micrium_header,node_renesas,node_renesas_header,node_stm32,node_stm32_header,node_azure_client,node_azure_header,node_mqx_client,node_mqx_benchmark,node_mqx_tests,node_mcapi_settings toneRose
class node_peer toneIndigo
```

## Components

### TLS protocol

- [TLS engine](https://github.com/boschresearch/pq-wolfssl/blob/master/src/ssl.c): `src/ssl.c`
- [TLS versions](https://github.com/boschresearch/pq-wolfssl/blob/master/src/tls.c): `src/tls.c`
- [TLS 1.3 handshake](https://github.com/boschresearch/pq-wolfssl/blob/master/src/tls13.c): `src/tls13.c`

### Cryptography

- [Crypto API](https://github.com/boschresearch/pq-wolfssl/blob/master/wolfssl/wolfcrypt/settings.h): `wolfssl/wolfcrypt/settings.h`
- [Kyber KEM](https://github.com/boschresearch/pq-wolfssl/blob/master/wolfcrypt/src/kyber.c): `wolfcrypt/src/kyber.c`
- [Dilithium signatures](https://github.com/boschresearch/pq-wolfssl/blob/master/wolfcrypt/src/dilithium.c): `wolfcrypt/src/dilithium.c`
- [Falcon signatures](https://github.com/boschresearch/pq-wolfssl/blob/master/wolfcrypt/src/falcon.c): `wolfcrypt/src/falcon.c`
- [SPHINCS+ signatures](https://github.com/boschresearch/pq-wolfssl/blob/master/wolfcrypt/src/sphincs.c): `wolfcrypt/src/sphincs.c`
- [XMSS signatures](https://github.com/boschresearch/pq-wolfssl/blob/master/wolfcrypt/src/xmss.c): `wolfcrypt/src/xmss.c`
- [Crypto utilities](https://github.com/boschresearch/pq-wolfssl/blob/master/wolfcrypt/src/misc.c): `wolfcrypt/src/misc.c`
- [PQC benchmarks](https://github.com/boschresearch/pq-wolfssl/tree/master/wolfcrypt/src): `wolfcrypt/src`

### Certificates and API

- [TLS API](https://github.com/boschresearch/pq-wolfssl/blob/master/wolfssl/ssl.h): `wolfssl/ssl.h`
- [ASN.1 certificates](https://github.com/boschresearch/pq-wolfssl/blob/master/wolfssl/wolfcrypt/asn.h): `wolfssl/wolfcrypt/asn.h`
- [OCSP support](https://github.com/boschresearch/pq-wolfssl/blob/master/wolfssl/ocsp.h): `wolfssl/ocsp.h`

### Embedded examples

- [Micrium TLS client](https://github.com/boschresearch/pq-wolfssl/blob/master/IDE/ECLIPSE/MICRIUM/client_wolfssl.c): `IDE/ECLIPSE/MICRIUM/client_wolfssl.c`
- [Micrium client interface](https://github.com/boschresearch/pq-wolfssl/blob/master/IDE/ECLIPSE/MICRIUM/client_wolfssl.h): `IDE/ECLIPSE/MICRIUM/client_wolfssl.h`
- [Renesas TLS demo](https://github.com/boschresearch/pq-wolfssl/blob/master/IDE/Renesas/cs%2B/Projects/t4_demo/wolf_client.c): `IDE/Renesas/cs+/Projects/t4_demo/wolf_client.c`
- [Renesas demo interface](https://github.com/boschresearch/pq-wolfssl/blob/master/IDE/Renesas/cs%2B/Projects/t4_demo/wolf_demo.h): `IDE/Renesas/cs+/Projects/t4_demo/wolf_demo.h`
- [STM32 example](https://github.com/boschresearch/pq-wolfssl/blob/master/IDE/STM32Cube/main.c): `IDE/STM32Cube/main.c`
- [STM32 example interface](https://github.com/boschresearch/pq-wolfssl/blob/master/IDE/STM32Cube/wolfssl_example.h): `IDE/STM32Cube/wolfssl_example.h`
- [Azure client](https://github.com/boschresearch/pq-wolfssl/blob/master/IDE/VS-AZURE-SPHERE/client/client.c): `IDE/VS-AZURE-SPHERE/client/client.c`
- [Azure client interface](https://github.com/boschresearch/pq-wolfssl/blob/master/IDE/VS-AZURE-SPHERE/client/client.h): `IDE/VS-AZURE-SPHERE/client/client.h`
- [MQX TLS client](https://github.com/boschresearch/pq-wolfssl/blob/master/mqx/wolfssl_client/Sources/main.c): `mqx/wolfssl_client/Sources/main.c`
- [MQX crypto benchmark](https://github.com/boschresearch/pq-wolfssl/blob/master/mqx/wolfcrypt_benchmark/Sources/main.c): `mqx/wolfcrypt_benchmark/Sources/main.c`
- [MQX crypto tests](https://github.com/boschresearch/pq-wolfssl/blob/master/mqx/wolfcrypt_test/Sources/main.c): `mqx/wolfcrypt_test/Sources/main.c`
- [MCAPI configuration](https://github.com/boschresearch/pq-wolfssl/blob/master/mcapi/user_settings.h): `mcapi/user_settings.h`

### Other components

- **TLS peer**

## Connections

- TLS peer → TLS API: uses TLS (evidence: `README`)
- TLS API → OCSP support: exposes OCSP (evidence: `wolfssl/ssl.h`)
- TLS API → ASN.1 certificates: references ASN.1 (evidence: `wolfssl/ssl.h`)
- TLS engine → TLS versions: uses protocol
- TLS 1.3 handshake → Kyber KEM: uses key exchange (evidence: `README`)
- TLS 1.3 handshake → Dilithium signatures: uses authentication (evidence: `README`)
- TLS 1.3 handshake → Falcon signatures: uses authentication (evidence: `README`)
- TLS 1.3 handshake → SPHINCS+ signatures: uses authentication (evidence: `README`)
- TLS 1.3 handshake → XMSS signatures: uses authentication (evidence: `README`)
- ASN.1 certificates → Dilithium signatures: supports PQ certificates (evidence: `README`)
- ASN.1 certificates → Falcon signatures: supports PQ certificates (evidence: `README`)
- ASN.1 certificates → SPHINCS+ signatures: supports PQ certificates (evidence: `README`)
- ASN.1 certificates → XMSS signatures: supports PQ certificates (evidence: `README`)
- PQC benchmarks → Kyber KEM: benchmarks algorithms (evidence: `README`)
- PQC benchmarks → Dilithium signatures: benchmarks algorithms (evidence: `README`)
- PQC benchmarks → Falcon signatures: benchmarks algorithms (evidence: `README`)
- PQC benchmarks → SPHINCS+ signatures: benchmarks algorithms (evidence: `README`)
- PQC benchmarks → XMSS signatures: benchmarks algorithms (evidence: `README`)
- Crypto API → MCAPI configuration: includes settings (evidence: `wolfssl/wolfcrypt/settings.h`)
- Micrium TLS client → Micrium client interface: includes interface (evidence: `IDE/ECLIPSE/MICRIUM/client_wolfssl.c`)
- Renesas TLS demo → Renesas demo interface: includes interface (evidence: `IDE/Renesas/cs+/Projects/t4_demo/wolf_client.c`)
- STM32 example → STM32 example interface: includes interface (evidence: `IDE/STM32Cube/main.c`)
- Azure client → Azure client interface: includes interface (evidence: `IDE/VS-AZURE-SPHERE/client/client.c`)
