Closed quchen closed 10 years ago
It turns out that I had missed something in my reading of the RSA specification (or, rather, I did it correctly, but didn't make the obvious inference). According to the specification, certain cryptographic functions require certain minimum key sizes. I've reflected these constraints in the updated Haddock comments for RSA version 2.
In your particular example, the hash size used with the default 'encrypt' function requires a key size of at least 512 bits, I believe. If you'd rather use a smaller key (like 128 bits) you may be able to do it, but you'll have to find a hash function with a smaller hash size.
This isn't fixable in the traditional sense (because the behavior is according to spec), but I've updated the documentation to better describe the constraints.
The docs claim that
encrypt
can handle messages of arbitrary size, splitting them as appropriate to fit them into RSA. In the current implementation however, long messageserror
.Output: