fn retries_remaining(count: u32, batch_size: u8) -> u8Expand description
Compute how many CheckMac attempts remain before the next batch
threshold is hit.
batch_size is PIN_MAX_RETRIES for PIN, PUK_MAX_RETRIES for PUK.
The convention is that refresh_counter_batch is called on every
successful verify to push count to a non-multiple-of-batch value
(specifically, next_multiple + 1). So in normal operation:
count == 0: freshly-provisioned chip, no verify attempted yet,batch_sizeattempts remain.count % batch == 1: freshly refreshed after a successful verify,batch_size - 1attempts remain in the current batch.count % batch == rin2..batch:batch_size - rattempts remain.count % batch == 0withcount > 0: SATURATION. The user has consumed a full batch with no successful verify in between. Returns 0 attempts.