How to use the cryptoauthlib.constant.INFO_MODE_REVISION function in cryptoauthlib

To help you get started, we’ve selected a few cryptoauthlib examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github dmazzella / ucryptoauthlib / tests / ateccX08a / tests_info.py View on Github external
def run(device=None):
    if not device:
        raise ValueError("device")

    expected = {
        "ATECC508A": b'\x07\x00\x00P\x00\x03\x91',
        "ATECC608A": b'\x07\x00\x00`\x02\x808'
    }
    packet = device.atcab_info()
    assert packet.response_data == expected[device.device], hexlify(packet.response_data)
    log.debug("atcab_info: %s", hexlify(packet.response_data))

    packet = device.atcab_info_base(INFO_MODE_REVISION)
    assert packet.response_data == expected[device.device], hexlify(packet.response_data)
    log.debug("atcab_info_base - revision: %s", hexlify(packet.response_data))

    expected = b'\x07\x00\x00\x00\x00\x03\xad'
    packet = device.atcab_info_base(INFO_MODE_STATE)
    assert expected == packet.response_data, hexlify(packet.response_data)
    log.debug("atcab_info_base - state: %s", hexlify(packet.response_data))
github dmazzella / ucryptoauthlib / tests / atecc508a / tests_info.py View on Github external
def run(atecc508a=None):
    if not atecc508a:
        atecc508a = ATECC508A()

    expected = b'\x07\x00\x00P\x00\x03\x91'
    packet = atecc508a.atcab_info()
    assert expected == packet.response_data
    log.debug("atcab_info: %s", hexlify(packet.response_data))

    packet = atecc508a.atcab_info_base(INFO_MODE_REVISION)
    assert expected == packet.response_data
    log.debug("atcab_info_base - revision: %s", hexlify(packet.response_data))

    expected = b'\x07\x00\x00\x00\x00\x03\xad'
    packet = atecc508a.atcab_info_base(INFO_MODE_STATE)
    assert expected == packet.response_data
    log.debug("atcab_info_base - state: %s", hexlify(packet.response_data))
github dmazzella / ucryptoauthlib / cryptoauthlib / basic.py View on Github external
def atcab_info(self):
        return self.atcab_info_base(ATCA_CONSTANTS.INFO_MODE_REVISION)