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

Promote scrypt_kdf to a true symbol #362

Closed
ivb-supercede opened this issue Feb 6, 2023 · 2 comments
Closed

Promote scrypt_kdf to a true symbol #362

ivb-supercede opened this issue Feb 6, 2023 · 2 comments

Comments

@ivb-supercede
Copy link

Apologies if there's a good reason for not doing this, I'm not much of a C interface programmer.

I'm currently writing a Haskell wrapper around libscrypt-kdf which calls out to scrypt_kdf. The library works great - but I was beating my head against a wall trying to figure out linking errors from binding to (what I thought was) the scrypt_kdf function. It was only after checking the library symbols, and reading the code that I realised that scrypt_kdf only exists for the purpose of the header, and my code had to bind to crypto_scrypt.

I assume this symbol is stable, and I could manually write a binding to it that wouldn't break on new versions of scrypt - but I wanted to use the API the "right" way, with the define. Luckily, Haskell has support for relying on C preprocessor directives, and my code can do that. But in general, I think that would be painful. Could scrypt_kdf be somehow promoted to being a proper symbol in libscrypt-kdf to simplify linking for FFIs in the future?

@cperciva
Copy link
Member

cperciva commented Feb 6, 2023

We could do that, but I was concerned about causing problems with code which already defines a scrypt_kdf function -- libscrypt-kdf is a relatively new addition to the scrypt codebase and people had been packaging up scrypt code and including elsewhere in a variety of ways for many years. The define route ensured that we wouldn't have any symbol collisions.

@gperciva
Copy link
Member

Hi @ivb-supercede,

Thanks for asking! We're always happy to hear from people using scrypt.

There's been no action for 3 weeks, and Colin's answer makes sense to me, so I'm going to go ahead and close this issue.

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

No branches or pull requests

3 participants