Chip ID

The ChipId class parses and provides access to chip identification information from the TROPIC01 secure element.

class tropicsquare.chip_id.ChipId(data)[source]

Bases: object

TROPC01 Chip ID structure parser

This class parses the 128-byte chip identification structure that contains comprehensive information about the chip including manufacturing data, provisioning information, firmware versions, and serial number.

The structure follows the lt_chip_id_t layout from libtropic with all fields properly parsed and exposed as attributes.

Structure layout (128 bytes total):

  • Bytes 0-3: Chip ID version (4 bytes)

  • Bytes 4-19: Factory level chip info (16 bytes)

  • Bytes 20-27: Functional test info (8 bytes)

  • Bytes 28-31: Silicon revision (4 bytes, ASCII)

  • Bytes 32-33: Package type ID (2 bytes, big-endian)

  • Bytes 34-35: Reserved field 1 (2 bytes)

  • Bytes 36-39: Provisioning info - version/fab/part number (4 bytes, big-endian)

  • Bytes 40-41: Provisioning date (2 bytes, big-endian)

  • Bytes 42-45: HSM version (4 bytes)

  • Bytes 46-49: Program version (4 bytes)

  • Bytes 50-51: Reserved field 2 (2 bytes)

  • Bytes 52-67: Serial number structure (16 bytes)

  • Bytes 68-83: Part number data (16 bytes)

  • Bytes 84-85: Provisioning template version (2 bytes, big-endian)

  • Bytes 86-89: Provisioning template tag (4 bytes)

  • Bytes 90-91: Provisioning specification version (2 bytes, big-endian)

  • Bytes 92-95: Provisioning specification tag (4 bytes)

  • Bytes 96-100: Batch ID (5 bytes)

  • Bytes 101-103: Reserved field 3 (3 bytes)

  • Bytes 104-127: Reserved field 4 / Padding (24 bytes)

Parameters:

data (bytes)

raw

Original raw chip ID data (128 bytes)

Type:

bytes

chip_id_version

Chip ID version as 4-element tuple

Type:

tuple

fl_chip_info

Factory level chip information (16 bytes)

Type:

bytes

func_test_info

Functional test information (8 bytes)

Type:

bytes

silicon_rev

Silicon revision (ASCII string, null-terminated)

Type:

str

package_type_id

Package type identifier

Type:

int

package_type_name

Human-readable package type name

Type:

str

provisioning_version

Provisioning version number (8-bit)

Type:

int

fab_id

Fabrication facility ID (12-bit)

Type:

int

fab_name

Human-readable fabrication facility name

Type:

str

part_number_id

Part number identifier (12-bit)

Type:

int

provisioning_date

Provisioning date value

Type:

int

hsm_version

HSM version as 4-element tuple

Type:

tuple

prog_version

Program version as 4-element tuple

Type:

tuple

serial_number

Parsed serial number structure

Type:

SerialNumber

part_num_data

Part number data (16 bytes)

Type:

bytes

prov_template_version

Provisioning template version

Type:

int

prov_template_tag

Provisioning template tag (4 bytes)

Type:

bytes

prov_spec_version

Provisioning specification version

Type:

int

prov_spec_tag

Provisioning specification tag (4 bytes)

Type:

bytes

batch_id

Batch identifier (5 bytes)

Type:

bytes

__init__(data)[source]

Parse chip ID from raw bytes

Parameters:

data (bytes) – Raw chip ID bytes (must be exactly 128 bytes)

Raises:

ValueError – If data length is not 128 bytes

__str__()[source]

Get human-readable multi-line string representation

Returns:

Multi-line formatted string with key chip ID information

Return type:

str

__repr__()[source]

Get detailed string representation for debugging

Returns:

Detailed representation with class name

Return type:

str

to_dict()[source]

Convert chip ID to dictionary representation

Returns:

Dictionary containing all chip ID fields with nested serial number

Return type:

dict

Chip ID Structure

The chip ID contains:

  • Serial number - Unique chip identifier

  • Hardware revision - Chip hardware version

  • Firmware version - Chip firmware version

  • Manufacturing data - Additional manufacturing information

See Also