From 2824ab72d30e8423d17496e2c3baa47106505c8c Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Mon, 28 Oct 2013 11:06:55 -0500 Subject: make hmac (mostly) compatible with stdlib hmac --- docs/hazmat/primitives/hmac.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'docs') diff --git a/docs/hazmat/primitives/hmac.rst b/docs/hazmat/primitives/hmac.rst index 47b88030..76b7e24c 100644 --- a/docs/hazmat/primitives/hmac.rst +++ b/docs/hazmat/primitives/hmac.rst @@ -18,23 +18,23 @@ message authentication codes using a cryptographic hash function coupled with a secret key. You can use an HMAC to verify integrity as well as authenticate a message. -.. class:: cryptography.primitives.hmac.HMAC(key, hash_cls, data=None) +.. class:: cryptography.primitives.hmac.HMAC(key, msg=None, digestmod=None) HMAC objects take a ``key``, a hash class derived from :class:`~cryptography.primitives.hashes.BaseHash`, - and optional initial data. The ``key`` should be randomly generated bytes and + and optional msg. The ``key`` should be randomly generated bytes and the length of the ``block_size`` of the hash. You must keep the ``key`` secret. .. doctest:: >>> from cryptography.primitives import hashes, hmac - >>> h = hmac.HMAC(key, hashes.SHA256) + >>> h = hmac.HMAC(key, digestmod=hashes.SHA256) >>> h.update(b"message to hash") >>> h.hexdigest() '...' - .. method:: update(data) + .. method:: update(msg) - :param bytes data: The bytes you wish to hash. + :param bytes msg The bytes you wish to hash. .. method:: copy() -- cgit v1.2.3