コード例 #1
0
def test_kem(kem_name):
    if not (helpers.is_kem_enabled_by_name(kem_name)):
        pytest.skip('Not enabled')

    helpers.run_subprocess([
        "qemu-" + platform.machine() + "-static", "-cpu", MINCPU,
        helpers.path_to_executable('test_kem'), kem_name
    ])
コード例 #2
0
ファイル: test_mem.py プロジェクト: Yarkane/Quantumnet
def test_kem(kem_name):
    if not (helpers.is_kem_enabled_by_name(kem_name)):
        pytest.skip('Not enabled')

    Path('build/mem-benchmark').mkdir(parents=True, exist_ok=True)

    for i in range(3):
        helpers.run_subprocess(
            [helpers.path_to_executable('test_kem_mem'), kem_name,
             str(i)])
コード例 #3
0
def test_kem(kem_name):
    if not (helpers.is_build_portable()):
        pytest.skip("Portability not enabled")

    if not (helpers.is_kem_enabled_by_name(kem_name)):
        pytest.skip('Not enabled')

    helpers.run_subprocess([
        "qemu-" + platform.machine(), "-cpu", MIN_CPUS[platform.machine()],
        helpers.path_to_executable('test_kem'), kem_name
    ])
コード例 #4
0
ファイル: test_kat.py プロジェクト: gudengxia/liboqs_ccac
def test_kem(kem_name):
    kats = helpers.get_kats("kem")
    if kem_name.startswith('SIDH'): pytest.skip('KATs not available for SIDH')
    if not (helpers.is_kem_enabled_by_name(kem_name)):
        pytest.skip('Not enabled')
    output = helpers.run_subprocess(
        [helpers.path_to_executable('kat_kem'), kem_name], )
    output = output.replace("\r\n", "\n")
    h256 = sha256()
    h256.update(output.encode())

    assert (kats[kem_name] == h256.hexdigest())
コード例 #5
0
ファイル: test_kat.py プロジェクト: terrynema04/liboqs
def test_kem(kem_name):
    if kem_name.startswith('SIDH'): pytest.skip('KATs not available for SIDH')
    if not(helpers.is_kem_enabled_by_name(kem_name)): pytest.skip('Not enabled')
    output = helpers.run_subprocess(
        [helpers.path_to_executable('kat_kem'), kem_name],
    )
    output = output.replace("\r\n", "\n")
    kats = []
    for filename in os.listdir(os.path.join('tests', 'KATs', 'kem')):
        if filename.startswith(kem_name + '.') and filename.endswith('.kat'):
            with open(os.path.join('tests', 'KATs', 'kem', filename), 'r') as myfile:
                kats.append(myfile.read())
    assert(output in kats)
コード例 #6
0
ファイル: test_cmdline.py プロジェクト: gudengxia/liboqs_ccac
def test_kem(kem_name):
    if not(helpers.is_kem_enabled_by_name(kem_name)): pytest.skip('Not enabled')
    helpers.run_subprocess(
        [helpers.path_to_executable('test_kem'), kem_name],
    )