CryptoAuthLib v3.7.8
Microchip CryptoAuthentication Library
 
Loading...
Searching...
No Matches
cryptoauthlib.sha206_api Namespace Reference

Functions

def sha206a_generate_derive_key (parent_key, derived_key, param1, param2)
 
def sha206a_generate_challenge_response_pair (key, challenge, response)
 
def sha206a_authenticate (challenge, expected_response, is_verified)
 
def sha206a_write_data_store (slot, data, block, offset, length, lock_after_write)
 
def sha206a_read_data_store (slot, data, offset, length)
 
def sha206a_get_data_store_lock_status (slot, is_locked)
 
def sha206a_get_dk_update_count (dk_update_count)
 
def sha206a_get_pk_useflag_count (pk_avail_count)
 
def sha206a_get_dk_useflag_count (dk_avail_count)
 
def sha206a_check_pk_useflag_validity (is_consumed)
 
def sha206a_check_dk_useflag_validity (is_consumed)
 
def sha206a_verify_device_consumption (is_consumed)
 
def sha206a_diversify_parent_key (parent_key, diversified_key)
 

Detailed Description

SHA206 API: classes and functions for interacting with SHA206A device

Function Documentation

◆ sha206a_authenticate()

def cryptoauthlib.sha206_api.sha206a_authenticate (   challenge,
  expected_response,
  is_verified 
)
verifies the challenge and provided response using key in device

Args:
    challenge           Challenge to be used in the response calculations
                        (Expects bytearray of size 32)

    expected_response   Expected response from the device
                        (Expects bytearray of size 32)

    is_authenticated    result of expected of response and calcualted response
                        (AtcaReference expected)

Returns:
    Status Code

◆ sha206a_check_dk_useflag_validity()

def cryptoauthlib.sha206_api.sha206a_check_dk_useflag_validity (   is_consumed)
verifies Derived Key use flags for consumption

Args:
    is_consumed            indicates if derived key is available for consumption
                           (Expected AtcaReference)

Returns:
    Status Code

◆ sha206a_check_pk_useflag_validity()

def cryptoauthlib.sha206_api.sha206a_check_pk_useflag_validity (   is_consumed)
verifies Parent Key use flags for consumption

Args:
    is_consumed            indicates if parent key is available for consumption
                           (Expected AtcaReference)

Returns:
    Status Code

◆ sha206a_diversify_parent_key()

def cryptoauthlib.sha206_api.sha206a_diversify_parent_key (   parent_key,
  diversified_key 
)
Computes the diversified key based on the parent key provided and device serial number

Args:
    parent_key             parent key to be diversified (Expected bytearray of size 32)

    diversified_key        output diversified key is returned here
                           (Expected bytearray of size 32)
Returns:
    Status Code

◆ sha206a_generate_challenge_response_pair()

def cryptoauthlib.sha206_api.sha206a_generate_challenge_response_pair (   key,
  challenge,
  response 
)
Generates the response based on Key and Challenge provided

Args:
    key             input data contains device's key
                    (Expects bytearray of size 32)

    challenge       input data to be used in challenge response calculation
                    (Expects bytearray of size 32)

    response        output response is returned here
                    (Expects bytearray of size 32)

Returns:
    Status Code

◆ sha206a_generate_derive_key()

def cryptoauthlib.sha206_api.sha206a_generate_derive_key (   parent_key,
  derived_key,
  param1,
  param2 
)
Generates the derived key based on the parent key and other parameters provided

Args:
    parent_key      input data contains device's parent key
                    (Expects bytearray of size 32)

    derived key     output derived key is returned here
                    (Expects bytearray of size 32)

    param1          input data to be used in derive key calculation (int)

    param2          input data to be used in derive key calculation (int)

Returns:
    Status Code

◆ sha206a_get_data_store_lock_status()

def cryptoauthlib.sha206_api.sha206a_get_data_store_lock_status (   slot,
  is_locked 
)
Returns the lock status of the given data store

Args:
    slot               Slot number of the data store (int)

    is_locked          lock status of the data store slot
                       (Expected AtcaReference)

Returns:
    Status Code

◆ sha206a_get_dk_update_count()

def cryptoauthlib.sha206_api.sha206a_get_dk_update_count (   dk_update_count)
Read Derived Key slot update count. It will be wraps around 256

Args:
    dk_update_count       returns number of times the slot has been
                          updated with derived key (Expected AtcaReference)

Returns:
    Status Code

◆ sha206a_get_dk_useflag_count()

def cryptoauthlib.sha206_api.sha206a_get_dk_useflag_count (   dk_avail_count)
calculates available Derived Key use counts

Args:
    dk_avail_count        counts available bit's as 1 (int)

Returns:
    Status Code

◆ sha206a_get_pk_useflag_count()

def cryptoauthlib.sha206_api.sha206a_get_pk_useflag_count (   pk_avail_count)
calculates available Parent Key use counts

Args:
    pk_avail_count        counts available bit's as 1 (int)

Returns:
    Status Code

◆ sha206a_read_data_store()

def cryptoauthlib.sha206_api.sha206a_read_data_store (   slot,
  data,
  offset,
  length 
)
Read the data stored in Data store

Args:
    slot               Slot number to read from (int)

    data               Pointer that holds the data
                       (Expected bytearray of size 32)

    offset             Byte offset within the zone to read from. (int)

    length             data length (int)

Returns:
    Status Code

◆ sha206a_verify_device_consumption()

def cryptoauthlib.sha206_api.sha206a_verify_device_consumption (   is_consumed)
verifies the device is fully consumed or not based on Parent and Derived Key use flags.

Args:
    is_consumed            result of device consumption is returned here
                           (Expected AtcaReference)

Returns:
    Status Code

◆ sha206a_write_data_store()

def cryptoauthlib.sha206_api.sha206a_write_data_store (   slot,
  data,
  block,
  offset,
  length,
  lock_after_write 
)
Update the data store slot with user data and lock it if necessary

Args:
    slot               Slot number to be written with data (int)

    data               Pointer that holds the data
                       (Expected bytearray of size 32)

    block              32-byte block to write (int)

    offset             4-byte word within the specified block to write to. If
                       performing a 32-byte write, this should be 0. (int)

    length             data length (int)

    lock_after_write   set 1 to lock slot after write, otherwise 0
                       (Expected bool/int)

Returns:
    Status Code