|
cryptnox-sdk-cpp 1.0.0
Platform-independent C++ core SDK for Cryptnox Hardware Wallet
|
cryptnox-sdk-cpp is the shared C++ core SDK for the Cryptnox Hardware Wallet. It implements the card-side protocol — secure channel establishment (SELECT → certificate → ECDH → mutual auth), APDU framing, PIN verification, signing, and user-data writing — independently of any target platform, NFC reader, or crypto library.
This core is consumed as a submodule by the platform-specific SDKs:
| Integration | Repository |
|---|---|
| ESP32-S3 (ESP-IDF v5.5) | cryptnox/cryptnox-sdk-esp32 |
| Arduino R4 (Renesas RA4M1) | cryptnox/cryptnox-sdk-arduino |
If you want to talk to a Cryptnox card on real hardware, start from one of those repositories.
This repository is intended as the starting point for porting the SDK to a new platform (another MCU family, a desktop OS, a different NFC reader, a different crypto backend, etc.).
A port consists of providing concrete implementations of the three adapter interfaces:
| Interface | What you must provide |
|---|---|
| CW_NfcTransport | Driver for your NFC reader (PN532, PN7150, PC/SC, …) |
| CW_CryptoProvider | SHA-256/512, AES-CBC, ECDH, EC key generation, RNG (mbedTLS, BearSSL, OpenSSL, hardware peripheral, …) |
| CW_Logger | Output sink (UART, stdout, syslog, network, …) |
Then drop this repository in as a submodule (or copy of its sources) inside your project, build it together with your adapters, and instantiate CryptnoxWallet with the three injected dependencies. The existing platform SDKs (cryptnox-sdk-esp32, cryptnox-sdk-arduino) are useful references for a complete port.
| File | Role |
|---|---|
| CryptnoxWallet.{h,cpp} | High-level API: begin, connect, verifyPin, sign, writeUserData, disconnect |
| CW_SecureChannel.{h,cpp} | Secure channel protocol (mutual auth, session keys, encrypted APDU exchange) |
| CW_NfcTransport.h | Adapter interface — NFC reader contract |
| CW_CryptoProvider.h | Adapter interface — SHA-256/512, AES-CBC, ECDH, EC keygen, RNG |
| CW_Logger.h | Adapter interface — debug/serial output |
| CW_TrustedKeys.h | Cryptnox CA public keys used to verify card certificates |
| CW_Defs.h, CW_Utils.{h,cpp} | Constants, error codes, small helpers |
| platform_compat.h | Shim for non-Arduino targets |
The three adapter interfaces are the only contract a host must satisfy. Everything else is self-contained.
A host integration injects its three adapters into CryptnoxWallet:
Full runnable examples (PIN verify, transaction signing, full ESP-IDF / Arduino boilerplate) live in the platform SDKs linked above.
There is no standalone build target in this repository. The CI workflow runs cppcheck static analysis only (.github/workflows/static_analysis.yml); host-supplied headers (uECC.h, mbedtls/*, platform logger) are not vendored, so missingInclude is suppressed.
To compile and exercise the code, use one of the platform SDKs.
The generated documentation for this project is available here.
cryptnox-sdk-cpp is dual-licensed:
For commercial inquiries, contact: conta.nosp@m.ct@c.nosp@m.ryptn.nosp@m.ox.c.nosp@m.om