Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unhelpful error messages #19

Open
mikeboers opened this issue Aug 29, 2013 · 3 comments
Open

Unhelpful error messages #19

mikeboers opened this issue Aug 29, 2013 · 3 comments

Comments

@mikeboers
Copy link
Owner

From @parke:

I switched from ctr mode to cbc mode, and got this error:

tomcrypt.LibError: Invalid argument provided.

I guess CBC mode needs the input to be a multiple of the block size. A more descriptive error message would have been helpful.

@parke
Copy link

parke commented Aug 29, 2013

A quicker (interim?) fix would be to document which ciphers require block length inputs.

@mikeboers
Copy link
Owner Author

That is something that can be easily done.

In general, I would like to rework the error handling. Specifically, I think I would like to build a new exception tree, instead of just having Error and LibError.

At the most extreme, we would have an exception for each of the 2 dozen(ish) errors that the libtomcrypt gives us, and they would also inherit from the standard exceptions (usually ValueError or RuntimeError) as appropriate.

@mikeboers
Copy link
Owner Author

For reference, the modes which require a block sized input are: ecb, cbc, and lrw.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants