Secret management function commands – Rainbow Electronics DS2778 User Manual

Page 33

Advertising
background image

DS2775/DS2776/DS2777/DS2778

2-Cell, Stand-Alone, Li+ Fuel-Gauge IC with

Protector and Optional SHA-1 Authentication

______________________________________________________________________________________

33

Challenge command. The host then issues the Compute
MAC or Compute MAC with ROM ID command. The
MAC is computed per FIPS 180, and then returned as a
160-bit serial stream, beginning with the LSb.

DS2776/DS2778 Authentication

Commands

Write Challenge [0Ch]

This command writes the 64-bit challenge to the
DS2776/DS2778. The LSB of the 64-bit data argument
can begin immediately after the MSB of the command
has been completed. If more than 8 bytes are written,
the final value in the Challenge register is indetermi-
nate. The Write Challenge command must be issued
prior to every Compute MAC or Compute Next Secret
command for reliable results.

Compute MAC without ROM ID [36h]

This command initiates an SHA-1 computation without
including the ROM ID in the message block. Because
the ROM ID is not used, this command allows the use
of a master secret and MAC response independent of
the ROM ID. The DS2776/DS2778 computes the MAC
in t

SHA

after receiving the last bit of this command.

After the MAC computation is complete, the host must
write eight write-zero time slots and then issue 160 read
time slots to receive the 20-byte MAC. See Figure 25 for
command timing.

Compute MAC with ROM ID [35h]

This command is structured the same as the Compute
MAC without ROM ID, except that the ROM ID is includ-
ed in the message block. With the ROM ID unique to
each DS2776/DS2778 included in the MAC computation,
use of a unique secret in each token and a master secret
in the host device is allowed. Refer to Application Note
1099:

White Paper 4: Glossary of 1-Wire SHA-1 Terms

for

more information. See Figure 25 for command timing.

Table 10 summarizes SHA-1-related commands used
while authenticating a battery or peripheral device. The

Secret Management Function Commands

section

describes four additional commands for clearing, com-
puting, and locking of the secret.

Secret Management Function

Commands

Table 11 summarizes all the secret management func-
tion commands.

Clear Secret [5Ah]

This command sets the 64-bit secret to all 0s (0000
0000 0000 0000h). The host must wait for t

EEC

for the

DS2776/DS2778 to write the new secret value to
EEPROM. See Figure 28 for command timing.

Compute Next Secret without

ROM ID [30h]

This command initiates an SHA-1 computation of the
MAC and uses a portion of the resulting MAC as the
next or new secret. The MAC computation is performed
with the current 64-bit secret and the 64-bit challenge.
Logical 1s are loaded in place of the ROM ID. The out-
put MAC’s 64 bits are used as the new secret value.
The host must allow t

SHA

after issuing this command for

the SHA calculation to complete, then wait t

EEC

for the

DS2776/DS2778 to write the new secret value to
EEPROM. See Figure 26 for command timing.

Compute Next Secret with ROM ID [33h]

This command initiates an SHA-1 computation of the
MAC and uses a portion of the resulting MAC as the
next or new secret. The MAC computation is performed
with the current 64-bit secret, the 64-bit ROM ID, and
the 64-bit challenge. The output MAC’s 64 bits are used
as the new secret value. The host must allow t

SHA

after

issuing this command for the SHA calculation to com-
plete, then wait t

EEC

for the DS2776/DS2778 to write

COMMAND

HEX

FUNCTION

Write Challenge

0Ch

Writes 64-bit challenge for SHA-1 processing. Required prior to issuing
Compute MAC and Compute Next Secret commands.

Compute MAC without ROM ID (and
Return MAC for the DS2776 only)

36h

Computes hash of the message block with logical 1s in place of the ROM
ID. (Returns the 160-bit MAC for the DS2776 only.)

Compute MAC with ROM ID (and Return
MAC for the DS2776 only)

35h

Computes hash of the message block including the ROM ID. (Returns the
160-bit MAC for the DS2776 only.)

Read ROM ID (DS2778 only)

39h

Returns the ROM ID (DS2778 only).

Read MAC (DS2778 only)

3Ah

Returns the 160-bit MAC (DS2778 only).

Table 10. Authentication Function Commands

Advertising