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

Rewrite AES encrypt and decrypt to reuse code #145

Closed
Jakuje opened this issue Jan 21, 2025 · 0 comments · Fixed by #148
Closed

Rewrite AES encrypt and decrypt to reuse code #145

Jakuje opened this issue Jan 21, 2025 · 0 comments · Fixed by #148

Comments

@Jakuje
Copy link
Contributor

Jakuje commented Jan 21, 2025

The only though I had is that the decrypt_initialize() and encrypt_initialize() have almost all repeated code so I though if we should factor it out to some crypt_initialize() and use the EVP_CipherInit_ex() and similar functions in here. But I can do it in separate PR if you would find it useful.

Originally posted by @Jakuje in #144 (review)

Jakuje added a commit to Jakuje/kryoptic that referenced this issue Jan 30, 2025
The functions encrypt_initialize() and decrypt_initialize() have most of
the duplicated code except for the OpenSSL function names. This unfifies
the use on functions that work in both direction, keeping the code
simpler and needing to fix bugs only in one place.

There were slight differences already in both of the implementations so
I tried to take the better variant with more descriptive comments and
checking.

Fixes: latchset#145

Signed-off-by: Jakub Jelen <[email protected]>
@simo5 simo5 closed this as completed in 7e9a0d6 Jan 30, 2025
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

Successfully merging a pull request may close this issue.

1 participant