1# This file is dual licensed under the terms of the Apache License, Version 2# 2.0, and the BSD License. See the LICENSE file in the root of this repository 3# for complete details. 4 5from __future__ import absolute_import, division, print_function 6 7import pytest 8 9from cryptography.hazmat.backends.interfaces import PBKDF2HMACBackend 10from cryptography.hazmat.primitives import hashes 11 12from .utils import generate_pbkdf2_test 13from ...utils import load_nist_vectors 14 15 16@pytest.mark.supported( 17 only_if=lambda backend: backend.pbkdf2_hmac_supported(hashes.SHA1()), 18 skip_message="Does not support SHA1 for PBKDF2HMAC", 19) 20@pytest.mark.requires_backend_interface(interface=PBKDF2HMACBackend) 21class TestPBKDF2HMACSHA1(object): 22 test_pbkdf2_sha1 = generate_pbkdf2_test( 23 load_nist_vectors, 24 "KDF", 25 ["rfc-6070-PBKDF2-SHA1.txt"], 26 hashes.SHA1(), 27 ) 28