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
scrypt: Provide read access to the parameter values #123
Comments
Sounds good to me. @newpavlov you okay with the getter method approach? |
Yes, sounds good. |
I added accessors in 1bb21b1, but accidentally pushed Let me know if that looks good. |
Merged
Thank you very much 🙂 |
dns2utf8
pushed a commit
to dns2utf8/password-hashes
that referenced
this issue
Jan 24, 2023
…nsts Re-export `typenum::consts` as `consts`
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
I am currently migrating a Node application to Rust. This application uses scrypt-kdf which is itself based on node-scrypt. The kdf function in these libraries uses a different format than the one provided by this lib. I plan to eventually move to the PHC string format, but my first step is to perform a simple port.
When porting the Node algorithm, I need to write the current parameters into the output buffer. I planned to store my parameters directly as a
scrypt::Param
instance but this type does not allow to read the current values, preventing me from using it to write the Node format. My current solution is to store these parameters in my own struct, but it creates duplication. This is especially bad when usingParams::recommended
as I now have to copy the recommended values to my own crate.Would it be possible to provide read access to the current values of the parameters?
These values are
pub(crate)
currently. I understand that making them public might not be desirable as it completely breaks encapsulation (amut scrypt::Params
would allow anyone to change its values at any time). Would it then be possible to add getter methods? Something like:The text was updated successfully, but these errors were encountered: