-
Notifications
You must be signed in to change notification settings - Fork 7.8k
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
Add sodium_crypto_stream_xchacha20_xor_ic() #8276
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
There are many use-cases where a PHP user is currently using sodium_compat's implementation of this low-level XChaCha20 API. For example, multi-part message processing (in low-memory settings) for a ciphertext that was encrypted with XChaCha20-Poly1305 (rather than the secretstream API). Adding this function to ext/sodium offers better performance and lowers users' memory usage with the polyfill, and ensures that users coming from other languages that provide libsodium bindings have a more consistent experience with our bindings. This is a win-win. This patch follows the libsodium precedent of adding functions instead of optional parameters to existing functions. The parameter order is also consistent with the C API. https://doc.libsodium.org/advanced/stream_ciphers/xchacha20#usage
paragonie-security
added a commit
to paragonie/sodium_compat
that referenced
this pull request
Mar 30, 2022
See php/php-src#8276 for upstream
@jedisct1, thoughts about this? |
Looks good to me. This function is for niche use cases, though. |
Thank you! |
markjaquith
pushed a commit
to markjaquith/WordPress
that referenced
this pull request
Sep 14, 2022
The latest version of sodium_compat includes some improvements, as well as a new feature which will also be included in PHP 8.2. * Fixed issues with the PHP autoloader: * [paragonie/sodium_compat#145 #145]: For WordPress, this ensures when Ed25519 is included, so too is the class it inherits from. * [paragonie/sodium_compat#148 #148], [paragonie/sodium_compat#149 #149]: For PHP 7.4+ with opcache preloading, this ensures the include guards don't fail. * [paragonie/sodium_compat#144 #144]: Added `sodium_crypto_stream_xchacha20_xor_ic()` * See [php/php-src#8276 pull request for php-src] (merged in PHP 8.2) * For motivation: [paragonie/halite#178 paragonie/halite#178] Release notes: https://github.com/paragonie/sodium_compat/releases/tag/v1.18.0 A full list of changes in this update can be found on GitHub: paragonie/sodium_compat@v1.17.1...v1.18.0 Follow-up to [49741], [51002], [51591], [52988]. Props jrf, paragoninitiativeenterprises. Fixes #56564. Built from https://develop.svn.wordpress.org/trunk@54150 git-svn-id: http://core.svn.wordpress.org/trunk@53709 1a063a9b-81f0-0310-95a4-ce76da25c4cd
github-actions bot
pushed a commit
to platformsh/wordpress-performance
that referenced
this pull request
Sep 14, 2022
The latest version of sodium_compat includes some improvements, as well as a new feature which will also be included in PHP 8.2. * Fixed issues with the PHP autoloader: * [paragonie/sodium_compat#145 #145]: For WordPress, this ensures when Ed25519 is included, so too is the class it inherits from. * [paragonie/sodium_compat#148 #148], [paragonie/sodium_compat#149 #149]: For PHP 7.4+ with opcache preloading, this ensures the include guards don't fail. * [paragonie/sodium_compat#144 #144]: Added `sodium_crypto_stream_xchacha20_xor_ic()` * See [php/php-src#8276 pull request for php-src] (merged in PHP 8.2) * For motivation: [paragonie/halite#178 paragonie/halite#178] Release notes: https://github.com/paragonie/sodium_compat/releases/tag/v1.18.0 A full list of changes in this update can be found on GitHub: paragonie/sodium_compat@v1.17.1...v1.18.0 Follow-up to [49741], [51002], [51591], [52988]. Props jrf, paragoninitiativeenterprises. Fixes #56564. Built from https://develop.svn.wordpress.org/trunk@54150 git-svn-id: https://core.svn.wordpress.org/trunk@53709 1a063a9b-81f0-0310-95a4-ce76da25c4cd
whereiscodedude
pushed a commit
to whereiscodedude/wpss
that referenced
this pull request
Sep 18, 2022
The latest version of sodium_compat includes some improvements, as well as a new feature which will also be included in PHP 8.2. * Fixed issues with the PHP autoloader: * [paragonie/sodium_compat#145 #145]: For WordPress, this ensures when Ed25519 is included, so too is the class it inherits from. * [paragonie/sodium_compat#148 #148], [paragonie/sodium_compat#149 #149]: For PHP 7.4+ with opcache preloading, this ensures the include guards don't fail. * [paragonie/sodium_compat#144 #144]: Added `sodium_crypto_stream_xchacha20_xor_ic()` * See [php/php-src#8276 pull request for php-src] (merged in PHP 8.2) * For motivation: [paragonie/halite#178 paragonie/halite#178] Release notes: https://github.com/paragonie/sodium_compat/releases/tag/v1.18.0 A full list of changes in this update can be found on GitHub: paragonie/sodium_compat@v1.17.1...v1.18.0 Follow-up to [49741], [51002], [51591], [52988]. Props jrf, paragoninitiativeenterprises. Fixes #56564. Built from https://develop.svn.wordpress.org/trunk@54150
ootwch
pushed a commit
to ootwch/wordpress-develop
that referenced
this pull request
Nov 4, 2022
The latest version of sodium_compat includes some improvements, as well as a new feature which will also be included in PHP 8.2. * Fixed issues with the PHP autoloader: * [paragonie/sodium_compat#145 WordPress#145]: For WordPress, this ensures when Ed25519 is included, so too is the class it inherits from. * [paragonie/sodium_compat#148 WordPress#148], [paragonie/sodium_compat#149 WordPress#149]: For PHP 7.4+ with opcache preloading, this ensures the include guards don't fail. * [paragonie/sodium_compat#144 WordPress#144]: Added `sodium_crypto_stream_xchacha20_xor_ic()` * See [php/php-src#8276 pull request for php-src] (merged in PHP 8.2) * For motivation: [paragonie/halite#178 paragonie/halite#178] Release notes: https://github.com/paragonie/sodium_compat/releases/tag/v1.18.0 A full list of changes in this update can be found on GitHub: paragonie/sodium_compat@v1.17.1...v1.18.0 Follow-up to [49741], [51002], [51591], [52988]. Props jrf, paragoninitiativeenterprises. Fixes #56564. git-svn-id: https://develop.svn.wordpress.org/trunk@54150 602fd350-edb4-49c9-b593-d223f7449a82
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There are many use-cases where a PHP user is currently using sodium_compat's implementation of this low-level XChaCha20 API. For example, multi-part message processing (in low-memory settings) for a ciphertext that was encrypted with XChaCha20-Poly1305 (rather than the secretstream API).
Adding this function to ext/sodium offers better performance and lowers users' memory usage with the polyfill, and ensures that users coming from other languages that provide libsodium bindings have a more consistent experience with our bindings. This is a win-win.
This patch follows the libsodium precedent of adding functions instead of optional parameters to existing functions. The parameter order is also consistent with the C API.
https://doc.libsodium.org/advanced/stream_ciphers/xchacha20#usage
Related issues: paragonie/halite#178