aboutsummaryrefslogtreecommitdiffstats
path: root/docs/hazmat/primitives
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 /docs/hazmat/primitives
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 'docs/hazmat/primitives')
-rw-r--r--docs/hazmat/primitives/symmetric-encryption.rst16
1 files changed, 8 insertions, 8 deletions
diff --git a/docs/hazmat/primitives/symmetric-encryption.rst b/docs/hazmat/primitives/symmetric-encryption.rst
index 3ed8c9e2..d123d15c 100644
--- a/docs/hazmat/primitives/symmetric-encryption.rst
+++ b/docs/hazmat/primitives/symmetric-encryption.rst
@@ -123,13 +123,13 @@ an "encrypt-then-MAC" formulation as `described by Colin Percival`_.
When calling ``encryptor()`` or ``decryptor()`` on a ``Cipher`` object
with an AEAD mode you will receive a return object conforming to the
``AEADCipherContext`` interface, in addition to the ``CipherContext``
- interface. ``AEADCipherContext`` contains an additional method ``add_data``
- for adding additional authenticated by non-encrypted data. You should call
- this before calls to ``update``. When you are done call ``finalize()`` to
- finish the operation. Once this is complete you can obtain the tag value
- from the ``tag`` property.
+ interface. ``AEADCipherContext`` contains an additional method
+ ``authenticate_additional_data`` for adding additional authenticated but
+ unencrypted data. You should call this before calls to ``update``. When you
+ are done call ``finalize()`` to finish the operation. Once this is complete
+ you can obtain the tag value from the ``tag`` property.
- .. method:: add_data(data)
+ .. method:: authenticate_additional_data(data)
:param bytes data: The data you wish to authenticate but not encrypt.
:raises: :class:`~cryptography.exceptions.AlreadyFinalized`
@@ -339,12 +339,12 @@ Modes
>>> from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
>>> cipher = Cipher(algorithms.AES(key), modes.GCM(iv))
>>> encryptor = cipher.encryptor()
- >>> encryptor.add_data(b"authenticated but not encrypted payload")
+ >>> encryptor.authenticate_additional_data(b"authenticated but not encrypted payload")
>>> ct = encryptor.update(b"a secret message") + encryptor.finalize()
>>> tag = encryptor.tag
>>> cipher = Cipher(algorithms.AES(key), modes.GCM(iv, tag))
>>> decryptor = cipher.decryptor()
- >>> decryptor.add_data(b"authenticated but not encrypted payload")
+ >>> decryptor.authenticate_additional_data(b"authenticated but not encrypted payload")
>>> decryptor.update(ct) + decryptor.finalize()
'a secret message'