diff options
author | Alex Gaynor <alex.gaynor@gmail.com> | 2013-11-12 16:41:59 -0800 |
---|---|---|
committer | Alex Gaynor <alex.gaynor@gmail.com> | 2013-11-12 16:41:59 -0800 |
commit | 6b44a0aea74d8ec8c92d08f520b11bf58029f7a0 (patch) | |
tree | adc44cfbca50c99f261c45d893d9378ea57e673b /cryptography/hazmat/primitives/hmac.py | |
parent | 4faa094526f49c83a75d21a6e796546d4d539c6c (diff) | |
parent | fcd36a9bb98fe6e13bc37cc833f317a3ee656eef (diff) | |
download | cryptography-6b44a0aea74d8ec8c92d08f520b11bf58029f7a0.tar.gz cryptography-6b44a0aea74d8ec8c92d08f520b11bf58029f7a0.tar.bz2 cryptography-6b44a0aea74d8ec8c92d08f520b11bf58029f7a0.zip |
Merge pull request #249 from dreid/hmac-context-from-backend
Get a HashContext from the hmac backend like we do a CipherContext
Diffstat (limited to 'cryptography/hazmat/primitives/hmac.py')
-rw-r--r-- | cryptography/hazmat/primitives/hmac.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/cryptography/hazmat/primitives/hmac.py b/cryptography/hazmat/primitives/hmac.py index ed2dd54a..0f1b4fac 100644 --- a/cryptography/hazmat/primitives/hmac.py +++ b/cryptography/hazmat/primitives/hmac.py @@ -39,16 +39,15 @@ class HMAC(object): def update(self, msg): if isinstance(msg, six.text_type): raise TypeError("Unicode-objects must be encoded before hashing") - self._backend.hmacs.update_ctx(self._ctx, msg) + self._ctx.update(msg) def copy(self): return HMAC( self._key, self.algorithm, backend=self._backend, - ctx=self._backend.hmacs.copy_ctx(self._ctx) + ctx=self._ctx.copy() ) def finalize(self): - return self._backend.hmacs.finalize_ctx(self._ctx, - self.algorithm.digest_size) + return self._ctx.finalize() |