Skip to main content

Module counter

Module counter 

Source
Expand description

Counter command.

Reads or increments one of the chip’s two 21-bit monotonic counters (Counter0 and Counter1). Counters never decrease and cannot be reset once the data zone is locked.

In this project’s slot model:

  • Counter0 backs Slot 5 (PIN hash). It is bumped by 1 on every CheckMac against slot 5, with the convention that the driver rounds the counter up to the next multiple of 5 on successful verification so the user always gets a fresh batch of 5 attempts.
  • Counter1 backs Slot 6 (PUK hash). Same mechanism with batches of 10.

Reference: CryptoAuthLib lib/calib/calib_counter.c, constants COUNTER_MODE_READ (0x00), COUNTER_MODE_INCREMENT (0x01).

Enums§

CounterId
One of the chip’s two monotonic counters.

Constants§

COUNTER_MODE_INCREMENT 🔒
param1 mode bits: increment the counter by 1, then return the new value.
COUNTER_MODE_READ 🔒
param1 mode bits: read the counter without modifying it.