Answer to reset

from Wikipedia, the free encyclopedia

Answer to Reset ( ATR ) is the first piece of information that a smart card transmits to a smart card reader in contact-based communication after the reader has reset the card. Put simply, the ATR is a series of parameters with which the smart card tells the smart card reader how to communicate with it.

content

The content of the ATR is specified in the chip card specifications ISO 7816-3 and depends on the capabilities of the chip hardware ( UART ) and the protocol implementation of the chip card operating system . Chip card manufacturers can use the communication parameters in the ATR to influence and optimize the communication behavior of the chip card and the terminal, in particular the communication speed. The processing speed of a chip card therefore depends to a large extent on the capabilities of the chip card reader used.

The ATR of a chip card is also often used by host software to recognize its type and thus to select the necessary middleware for accessing the card. The ATRs of cards can be found in the Windows registry in order to reference the correct Cryptographic Service Provider (CSP). When installing a new CSP, the ATRs of the supported cards are entered in the registry.

Cold and warm reset

Chip cards can issue different ATRs depending on the type of reset used by the terminal. If the card starts by applying the supply voltage and releasing the reset line, it is referred to as a power-on reset or cold reset . In contrast to this, a warm reset or soft reset is a signal on the reset line of the contact surfaces of the chip card during operation. The card can return different ATRs depending on the type of reset or even the number of warm resets .

This behavior makes it possible to achieve greater compatibility between the chip card reader and the chip card. If a chip card reader does not support the parameters of the ATR after the power-on reset , it can send a signal on the reset line and, depending on the card implementation, receives a changed ATR. If the reader supports the parameters of the changed ATR, communication between card and reader is established. If the chip card reader does not perform the warm reset or does not support the parameters of the changed ATRs, communication is not possible and the card reader cannot be used with this card.

structure

The ATR is a series of bytes. The first two bytes, TS and T0, are mandatory. All others are optional and are announced by information in the preceding bytes (T0 and TDx).

TS T0 TA1 TB1 TC1 TD1 TA2 TB2 TC2 TD2 TA3 TB3 TC3 TD3 TA4 TB4 TC4 TD4 Historical characters TCK

The following data types can be distinguished in the ATR:

Data element Designation meaning
TS The initial character Byte with which communication is started.
T0 The Format Character This byte indicates the number of historical characters and the presence of the interface characters TA1, TB1, TC1 and TD1 in the ATR.
TA1, TB1, TC1, TD1 ... The Interface Characters These bytes indicate communication parameters. The four most significant bits of the byte TDx each indicate the presence of the bytes TAx + 1, TBx + 1, TCx + 1 and TDx + 1.
T1, T2 ... The Historical Characters The historical characters are a chain of a maximum of 15 bytes, the content of which is not defined.
TCK The Check Character XOR checksum over all ATR bytes, starting from byte T0 to the last byte for TCK.

The initial character TS

This byte shows the so-called convention , i. H. the convention of bit and byte transfer that the card uses.

  • The direct convention ( Direct convention ) transmits a bit 1 with a high (high) level, and a bit 0 to a low (low) level on the I / O line. The bits of the byte to be transmitted are transmitted in ascending order, starting with the least significant bit. The initial character for the direct convention is set to '3B'.
  • The Inverse convention works with the opposite level, i. H. a bit 1 is transmitted with a low (low) level and a bit 0 with a high (high) level. In contrast to the direct convention, the data byte is transmitted in descending order from the most significant bit. The initial character for the indirect convention is '3F'.

The convention specified with the initial character applies to all communication between the chip card and the chip card reader. The initial character is chosen for both conventions so that the level of the start bit and the first two transmitted bits of the initial character are identical. This enables the chip card reader to recognize the correct start of the ATR and to calculate the transmission speed selected by the card based on the edges of the start bit and the third transmitted data bit (time interval between the edges / 3). Since the transmission speed for the ATR is specified in ISO 7816-3, many readers dispense with this calculation.

The format character T0

The format character contains two pieces of information:

  1. Specification via the following interface characters TA1, TB1, TC1 and TD1 in the four most significant bits.
  2. Number of historical characters in the ATR in the lower four bits. The number is therefore between 0 and 15.
bit meaning
b8 Indicates the transmission of the TD1 byte (1 = TD1 available, 0 = TD1 not available)
b7 Indicates the transfer of the TC1 byte (1 = TC1 available, 0 = TC1 not available)
b6 Indicates the transfer of the TB1 byte (1 = TB1 available, 0 = TB1 not available)
b5 Indicates the transfer of the TA1 byte (1 = TA1 available, 0 = TA1 not available)
b4 Number of historical characters (0 to 15)
b3
b2
b1

The interface characters

The interface characters contain either

  • global parameters for all protocols or
  • protocol-specific parameters

Global interface character TA1

The divider and the transfer factor are specified in the interface character TA1:

bit meaning
b8 Divider FI
b7
b6
b5
b4 Transmission adjustment factor DI
b3
b2
b1

The value FI defines a factor (F) and also the maximum permissible clock frequency (f max) of the chip card. The following table shows the possible values ​​for FI:

FI Value F f max [MHz]
0000 372 (default) 4th
0001 372 5
0010 558 6th
0011 744 8th
0100 1116 12
0101 1488 16
0110 1860 20th
0111 reserved for future use
1000 reserved for future use
1001 512 5
1010 768 7.5
1011 1024 10
1100 1536 15th
1101 2048 20th
1110 reserved for future use
1111 reserved for future use

For DI the coding is as follows:

DI Value D
0000 reserved for future use
0001 1 (default)
0010 2
0011 4th
0100 8th
0101 16
0110 32
0111 64
1000 12
1001 20th
1010 reserved for future use
1011 reserved for future use
1100 reserved for future use
1101 reserved for future use
1110 reserved for future use
1111 reserved for future use

With the divider F and the transmission adjustment factor D, the duration of a bit ETU (Elementary Time Unit) can be calculated, where f is the frequency of the clock applied to the chip card:

Global Interface Character TB1

Interface Character TB1 indicates the maximum power consumption and the required voltage for programming the EEPROM , which must be made available by the chip card reader via the contact surface Vpp. Since modern chip cards generate the programming voltage from the normal power supply via built-in charge pumps, the TB1 is usually no longer specified in the ATR.

The following table shows the coding of the TB1:

bit meaning
b8 Always 0
b7 Maximum required current II
b6
b5 Required programming voltage PI1
b4
b3
b2
b1

The following values ​​are defined for PI1:

PI1 meaning
0 The contact area Vpp is not connected to the chip. No programming voltage is required.
1 to 4 reserved for future use
5 to 25 Programming voltage in volts (5 volts is standard)
26 to 31 reserved for future use

The maximum current required results from II using the following table:

II required current in mA
00 25 mA
01 50 mA (default)
10 reserved for future use
11 reserved for future use

Global interface character TC1

This parameter indicates the "extra guard time" ( an extra guard time ) as an integer value N to. This value defines the number of ETUs between the edges of two consecutive byte transfers with the following formula:

The only exception is the value 255, which indicates the minimum protection time that is

  • 12 ETU for the transmission protocol T = 0 and
  • 11 ETU for the transmission protocol T = 1.

Interface Character TDx

TD1, TD2, TD3 and TD4 each contain two pieces of information:

  1. Specification via the following interface characters TAx + 1, TBx + 1, TCx + 1 and TDx + 1 in a bit field in the higher-order nibble (i.e. in the higher four bits).
  2. The transmission protocol used by the chip card.

The exact structure is shown in the following table:

bit meaning
b8 Indicates the transmission of the TDx + 1 byte (1 = TDx + 1 available, 0 = TDx + 1 not available)
b7 Indicates the transmission of the TCx + 1 byte (1 = TCx + 1 available, 0 = TCx + 1 not available)
b6 Indicates the transfer of the TBx + 1 byte (1 = TBx + 1 available, 0 = TBx + 1 not available)
b5 Indicates the transmission of the TAx + 1 byte (1 = TAx + 1 available, 0 = TAx + 1 not available)
b4 Protocol type T
b3
b2
b1

The following values ​​are specified for the protocol type:

Protocol T meaning
T = 0 Byte-oriented, asynchronous half-duplex transmission protocol, defined in the ISO 7816-3 standard, Chapter 8
T = 1 Block-oriented, asynchronous half-duplex transmission protocol, defined in the ISO 7816-3 standard, Chapter 9
T = 2 and T = 3 Reserved for future full-duplex transmission protocols
T = 4 Reserved for an extended asynchronous half-duplex transmission protocol
T = 5 to T = 13 Reserved for future use
T = 14 Reserved for national transmission protocols. Used in Germany for a block-oriented, asynchronous half-duplex transmission protocol.
T = 15 Global interface parameters without reference to a special transmission protocol

Global Interface Character TB2

Interface character TB2 contains the 8-bit value PI2. It can be used as an alternative to PI1 in the Interface Character TB1 in order to specify the programming voltage very precisely. PI2 indicates the value of the required programming voltage in tenths of a volt.

Since modern chip cards generate the programming voltage from the normal power supply via built-in charge pumps, the TB1 is usually no longer specified in the ATR.

Protocol-specific interface character TC2

TC2 is a data element for the protocol T = 0 and specifies the so-called work waiting time . This value specifies the maximum time between the start edge of each byte sent by the card and the start edge of the previous byte sent. The default value for the work waiting time is 10.

The historical characters

The content of the historical characters is specified in ISO 7816-4 and coded in Compressed TLV (Tag 4Xh and length 0–15 in one byte, followed by the value). They are used for various information, such as the version of the operating system and the capabilities of the card.

Often, instead of compressed TLV-coded data objects, a (non-ISO 7816-4-compliant), pure ASCII character string can be found.

The Check Character TCK

The check character is an XOR checksum from byte T0 to the byte before the check character . In addition to checking the transmission protocol, it can be used to check the correctness of the ATR.

The check character must not be sent with the ATR if only the T = 0 protocol is supported in the ATR. If the protocol T = 1 is used, the check character must be transmitted with the ATR.

See also

Web links