cryptnox-sdk-arduino 1.0.0
Arduino library for Cryptnox Hardware Wallet
Loading...
Searching...
No Matches
CW_SecureSession Struct Reference

Holds cryptographic session state for reentrant secure channel operations. More...

#include <CW_Defs.h>

Public Member Functions

 CW_SecureSession ()
 Zero-initialise all session keys and IV.
void clear ()
 Securely clear all session keys and IV.

Public Attributes

uint8_t aesKey [CW_AESKEY_SIZE]
uint8_t macKey [CW_MACKEY_SIZE]
uint8_t iv [CW_IV_SIZE]

Detailed Description

Holds cryptographic session state for reentrant secure channel operations.

Encapsulates all session-specific cryptographic material (Kenc, Kmac, rolling IV), allowing functions to be reentrant by passing session state as a parameter.

Examples
BasicUsage.ino, Connect.ino, Sign.ino, UsdcSigning.ino, and VerifyPin.ino.

Definition at line 168 of file CW_Defs.h.

Constructor & Destructor Documentation

◆ CW_SecureSession()

CW_SecureSession::CW_SecureSession ( )
inline

Zero-initialise all session keys and IV.

Definition at line 174 of file CW_Defs.h.

References aesKey, iv, and macKey.

Member Function Documentation

◆ clear()

void CW_SecureSession::clear ( )
inline

Securely clear all session keys and IV.

Definition at line 181 of file CW_Defs.h.

References aesKey, iv, macKey, and CW_Utils::secure_wipe().

Referenced by CW_SecureChannel::aesCbcEncrypt(), CryptnoxWallet::connect(), CryptnoxWallet::disconnect(), and CW_SecureChannel::mutuallyAuthenticate().

Member Data Documentation

◆ aesKey

uint8_t CW_SecureSession::aesKey[CW_AESKEY_SIZE]

◆ iv

uint8_t CW_SecureSession::iv[CW_IV_SIZE]

Current AES-CBC IV (rolling IV)

Definition at line 171 of file CW_Defs.h.

Referenced by CW_SecureChannel::aesCbcEncrypt(), clear(), CW_SecureSession(), and CW_SecureChannel::mutuallyAuthenticate().

◆ macKey

uint8_t CW_SecureSession::macKey[CW_MACKEY_SIZE]

The documentation for this struct was generated from the following file: