Re: Bug #6159 [Com]: Different results
| From: | Philippe Jausions | Date: | Mon, 26 Jun 2006 18:01:39 +0000 |
| Subject: | Re: Bug #6159 [Com]: Different results | ||
| References: | 1 | Groups: | php.pear.qa |
| Request: | Send a blank email to pear-qa+get-3855@lists.php.net to get a copy of this message | ||
Hi,
Can you try the CVS version, and run the test scripts? on both your
machines?
-Philippe
semipalakva at gmail dot com wrote:
>Edit report at
>http://pear.php.net/bugs/bug.php?id=6159&edit=1
>
> ID: 6159
> Comment by: semipalakva at gmail dot com
> Reported By: vichheann at yahoo dot fr
> Status: Open
> Id: 6159
> Type: Bug
> Package: Crypt_Blowfish
> Operating System: Fedora
> PHP Version: 5.0.3
> New Comment:
>
>I have similar problem. First mashine - 64 bits CPU - use Blowfish for
>encoding some "secret" information. Second machine - 32 bits CPU - use
>the same Blowfish for decoding "secret" information, but with bad
>result. Problem is with ^ operator. 64 bit CPU has longer integer
>type.
>
>
>
>What can I do? I have tried binxor but with no results.
>
>
>Previous Comments:
>------------------------------------------------------------------------
>
>[2006-06-16 05:09:44] ronyo at freemail dot hu
>
>I don't know if this helps, but I used this trick to keep away the
>4-byte int values to type cast upward to 8-byte ones:
>
>
>
>function intAdd($a, $b) {
>
> if (($a & 0x80000000) == ($b & 0x80000000)) {
>
> return (($a & 0x7fffffff) + ($b & 0x7fffffff));
>
> } else {
>
> return (($a & 0x7fffffff) + ($b & 0x7fffffff)) + 0x80000000;
>
> }
>
>}
>
>
>
>And in _encipher and _decipher functions the $Xl is calculated like
>this:
>
>$Xl =
>
> $this->intAdd(
>
> (
>
> $this->intAdd(
>
> $this->_S[0][($temp>>24) & 0x0ff],
>
> $this->_S[1][($temp>>16) & 0x0ff]
>
> )
>
> ^ $this->_S[2][($temp>>8) & 0x0ff]
>
> ),
>
> $this->_S[3][$temp & 0x0ff]
>
> )
>
> ^ $Xr;
>
>------------------------------------------------------------------------
>
>[2006-05-15 05:49:01] vichheann at yahoo dot fr
>
>Good news, the latest sources from CVS work on my windows and my linux
>!! You've made a good job, thanks!
>
>I can't tell you about 64-bit machine because I don't have such a
>machine, sorry. I'm looking forward to the next release.
>
>------------------------------------------------------------------------
>
>[2006-05-05 10:46:42] jausions at php dot net
>
>Thank you for taking the time to report a problem with the package.
>This problem may have been already fixed by a previous change that
>is in the CVS of the package. Please log into CVS with:
>
>cvs -d :pserver:cvsread@cvs.php.net:/repository login
>
>and check out the CVS repository of this package and upgrade
>
>cvs -d :pserver:cvsread@cvs.php.net:/repository co pear/Crypt_Blowfish
>pear upgrade pear/Crypt_Blowfish/package2.xml
>
>or
>
>pear upgrade pear/Crypt_Blowfish/package.xml
>
>If you are able to reproduce the bug with the latest CVS,
>please change the status back to "Open".
>Again, thank you for your continued support of PEAR.
>
>I've found a system with the same problem and the newest packing now in
>CVS seems to be working fine on it. The code is not cleaned up yet, I'm
>waiting on your input before removing some debug code and such. My
>latest fix is considerably faster than the bindec(decbin()) solution.
>
>
>
>I would also like to know if that fix works on a 64-bit system, as I'm
>adding floats to offset the PHP_INT_MAX limit.
>
>------------------------------------------------------------------------
>
>[2006-04-27 15:15:24] vichheann at yahoo dot fr
>
>I checked out the last sources on CVS and use them to update my local
>pear install. I launched then the tests with 'pear run-tests' but they
>failed on windows and linux. I also tried to use this new version with
>my code but it failed too. So I'm sorry to say that but it seems that
>the last commit has not been tested (it should work on windows at
>least). Or maybe I miss something?
>
>
>
>I trust you when you say the solution with binxor() is a performance
>killer. But in my case, it's not so important (well, for now ...).
>
>------------------------------------------------------------------------
>
>[2006-04-26 13:30:16] jausions at php dot net
>
>Thank you for taking the time to report a problem with the package.
>This problem may have been already fixed by a previous change that
>is in the CVS of the package. Please log into CVS with:
>
>cvs -d :pserver:cvsread@cvs.php.net:/repository login
>
>and check out the CVS repository of this package and upgrade
>
>cvs -d :pserver:cvsread@cvs.php.net:/repository co pear/Crypt_Blowfish
>pear upgrade pear/Crypt_Blowfish/package2.xml
>
>or
>
>pear upgrade pear/Crypt_Blowfish/package.xml
>
>If you are able to reproduce the bug with the latest CVS,
>please change the status back to "Open".
>Again, thank you for your continued support of PEAR.
>
>Ok, let's see if the CVS version works for you. I don't have access to
>a machine which would have the problem with this bug, so please bear
>with us while we're trying to find a reasonable solution to this.
>
>
>
>The binxor() proposed seems to work from your comment, but it is a
>major performance killer, 6 times as slow as ^ alone...
>
>
>
>Let me know, Thanks
>
>
>
> -Philippe
>
>