DS1961S
19 of 36
(TA1 and TA2), the DS1961S clears the EN_LFS flag. The lower five bits of the target address TA1 are
ignored because only the page number is relevant. If the target address as sent by the master is valid (i.e.,
in the range of 0000h and 007Fh), and the secret is not write-protected, the SHA engine starts. The master
must wait for t
CSHA
during which the new secret is computed. Immediately following the SHA delay, the
master must wait for t
PROG
during which the new secret is copied to the secret register. During the t
CSHA
and t
PROG
the voltage on the 1-Wire bus must not fall below 2.8V. The DS1961S fills the scratchpad with
AAh if the copy was successful, but does not modify the scratchpad if the SHA engine did not start
because of an incorrect address or because of write protection. The master should read at least one byte at
the conclusion of the copy delay. Reading AAh indicates that the copy was successful. Reading FFh
indicates that the copy was not successful because of an incorrect address or because of write protection.
Since the content of the scratchpad is used as a partial secret, the master must fill the scratchpad with a
known 8-byte data pattern using the write scratchpad command before it issues the compute next secret
command. Otherwise the new secret depends on data that was unintentionally left in the scratchpad from
previous commands.
Copy Scratchpad [55h]
The data memory of the DS1961S can be read without any restrictions. Executing the copy scratchpad
command to write new data to the memory or register page, however, requires the knowledge of the
device’s secret and the ability to perform an SHA-1 computation to generate the 160-bit MAC to start the
data transfer from the scratchpad to the memory. The master can perform the MAC computation in
software or use a DS1963S as a coprocessor. The coprocessor approach has the benefit that the secret
remains hidden in the coprocessor iButton. The sequence in which the resulting MAC needs to be sent to
the DS1961S is shown in Table 2. Tables 3A and 3B show how the various data components are entered
into the SHA engine. The SHA computation algorithm is explained later in this document.
Table 2. MESSAGE AUTHENTICATION CODE TRANSMISSION SEQUENCE
E[31:24] E[23:16] E[15:8] E[7:0]
D[31:24] D[23:16] D[15:8] D[7:0]
C[31:24] C[23:16] C[15:8] C[7:0]
B[31:24] B[23:16] B[15:8] B[7:0]
A[31:24] A[23:16] A[15:8] A[7:0]
The transmission is least significant bit first starting with register E.
After issuing the copy scratchpad command, the master must provide a 3-byte authorization pattern,
which should have been obtained by an immediately preceding read scratchpad command. This 3-byte
pattern must exactly match the data contained in the three address registers (TA1, TA2, E/S, in that
order). If the authorization code matches and the target memory is not write-protected, the DS1961S
starts its SHA engine to compute a 160-bit MAC that is based on the current secret, all of the scratchpad
data, the first 28 bytes of the addressed memory page, and the first seven bytes of the identity register (the
byte at address 0097h is not used; see Table 3A). The duration of this computation is t
CSHA
, during which
the voltage on the 1-Wire line must not drop below 2.8V. Simultaneously the master computes a MAC
from the same data and, after t
CSHA
is expired, sends it to the DS1961S as evidence that it is authorized to
write to the EEPROM. Now the master waits for t
PROG
during which the voltage on the 1-Wire bus must
Shift
Direction
DS1961S
20 of 36
not fall below 2.8V. If the MAC generated by the DS1961S matches the MAC that the master computed,
the DS1961S sets its AA flag, and copy the entire scratchpad contents to the data EEPROM. The master
should read at least one byte at the conclusion of the copy delay. Reading AAh indicates that the copy
was successful. Reading 00h indicates that the copy was not successful because the computed MAC did
not match the MAC sent by the master. Reading FFh indicates that the copy was not successful because
of write protection or because of an incorrect authorization pattern.
Table 3a. SHA-1 INPUT DATA FOR COPY SCRATCHPAD COMMAND WHEN
COPYING TO A DATA MEMORY PAGE
M0[31:24] = (SS + 0) M0[23:16] = (SS + 1) M0[15:8] = (SS + 2) M0[7:0] = (SS + 3)
M1[31:24] = (PP + 0) M1[23:16] = (PP + 1) M1[15:8] = (PP + 2) M1[7:0] = (PP + 3)
M2[31:24] = (PP + 4) M2[23:16] = (PP + 5) M2[15:8] = (PP + 6) M2[7:0] = (PP + 7)
M3[31:24] = (PP + 8) M3[23:16] = (PP + 9) M3[15:8] = (PP + 10) M3[7:0] = (PP + 11)
M4[31:24] = (PP + 12) M4[23:16] = (PP + 13) M4[15:8] = (PP + 14) M4[7:0] = (PP + 15)
M5[31:24] = (PP + 16) M5[23:16] = (PP + 17) M5[15:8] = (PP + 18) M5[7:0] = (PP + 19)
M6[31:24] = (PP + 20) M6[23:16] = (PP + 21) M6[15:8] = (PP + 22) M6[7:0] = (PP + 23)
M7[31:24] = (PP + 24) M7[23:16] = (PP + 25) M7[15:8] = (PP + 26) M7[7:0] = (PP + 27)
M8[31:24] = (SP + 0) M8[23:16] = (SP + 1) M8[15:8] = (SP + 2) M8[7:0] = (SP + 3)
M9[31:24] = (SP + 4) M9[23:16] = (S + 5) M9[15:8] = (SP + 6) M9[7:0] = (SP + 7)
M10[31:24] = MP M10[23:16] = (ID + 0) M10[15:8] = (ID + 1) M10[7:0] = (ID + 2)
M11[31:24] = (ID + 3) M11[23:16] = (ID + 4) M11[15:8] = (ID + 5) M11[7:0] = (ID + 6)
M12[31:24] = (SS + 4) M12[23:16] = (SS + 5) M12[15:8] = (SS + 6) M12[7:0] = (SS + 7)
M13[31:24] = FFh M13[23:16] = FFh M13[15:8] = FFh M13[7:0] = 80h
M14[31:24] = 00h M14[23:16] = 00h M14[15:8] = 00h M14[7:0] = 00h
M15[31:24] = 00h M15[23:16] = 00h M15[15:8] = 01h M15[7:0] = B8h
Legend
Mt Input Buffer of SHA Engine
0 £ t £ 15; 32-Bit Words
(SS + N) Byte N of Secret; Secret Begins at Address 0080h
(see Memory Map)
(PP + N) Byte N of Memory Page; Memory Pages Begin at
0000h, 0020h, 0040h and 0060h (see Memory Map)
(SP + N) Byte N of Scratchpad
MP
MP[7:3] = 00000b,
MP[2:0] = T7:T5
(ID + N) Byte N of Identity Register
The Last Byte of the Identity Register is Not Used.
Special attention is required when copying data to the register page. In order to prevent unintentional
locking of a special function register or user byte it is recommended to first read the register page and
then write it with all intended modifications to the scratchpad. When copying data to the register page (or
the secret using copy scratchpad), the input data for M1 to M7 of the SHA engine is the current secret
(M1, M2), the current content of the register page (M3, M4), the full content of the identity register (M5,
M6), and 4 bytes FFh (M7), as shown in Table 3B. As a consequence, when using a DS1963S as
coprocessor to compute the MAC to transfer data from the scratchpad to the register page, the secret must
be used as page data. This precludes the use of partial (computed) secrets if writing to the register page is
DS1961S
21 of 36
required. For practical use of the DS1961S as a monetary token, partial secrets are more critical than
being able to write-protect the secret or other areas of the device.
Table 3b. SHA-1 INPUT DATA FOR COPY SCRATCHPAD COMMAND WHEN
COPYING TO THE REGISTER PAGE OR SECRET
M0[31:24] = (SS + 0) M0[23:16] = (SS + 1) M0[15:8] = (SS + 2) M0[7:0] = (SS + 3)
M1[31:24] = (SS + 0) M1[23:16] = (SS + 1) M1[15:8] = (SS + 2) M1[7:0] = (SS + 3)
M2[31:24] = (SS + 4) M2[23:16] = (SS + 5) M2[15:8] = (SS + 6) M2[7:0] = (SS + 7)
M3[31:24] = (RP + 0) M3[23:16] = (RP + 1) M3[15:8] = (RP + 2) M3[7:0] = (RP + 3)
M4[31:24] = (RP + 4) M4[23:16] = (RP + 5) M4[15:8] = (RP + 6) M4[7:0] = (RP + 7)
M5[31:24] = (ID + 0) M5[23:16] = (ID + 1) M5[15:8] = (ID + 2) M5[7:0] = (ID + 3)
M6[31:24] = (ID + 4) M6[23:16] = (ID + 5) M6[15:8] = (ID + 6) M6[7:0] = (ID + 7)
M7[31:24] = FFh M7[23:16] = FFh M7[15:8] = FFh M7[7:0] = FFh
M8[31:24] = (SP + 0) M8[23:16] = (SP + 1) M8[15:8] = (SP + 2) M8[7:0] = (SP + 3)
M9[31:24] = (SP + 4) M9[23:16] = (SP + 5) M9[15:8] = (SP + 6) M9[7:0] = (SP + 7)
M10[31:24] = MP M10[23:16] = (ID + 0) M10[15:8] = (ID + 1) M10[7:0] = (ID + 2)
M11[31:24] = (ID + 3) M11[23:16] = (ID + 4) M11[15:8] = (ID + 5) M11[7:0] = (ID + 6)
M12[31:24] = (SS + 4) M12[23:16] = (SS + 5) M12[15:8] = (SS + 6) M12[7:0] = (SS + 7)
M13[31:24] = FFh M13[23:16] = FFh M13[15:8] = FFh M13[7:0] = 80h
M14[31:24] = 00h M14[23:16] = 00h M14[15:8] = 00h M14[7:0] = 00h
M15[31:24] = 00h M15[23:16] = 00h M15[15:8] = 01h M15[7:0] = B8h
Legend
Mt Input Buffer of SHA Engine
0 £ t £ 15; 32-Bit Words
(SS + N) Byte N of Secret; Secret Begins at Address 0080h
(see Memory Map)
(RP + N) Byte N of Register Page; Page Begins at 0088h
(see Memory Map)
(SP + N) Byte N of Scratchpad
MP
MP[7:0] = 04h
(ID + N) Byte N of Identity Register
Read Authenticated Page [A5h]
The read authenticated page command provides the master with the data of a full or partial memory page
plus a MAC. The MAC allows the master to determine whether the secret stored in the DS1961S is valid
within the application. The DS1961S computes the MAC from its secret, all the data of the selected
memory page, the first seven bytes of the identity register and a 3-byte challenge, which the master
should write to the scratchpad prior to issuing the read authenticated page command. To do this, the
master can use the write scratchpad command with any target address within the data memory. The
relevant portions of the challenge are the 5th, 6
th
, and 7th bytes. Alternatively, the master can accept the
data that happens to reside in the scratchpad from a previous command as a challenge. The 160-bit MAC
is transmitted in the same way as with the copy scratchpad command, Table 2, but the data flows from the
DS1961S to the master. The data input to the SHA engine as it applies to the read authenticated page
command is shown in Table 4.

DS1961S-F5+

Mfr. #:
Manufacturer:
Maxim Integrated
Description:
iButtons & Accessories 1kb Protected EEPROM iButton w/SHA-1 Eng
Lifecycle:
New from this manufacturer.
Delivery:
DHL FedEx Ups TNT EMS
Payment:
T/T Paypal Visa MoneyGram Western Union

Products related to this Datasheet