I assume OpenSSL handles that hashing?


On Tue, Oct 29, 2013 at 8:56 AM, David Fischer <notifications@github.com>wrote:

> In docs/hazmat/primitives/hmac.rst:
>
> > +.. testsetup::
> > +
> > +    import binascii
> > +    key = binascii.unhexlify(b"0" * 32)
> > +
> > +Hash-based message authentication codes (or HMACs) are a tool for calculating
> > +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.hazmat.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 msg.  The
> > +    ``key`` should be randomly generated bytes and the length of the
> > +    ``block_size`` of the hash. You must keep the ``key`` secret.
>
> The RFC also says you can use a longer key by hashing it first. Should you
> mention that as an option?
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/pyca/cryptography/pull/157/files#r7283743>
> .
>



-- 
"I disapprove of what you say, but I will defend to the death your right to
say it." -- Evelyn Beatrice Hall (summarizing Voltaire)
"The people's good is the highest law." -- Cicero
GPG Key fingerprint: 125F 5C67 DFE9 4084