# amramin761/v2g_cryptostack architecture

> Architecture diagram of the GitHub repository amramin761/v2g_cryptostack, 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/amramin761/v2g_cryptostack
- Repository: https://github.com/amramin761/v2g_cryptostack

## Overview

V2G_CryptoStack is an AUTOSAR-style cryptographic services stack. The principal workflow is an application submitting a configured cryptographic job through CSM, CryIf routing it to the Crypto driver, and the driver executing a primitive and returning completion. The README names ECDH, 3-DES, SHA-256, and ECDSA; the graph preserves these capabilities and the ECDSA arithmetic layer. Some algorithm sources were not sampled, so their links to the driver are documented only where the source index supports them or are left unverified.

Main entry points: [`Crypto/src/Crypto.c`](https://github.com/amramin761/v2g_cryptostack/blob/main/Crypto/src/Crypto.c) (Crypto driver), [`CryIf/src/CryIf.c`](https://github.com/amramin761/v2g_cryptostack/blob/main/CryIf/src/CryIf.c) (CryIf routing), [`CSM/src/Csm.c`](https://github.com/amramin761/v2g_cryptostack/blob/main/CSM/src/Csm.c) (CSM services), [`Crypto_ecdsa/ecp.c`](https://github.com/amramin761/v2g_cryptostack/blob/main/Crypto_ecdsa/ecp.c) (EC point math)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_service["Service routing"]
  node_csm["CSM services<br/>[Csm.c]"]
  node_cryif["CryIf routing<br/>[CryIf.c]"]
end

subgraph group_driver["Crypto driver"]
  node_crypto["Crypto driver<br/>[Crypto.c]"]
end

subgraph group_algorithms["Crypto primitives"]
  node_sha["SHA-256<br/>[sha256.c]"]
  node_des["3-DES<br/>[3-DES.c]"]
  node_ecdh["ECDH<br/>[Crypto_ECDH.c]"]
  node_ecdsa_sign["ECDSA signing"]
  node_ecdsa_verify["ECDSA verification"]
  node_ecp["EC point math<br/>[ecp.c]"]
  node_bignum["Big integers<br/>[bignum.c]"]
end

subgraph group_state["Key storage"]
  node_nvm[("Key and certificate storage<br/>[NvM.c]")]
end

node_application(("Application"))

node_application -->|"submits job"| node_csm
node_csm -->|"dispatches job"| node_cryif
node_cryif -->|"routes jobs"| node_crypto
node_crypto -->|"uses SHA-256"| node_sha
node_crypto -->|"uses ECDH"| node_ecdh
node_crypto -->|"calls signing"| node_ecdsa_sign
node_crypto -->|"calls verification"| node_ecdsa_verify
node_crypto -.->|"supports 3-DES"| node_des
node_ecp -->|"uses integers"| node_bignum
node_crypto -->|"uses key descriptors"| node_nvm
node_crypto -->|"notifies completion"| node_cryif

click node_csm "https://github.com/amramin761/v2g_cryptostack/blob/main/CSM/src/Csm.c"
click node_cryif "https://github.com/amramin761/v2g_cryptostack/blob/main/CryIf/src/CryIf.c"
click node_crypto "https://github.com/amramin761/v2g_cryptostack/blob/main/Crypto/src/Crypto.c"
click node_sha "https://github.com/amramin761/v2g_cryptostack/blob/main/Crypto_ecdsa/sha256.c"
click node_des "https://github.com/amramin761/v2g_cryptostack/blob/main/Crypto_3DES/3-DES.c"
click node_ecdh "https://github.com/amramin761/v2g_cryptostack/blob/main/Crypto_ECDH/src/Crypto_ECDH.c"
click node_ecdsa_sign "https://github.com/amramin761/v2g_cryptostack/blob/main/Crypto_ecdsa/Crypto_ECDSA_Signature_Generate.c"
click node_ecdsa_verify "https://github.com/amramin761/v2g_cryptostack/blob/main/Crypto_ecdsa/Crypto_ECDSA_Signature_Verify.c"
click node_ecp "https://github.com/amramin761/v2g_cryptostack/blob/main/Crypto_ecdsa/ecp.c"
click node_bignum "https://github.com/amramin761/v2g_cryptostack/blob/main/Crypto_ecdsa/bignum.c"
click node_nvm "https://github.com/amramin761/v2g_cryptostack/blob/main/NvM/src/NvM.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_csm,node_cryif toneBlue
class node_crypto toneAmber
class node_sha,node_des,node_ecdh,node_ecdsa_sign,node_ecdsa_verify,node_ecp,node_bignum toneMint
class node_nvm toneRose
class node_application toneIndigo
```

## Components

### Service routing

- [CSM services](https://github.com/amramin761/v2g_cryptostack/blob/main/CSM/src/Csm.c): `CSM/src/Csm.c`
- [CryIf routing](https://github.com/amramin761/v2g_cryptostack/blob/main/CryIf/src/CryIf.c): `CryIf/src/CryIf.c`

### Crypto driver

- [Crypto driver](https://github.com/amramin761/v2g_cryptostack/blob/main/Crypto/src/Crypto.c): `Crypto/src/Crypto.c`

### Crypto primitives

- [SHA-256](https://github.com/amramin761/v2g_cryptostack/blob/main/Crypto_ecdsa/sha256.c): `Crypto_ecdsa/sha256.c`
- [3-DES](https://github.com/amramin761/v2g_cryptostack/blob/main/Crypto_3DES/3-DES.c): `Crypto_3DES/3-DES.c`
- [ECDH](https://github.com/amramin761/v2g_cryptostack/blob/main/Crypto_ECDH/src/Crypto_ECDH.c): `Crypto_ECDH/src/Crypto_ECDH.c`
- [ECDSA signing](https://github.com/amramin761/v2g_cryptostack/blob/main/Crypto_ecdsa/Crypto_ECDSA_Signature_Generate.c): `Crypto_ecdsa/Crypto_ECDSA_Signature_Generate.c`
- [ECDSA verification](https://github.com/amramin761/v2g_cryptostack/blob/main/Crypto_ecdsa/Crypto_ECDSA_Signature_Verify.c): `Crypto_ecdsa/Crypto_ECDSA_Signature_Verify.c`
- [EC point math](https://github.com/amramin761/v2g_cryptostack/blob/main/Crypto_ecdsa/ecp.c): `Crypto_ecdsa/ecp.c`
- [Big integers](https://github.com/amramin761/v2g_cryptostack/blob/main/Crypto_ecdsa/bignum.c): `Crypto_ecdsa/bignum.c`

### Key storage

- [Key and certificate storage](https://github.com/amramin761/v2g_cryptostack/blob/main/NvM/src/NvM.c): `NvM/src/NvM.c`

### Other components

- **Application**

## Connections

- Application → CSM services: submits job (evidence: `CSM/src/Csm.c`)
- CSM services → CryIf routing: dispatches job (evidence: `CSM/src/Csm.c`)
- CryIf routing → Crypto driver: routes jobs
- Crypto driver → SHA-256: uses SHA-256 (evidence: `Crypto/src/Crypto.c`)
- Crypto driver → ECDH: uses ECDH (evidence: `Crypto/src/Crypto.c`)
- Crypto driver → ECDSA signing: calls signing (evidence: `Crypto/src/Crypto.c`)
- Crypto driver → ECDSA verification: calls verification (evidence: `Crypto/src/Crypto.c`)
- Crypto driver → 3-DES: supports 3-DES
- EC point math → Big integers: uses integers
- Crypto driver → Key and certificate storage: uses key descriptors
- Crypto driver → CryIf routing: notifies completion (evidence: `Crypto/src/Crypto.c`)
