18#include <CryptnoxWallet.h>
71#error "Please define USE_SPI or USE_I2C to select the PN532 interface."
75#define DEFAULT_PIN "000000000"
76#define DEFAULT_PIN_LEN (sizeof(DEFAULT_PIN) - 1U)
121 if (
wallet.connect(session)) {
122 serialAdapter.println(
F(
"Card connected and secure channel established"));
129 memset(testHash, 0x01,
sizeof(testHash));
135 signRequest.
hash = testHash;
144 serialAdapter.println(
F(
"Signature received (64 bytes raw r||s)"));
173 wallet.disconnect(session);
#define DEFAULT_PIN
Default PIN code (ASCII digits). Must match the PIN used during card.init().
void setup()
Arduino setup function.
CryptnoxWallet wallet(nfc, serialAdapter, cryptoProvider, platform)
#define PN532_SS
SPI slave select (CS) pin for the PN532 module.
PN532Adapter nfc(serialAdapter, PN532_SS, &SPI)
ArduinoLoggerAdapter serialAdapter
ArduinoCryptoProvider cryptoProvider
void loop()
Arduino main loop.
#define CW_SIGN_SIG_ECDSA_LOW_S
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]