Exemple #1
0
def test_generate_cmpa(data_dir):
    config = json.loads(read_file(data_dir, 'cmpa_96mhz.json'))
    binary = read_file(data_dir, 'CMPA_96MHz.bin', 'rb')
    key = load_pem_private_key(read_file(data_dir,
                                         'selfsign_privatekey_rsa2048.pem',
                                         'rb'),
                               password=None,
                               backend=default_backend())

    cmpa = CMPA('lpc55xx', keys=[key.public_key()], user_config=config)
    assert binary == cmpa.export(add_hash=False, compute_inverses=True)
Exemple #2
0
def test_basic_cmpa():
    cmpa = CMPA('lpc55xx')
    with pytest.raises(AssertionError):
        cmpa.export()