aboutsummaryrefslogtreecommitdiffstats
path: root/tests/hazmat
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2013-11-24 11:03:53 -0600
committerPaul Kehrer <paul.l.kehrer@gmail.com>2013-11-29 17:19:46 -0600
commitbc31fb22979df3f034ce286fab20da71be76fe58 (patch)
tree899fcd653e542d7f18f7bdb6e1c9587caccab37c /tests/hazmat
parent2631c2b7be22f15f83810df1b8664bf388ad02a6 (diff)
downloadcryptography-bc31fb22979df3f034ce286fab20da71be76fe58.tar.gz
cryptography-bc31fb22979df3f034ce286fab20da71be76fe58.tar.bz2
cryptography-bc31fb22979df3f034ce286fab20da71be76fe58.zip
rename add_data to authenticate_additional_data for clarity (hopefully)
Diffstat (limited to 'tests/hazmat')
-rw-r--r--tests/hazmat/primitives/utils.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/hazmat/primitives/utils.py b/tests/hazmat/primitives/utils.py
index 39f5ae82..b6f9e0f5 100644
--- a/tests/hazmat/primitives/utils.py
+++ b/tests/hazmat/primitives/utils.py
@@ -93,7 +93,7 @@ def aead_test(backend, cipher_factory, mode_factory, params, only_if,
backend
)
decryptor = cipher.decryptor()
- decryptor.add_data(binascii.unhexlify(aad))
+ decryptor.authenticate_additional_data(binascii.unhexlify(aad))
actual_plaintext = decryptor.update(binascii.unhexlify(ciphertext))
with pytest.raises(InvalidTag):
decryptor.finalize()
@@ -104,7 +104,7 @@ def aead_test(backend, cipher_factory, mode_factory, params, only_if,
backend
)
encryptor = cipher.encryptor()
- encryptor.add_data(binascii.unhexlify(aad))
+ encryptor.authenticate_additional_data(binascii.unhexlify(aad))
actual_ciphertext = encryptor.update(binascii.unhexlify(plaintext))
actual_ciphertext += encryptor.finalize()
tag_len = len(params["tag"])
@@ -116,7 +116,7 @@ def aead_test(backend, cipher_factory, mode_factory, params, only_if,
backend
)
decryptor = cipher.decryptor()
- decryptor.add_data(binascii.unhexlify(aad))
+ decryptor.authenticate_additional_data(binascii.unhexlify(aad))
actual_plaintext = decryptor.update(binascii.unhexlify(ciphertext))
actual_plaintext += decryptor.finalize()
assert actual_plaintext == binascii.unhexlify(plaintext)
@@ -336,10 +336,10 @@ def aead_exception_test(backend, cipher_factory, mode_factory,
with pytest.raises(NotYetFinalized):
encryptor.tag
with pytest.raises(AlreadyUpdated):
- encryptor.add_data(b"b" * 16)
+ encryptor.authenticate_additional_data(b"b" * 16)
encryptor.finalize()
with pytest.raises(AlreadyFinalized):
- encryptor.add_data(b"b" * 16)
+ encryptor.authenticate_additional_data(b"b" * 16)
with pytest.raises(AlreadyFinalized):
encryptor.update(b"b" * 16)
with pytest.raises(AlreadyFinalized):