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

Argon2: Precompute or cache 2i/2id indices #5559

Open
solardiz opened this issue Nov 5, 2024 · 0 comments
Open

Argon2: Precompute or cache 2i/2id indices #5559

solardiz opened this issue Nov 5, 2024 · 0 comments

Comments

@solardiz
Copy link
Member

solardiz commented Nov 5, 2024

As I wrote in #2738 (comment)

-- cut --
... potential optimization for 2i and 2id, where the data-independent indices can be reused across hash computations, rather than recomputed each time like upstream does. In our current hack of older upstream code, we're already passing the pseudo_rands array from the application, yet somehow we don't appear to be making this optimization. In latest upstream code, this array is gone - as far as I can tell, the data-independent indices are being calculated in smaller portions, which makes sense for that approach - but we'll probably need to reintroduce an equivalent of the array (as an option), to be written-to (if for the first time or when invoked with higher parameters) and reused (on subsequent calls with same or lower parameters) where the new upstream code normally does these things (so that we won't deviate from upstream too much). This probably means in next_addresses().

I think https://gitlab.com/omos/argon2-gpu already has this optimization (for GPU) - grep it for "precompute".
-- cut --

However, now that we got a revision of the above OpenCL implementation into our tree here, it doesn't appear to have this optimization. Maybe it was dropped at some point, or maybe I was wrong that it was there, or am wrong that it isn't now. But right now it looks to me that we'd need to try implementing this for both CPU and OpenCL.

The pseudo_rands array is indeed gone from our tree with #5557.

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

No branches or pull requests

1 participant