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

OpenCL: Double the performance of shared AES-CBC-decrypt #5606

Merged
merged 4 commits into from
Dec 5, 2024

Conversation

magnumripper
Copy link
Member

Ensure AES_cbc_decrypt() utilizes the parallel capability of the bitsliced AES code when more than one block is decrypted at once. For encryption this is not possible as the IV for block n is unknown until block n-1 has been encrypted.

The potential boost is great (over 2x seen with AES-ECB) but none of our current formats use AES-CBC enough for this to make a significant difference, at least not with their (often small) test vectors.

See #5594.

Also a few commits that gets rid of OpenCL build warnings.

magnumripper and others added 4 commits December 4, 2024 20:16
Ensure AES_cbc_decrypt() utilizes the parallel capability of the bitsliced
AES code when more than one block is decrypted at once.  For encryption this
is not possible as the IV for block n is unknown until block n-1 has been
encrypted.

The potential boost is great (over 2x seen with AES-ECB) but none of our
current formats use AES-CBC enough for this to make a significant
difference, at least not with their (often small) test vectors.

See openwall#5594.
streebog256crypt-opencl worked fine, but warnings were emitted.
Seen with PoCL 5.0+debian:
"loop not unrolled: the optimizer was unable to perform the requested
transformation; the transformation might be disabled or specified as part
of an unsupported transformation ordering"
Change function declarations from "static" to "inline".  The latter may
be redefined in opencl_misc.h to suit the target.

We should probably drop that potential (and possibly confusing)
redefinition and define a DECLSPEC macro for this, like in hashcat,
but that's another issue.
Copy link
Member

@solardiz solardiz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't look wrong ;-)

@solardiz solardiz merged commit 7c8b5e3 into openwall:bleeding-jumbo Dec 5, 2024
35 of 36 checks passed
@magnumripper magnumripper deleted the OpenCL-AES-CBC-2x branch December 5, 2024 12:39
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 this pull request may close these issues.

2 participants