That seems reasonable, yes.


On Tue, Jan 28, 2014 at 1:13 PM, Paul Kehrer <notifications@github.com>wrote:

> In cryptography/hazmat/primitives/kdf/pbkdf2.py:
>
> > +from cryptography.exceptions import (
> > +    InvalidKey, UnsupportedAlgorithm, AlreadyFinalized
> > +)
> > +from cryptography.hazmat.primitives import constant_time, interfaces
> > +
> > +
> > +@utils.register_interface(interfaces.KeyDerivationFunction)
> > +class PBKDF2(object):
> > +    def __init__(self, algorithm, length, salt, iterations, backend):
> > +        if not backend.pbkdf2_hash_supported(algorithm):
> > +            raise UnsupportedAlgorithm(
> > +                "{0} is not supported by this backend".format(algorithm.name)
> > +            )
> > +        self._called = False
> > +        self.algorithm = algorithm
> > +        if length > 2**31 - 1:
>
> cffi will check it, yes. We'll get an error like this:
>
> OverflowError: integer 4294967296 does not fit '32-bit int'
>
> So if we consider that acceptable we can remove this logic entirely.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/pyca/cryptography/pull/520/files#r9239739>
> .
>



-- 
"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