ATECC508A

CircleCIHex version

The ATECC508A Crypto Authentication (or the newer ATECC608A) is the main component of the NervesKey. If your device needs to authenticate with NervesHub or another cloud service using client-side SSL, this library could be of interest. The higher level NervesKey package will likely make more sense and you're recommended to start there.

Installation

The package can be installed by adding atecc508a to your list of dependencies in mix.exs:

def deps do
[
{:atecc508a, "~> 0.1.0"}
]
end

Documentation can be found at https://hexdocs.pm/atecc508a.

Device configuration

See Table 2-5 in the ATECC508A data sheet for documentation on the configuration zone. This software expects the following configuration to be programmed (unspecified bytes are either not programmable or kept as their defaults):

BytesNameValueDescription
14I2C_Enable01I2C mode
16I2C_AddressC0I2C address of the module (default)
18OTPmodeAAOTP is in read-only mode
19ChipMode00Default mode
20-51SlotConfigN/ASee the next table
92-95X509Format00..00Unused
96-127KeyConfigN/ASee next table

The slots will be programmed as follows. This definition is organized to be similar to the Microchip Standard TLS Configuration for the used slots to minimize changes to software. Unused slots are configured so that applications can use them as they would an EEPROM.

SlotDescriptionSlotConfigKeyConfigPrimary properties
0Device private key87 2033 00Private key, read only; lockable
1Unused0F 0F1C 00Clear read/write; not lockable
2Unused0F 0F1C 00Clear read/write; not lockable
3Unused0F 0F1C 00Clear read/write; not lockable
4Unused0F 0F1C 00Clear read/write; not lockable
5Unused0F 0F1C 00Clear read/write; not lockable
6Unused0F 0F1C 00Clear read/write; not lockable
7Unused0F 0F1C 00Clear read/write; not lockable
8Unused0F 0F3C 00Clear read/write; lockable
9Unused0F 0F3C 00Clear read/write; lockable
10Device certificate0F 2F3C 00Clear read only; lockable
11Signer public key0F 2F30 00P256; Clear read only; lockable
12Signer certificate0F 2F3C 00Clear read only; lockable
13Signer serial number+0F 2F3C 00Clear read only; lockable
14Unused0F 0F3C 00Clear read/write; lockable
15Unused0F 0F3C 00Clear read/write; lockable

The ATECC508A includes a 64 byte OTP (one-time programmable) memory. It has the following layout:

BytesNameContents
0-3Magic4e 72 76 73
4-5FlagsTBD. Set to 0
6-15Board name10 byte name for the board in ASCII (set unused bytes to 0)
16-31Mfg serial number16 byte manufacturer-assigned serial number in ASCII (set unused bytes to 0)
32-63UserThese are unassigned