40#include <CryptnoxWallet.h>
44#define PN532_SS_PIN (10U)
50#define DEMO_PIN "000000000"
102 if (!
wallet.connect(session)) {
104 wallet.disconnect(session);
110 memset(hash, 0x01,
sizeof(hash));
126 for (uint8_t i = 0U; i < 32U; i++) {
134 for (uint8_t i = 0U; i < 32U; i++) {
145 serialAdapter.println(
F(
"Wrong PIN — halting to protect retry counter"));
148 wallet.disconnect(session);
157 wallet.disconnect(session);
void setup()
Arduino setup function.
CryptnoxWallet wallet(nfc, serialAdapter, cryptoProvider, platform)
PN532Adapter nfc(serialAdapter, PN532_SS, &SPI)
ArduinoLoggerAdapter serialAdapter
ArduinoCryptoProvider cryptoProvider
void loop()
Arduino main loop.
#define CW_SIGN_SIG_ECDSA_LOW_S
#define CW_SIGN_PIN_INCORRECT
#define PN532_SS_PIN
SPI slave-select (CS) pin connected to the PN532 module.
#define DEMO_PIN
Demo PIN used by this example. Must match the PIN that the card was initialised with (4–9 ASCII digit...
CW_CryptoProvider implementation for the Arduino UNO R4 (RA4M1).
CW_Logger implementation wrapping Arduino's HardwareSerial.
static bool safe_memcpy(uint8_t *dst, size_t dstSize, const uint8_t *src, size_t count)
Safe memcpy — validates pointers, sizes, and checks for overlap.
static void secure_wipe(uint8_t *buf, size_t len)
Securely zero a buffer, guaranteed not to be optimised away.
High-level interface for interacting with a Cryptnox Hardware Wallet over NFC.
CW_NfcTransport implementation over the Adafruit_PN532 driver.
Holds cryptographic session state for reentrant secure channel operations.
Request parameters for CryptnoxWallet::sign.
uint8_t pin[CW_MAX_PIN_LENGTH]
Result of CryptnoxWallet::sign.
uint8_t signature[CW_RAW_SIGNATURE_SIZE]