Seperate PR!


On Sun, Jun 1, 2014 at 11:51 AM, Paul Kehrer <notifications@github.com>
wrote:

> In cryptography/hazmat/backends/openssl/backend.py:
>
> > +        assert rshift > 0 and rshift < 8
> > +
> > +        mask = 0xFF >> rshift << rshift
> > +
> > +        # Set the bottom rshift bits to 0
> > +        digest = digest[:-1] + six.int2byte(six.byte2int(digest[-1]) & mask)
> > +
> > +    return digest
> > +
> > +
> > +@utils.register_interface(interfaces.AsymmetricSignatureContext)
> > +class _ECDSASignatureContext(object):
> > +    def __init__(self, backend, private_key, algorithm):
> > +        self._backend = backend
> > +        self._private_key = private_key
> > +        self._digest = hashes.Hash(algorithm, backend)
>
> It looks like doing it this way allows us to elide the AlreadyFinalized
> checks since they're present on Hash. That's a nice reduction of
> duplication. Probably worth doing on the RSA and DSA contexts as well.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/pyca/cryptography/pull/1090/files#r13267867>.
>



-- 
"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