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

Missing some of libsodium constants #8608

Open
azjezz opened this issue Nov 21, 2019 · 3 comments
Open

Missing some of libsodium constants #8608

azjezz opened this issue Nov 21, 2019 · 3 comments

Comments

@azjezz
Copy link
Contributor

azjezz commented Nov 21, 2019

HHVM is missing some SODIUM_CRYPTO_GENERICHASH_* constants.

see : https://www.php.net/manual/en/sodium.constants.php

the missing constants :

  • const int SODIUM_CRYPTO_GENERICHASH_BYTES = 32;
  • const int SODIUM_CRYPTO_GENERICHASH_BYTES_MAX = 64;
  • const int SODIUM_CRYPTO_GENERICHASH_BYTES_MIN = 16;

polyfill : https://github.com/nuxed/crypto/blob/master/src/Nuxed/Crypto/_Private/polyfill.hack

@azjezz azjezz changed the title Missing some of libsodium SODIUM_CRYPTO_GENERICHASH_* constants Missing some of libsodium constants Nov 21, 2019
@fredemmott
Copy link
Contributor

"Probably easy" however:

  • constants must be exported from the C variables - fixed values must not be hardcoded
  • older versions of libsodium might not define them - C++ code may need to use macros to conditionally set them.

@jedisct1
Copy link
Contributor

These constants were added in libsodium 0.4.0 released circa 2013.

No Linux distribution is shipping a version that old.

@fredemmott
Copy link
Contributor

fredemmott commented Nov 25, 2019

Thanks - on the topic of sodium (but a bit off-topic for here), #8330 should probably be resurrected; previously, not merged due to reliance of reference semantics which were due to be removed, however references are now completely removed from HHVM, and the concerns have been addressed by implementation details/optimizations of inout (no copies actually made in situations when the byref approach also had a refcount of 1).

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

3 participants