Skip to content

Add x13a/zig-scrypt #30

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

Closed
wants to merge 1 commit into from
Closed

Conversation

The-King-of-Toasters
Copy link

No description provided.

@x13a
Copy link

x13a commented Jul 11, 2021

This library is waiting for std. I already made a pull request for that when zig was version 0.7.1, but haven't time to complete. In near future, maybe next week (can't promise) I will redo that.

@The-King-of-Toasters
Copy link
Author

The-King-of-Toasters commented Jul 11, 2021

Sounds good, I'm using this library on it's own but I might as well wait. BTW, do you think it's possible to make a comptime kdf function if params and derived_key.len are known at compile time?

@x13a
Copy link

x13a commented Jul 11, 2021

I don't know zig well enough to help you. This was a golang port heavy modified by @jedisct1. Maybe he answer this.

@x13a
Copy link

x13a commented Jul 11, 2021

The stopper with comptime scrypt can be that it requires much memory allocation (depends on params). This is done on the heap. Can zig allocate memory on the heap at comptime?

But if you mean some kdf then I suppose yes. Under kdf I mean some function that will hash password using CPU intensive operations.

@jedisct1
Copy link

That would be abysmally slow!

What is the use case for running a CPU-hard/memory-hard function at comptime?

@jedisct1
Copy link

@setEvalBranchQuota would also need to be tuned accordingly, and even with very low parameters, that would be out of control.

@The-King-of-Toasters
Copy link
Author

I had a look again and realised my error, my params would result in a 16k stack! Disregard.

@jedisct1
Copy link

16MB (not 16k) memory is the minimum for scrypt, even in low security settings.

@x13a
Copy link

x13a commented Aug 25, 2021

@The-King-of-Toasters , merged to std: 9577

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.

3 participants