Skip to content

Unhelpful error messages #19

Open
Open

Description

@mikeboers

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.

Activity

  1. parke commented on Aug 29, 2013

    @parke

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

  2. mikeboers commented on Aug 29, 2013

    @mikeboers
    OwnerAuthor

    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.

  3. mikeboers commented on Aug 29, 2013

    @mikeboers
    OwnerAuthor

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions