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

Error on relatively large iteration counts #128

Open
alecmev opened this issue May 2, 2016 · 5 comments
Open

Error on relatively large iteration counts #128

alecmev opened this issue May 2, 2016 · 5 comments

Comments

@alecmev
Copy link

alecmev commented May 2, 2016

This works fine:

scrypt.kdfSync('abc', { N: 16, r: 8, p: 1 })

While this doesn't:

scrypt.kdfSync('abc', { N: 16384, r: 8, p: 1 })

Throws error computing derived key. Clearly, this is a local problem, since 16384 isn't even large, it's normal, but how do I troubleshoot this? I'm running this inside a vanilla Node 6.0.0 Docker container, if that's of any relevance.

@barrysteyn
Copy link
Owner

This looks like an error. Thanks for bringing it to my attention. I will have a fix out shortly.

@barrysteyn
Copy link
Owner

The problem is that the KDF function expects parameters that have been passed to it via the params functions. So what it is expecting if you pass it a straight {N, r, p} object is for the N to be logarithmic. So if you substitute 14 for N (because 2^14 = 16384), it should work fine.

Still, I see where the confusion comes in, and when using a raw object like you have, it should not do this. I will try roll out a fix ASAP.

@ngoctranfire
Copy link

Can we be notified for when this will be fixed?

@demurgos
Copy link

Would this be a breaking change or a new function ?

@barrysteyn
Copy link
Owner

I am trying to have a fix out within the month. The only problem is that it may be a breaking change. Trying to figure out how to get round this...

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

No branches or pull requests

4 participants