diff options
author | Alex Stapleton <alexs@prol.etari.at> | 2014-05-10 10:28:17 +0100 |
---|---|---|
committer | Alex Stapleton <alexs@prol.etari.at> | 2014-05-10 10:28:17 +0100 |
commit | 9263d5ff5e62ce4adf5d959fecb3b1115f8216cc (patch) | |
tree | de0d349e8d55b1bdbd84b6b0e0b1877e6c481922 /tests/hazmat/primitives/utils.py | |
parent | 92da8bb65913f366656c104ef95c44c9931eaf32 (diff) | |
parent | c48100a9126990552197b5431d22f7a9e065baf7 (diff) | |
download | cryptography-9263d5ff5e62ce4adf5d959fecb3b1115f8216cc.tar.gz cryptography-9263d5ff5e62ce4adf5d959fecb3b1115f8216cc.tar.bz2 cryptography-9263d5ff5e62ce4adf5d959fecb3b1115f8216cc.zip |
Merge pull request #1016 from Ayrx/hkdf-expand-only
HKDF Expand Only implementation
Diffstat (limited to 'tests/hazmat/primitives/utils.py')
-rw-r--r-- | tests/hazmat/primitives/utils.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/tests/hazmat/primitives/utils.py b/tests/hazmat/primitives/utils.py index 6c3f4c95..a496459b 100644 --- a/tests/hazmat/primitives/utils.py +++ b/tests/hazmat/primitives/utils.py @@ -26,7 +26,7 @@ from cryptography.exceptions import ( from cryptography.hazmat.primitives import hashes, hmac from cryptography.hazmat.primitives.asymmetric import rsa from cryptography.hazmat.primitives.ciphers import Cipher -from cryptography.hazmat.primitives.kdf.hkdf import HKDF +from cryptography.hazmat.primitives.kdf.hkdf import HKDF, HKDFExpand from cryptography.hazmat.primitives.kdf.pbkdf2 import PBKDF2HMAC from ...utils import load_vectors_from_file @@ -347,15 +347,14 @@ def hkdf_extract_test(backend, algorithm, params): def hkdf_expand_test(backend, algorithm, params): - hkdf = HKDF( + hkdf = HKDFExpand( algorithm, int(params["l"]), - salt=binascii.unhexlify(params["salt"]) or None, info=binascii.unhexlify(params["info"]) or None, backend=backend ) - okm = hkdf._expand(binascii.unhexlify(params["prk"])) + okm = hkdf.derive(binascii.unhexlify(params["prk"])) assert okm == binascii.unhexlify(params["okm"]) |