-
Notifications
You must be signed in to change notification settings - Fork 85
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
PHP 8.0 < 8.1 -- real slow due to XChaCha20 polyfill #178
Comments
We do have plans to add the internal counter to PHP 8.2, but that obviously won't land immediately. |
I do not know what you mean by "internal counter". The problem I am describing is that in the default configuration with PHP 8.zero the PHP poly-fill is used. This is ok when you encrypt small chunks of data, but renders Halite actually close to unusable for large amounts of data. PHP 8.zero is not dead, is it? Halite really shows extremely poor performance with PHP 8.0. |
Oh, I misunderstood. I'll look into the problem. It should be using the standard library function by default. |
Sorry, it can't use the standard library function because the version of the bundled libsodium (with PHP 8.zero) does not supply this function. Hence it has to use the poly-fill. As written in my first comment, in order to get the required |
The easiest solution then is to upgrade to PHP 8.1, since PHP 8.0 lacks this function built-in. |
This is not an easy solution if parts of your project do not yet fully support PHP 8.0. AND: you advertise your Halite to be usable with PHP 8.0: In your README.md I find: Halite 5.0 and newer | 8.0.0 | 1.0.18 | N/A (standard) | Active However, the usability of Halite 5 with PHP 8.0 is somewhat limited due to above mentioned performance problems. Should not this be documented at a prominent position in README.md? |
No. We'll drop PHP 8.0 support if that makes it easier. |
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. git-svn-id: https://develop.svn.wordpress.org/trunk@54150 602fd350-edb4-49c9-b593-d223f7449a82
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
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
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
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
Hi,
thank you for this package. I'm experiencing very very bad performance on PHP 8.0 caused by the XChaCha20 polyfill.
Meanwhile I have recompile a php 8.0 package without libsodium support and installed the very latest pecl-extension from
https://github.com/jedisct1/libsodium-php.git
which has the require PHP binding
sodium_crypto_stream_xchacha20_xor
. With this setup things are quite fast, where "fast" means roughly 0.05 seconds for 16Mib and "slow" about 12 seconds for the same size. This is for symmetric encryption using the `File::encrypt()' method.Without streaming (which compresses the data in chunks of 1Mib it seems), that is with the
Symmetric\Crypto::encrypt()
the thing is hopelessly slow (gave up) while it takes on my system roughly 5 seconds when using the hand-made bleeding edge libsodium bindings.The text was updated successfully, but these errors were encountered: