The host can authenticate the gauge using
the following steps:
1. Host reads MAC subcommand
0x0036 (GaugeAuthPublicKey) to receive the public key, and verifies it matches the expected
public key.
Note: Note on public key readback: The I2C MAC read interface
supports a maximum of 32 bytes per transaction. The P-256 public key is 33 bytes
and cannot be read back in full over I2C using standard MAC read commands. Contact TI for
the default production public key.
2. Host generates a random
challenge of at least 8 bytes (device supports 8–32 bytes), and sends the
challenge to the
gauge
using the I2C BlockData write sequence:
- Write MAC cmd 0x0000 to BlockDataCmd register 0x3E.
- Write challenge bytes (8–32 bytes) to BlockData register
0x40.
- Write the checksum byte to register 0x60, and the length byte to
register 0x61 in a single I2C write transaction.
- Length formula:
cmd(2) + data(N) + checksum(1) + length(1)
- Example for a 16-byte challenge:
2 + 16 + 1 + 1 = 20 (0x14)
- Checksum = bitwise NOT of the sum of all challenge bytes
plus both command bytes (cmd LSB + cmd MSB)
Note: Important: The firmware silently discards the write
if the checksum or length byte is incorrect — no error is returned and the ECC engine
does not fire. Verify the length byte accounts for all four components.
3. Host waits a recommended
100 ms delay, while the gauge signs the challenge and prepares the R and S signature
values.
4. Host reads the authentication
response from the
gauge
using one of the following I2C methods:
- Combined 64-byte read: Write cmd 0x0000 to BlockDataCmd
(0x3E), wait ≥10 ms, read 64 bytes from BlockData (0x40). Bytes 0–31
= R, bytes 32–63 = S.
- Separate R and S reads (recommended): Write cmd 0x003C to
BlockDataCmd (0x3E), read 32 bytes from 0x40 for R. Then write cmd 0x003D to 0x3E,
read 32 bytes from 0x40 for S. This method works regardless of the Split Response
configuration bit.
5. Host verifies the R and S
values form a valid ECDSA P-256 signature for the challenge using the gauge's public key.
The gauge signs the SHA-256 hash of the challenge bytes (not the raw challenge). R
and S are each 32 bytes, MSB-first.
Authentication Response Format
The gauge returns a 64-byte authentication
response (32 bytes R + 32 bytes S), MSB-first. The response format depends on the
Split Response configuration bit in the Authentication Configuration
register:
- Split Response Disabled (default):
Write cmd 0x0000 to BlockDataCmd (0x3E).
Read 64 bytes
from BlockData (0x40), returning all 64 bytes (32 bytes R
followed by 32 bytes S) in one transaction.
- Split Response Enabled: Two
separate reads are required:
- First read: write 0x0000 to
BlockDataCmd (0x3E),
read
32 bytes
from BlockData
(0x40) —
(R value)
- Second read: write 0x0000 to
BlockDataCmd (0x3E) again,
read
32 bytes
from BlockData
(0x40) —
(S value)
Note: If the combined 64-byte read returns incomplete data, verify
that the Split Response bit is disabled. When Split Response is enabled, the device
returns data in two sequential 32-byte reads from BlockData (0x40). Alternatively, use MAC
0x003C (ECC_R) and MAC 0x003D (ECC_S) which each return exactly 32 bytes and are
unaffected by the Split Response setting.