Skip to content

AES Encryption/Decryption Swapped #5

Description

@onizenso

I was reading source in for the AES encryption and decryption function, and it looks like you have gotten the purpose of the functions mixed up (unless I am misunderstanding something).

In the chb_aes_encryption function, you have plaintext as write data and ciphertext as read data. That's just semantically incorrect. Encryption functions read plaintext and write ciphertext. The reverse is also true in your chb_aes_decryption function.

With AES in ECB mode, the encryption machine is inversely reversible. But using the ciphertext buffer for writing in an encryption function can't be a good idea. At the very least, its very confusing.

Activity

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