1
0
mirror of https://github.com/danog/tgseclib.git synced 2024-12-12 00:59:45 +01:00

Merge pull request #371 from terrafrost/rc2

RC2: speed-ups and CS changes

* terrafrost/rc2:
  RC2: speed-ups and CS changes
This commit is contained in:
Andreas Fischer 2014-06-13 23:49:53 +02:00
commit 8e07ebfd51

View File

@ -444,8 +444,8 @@ class Crypt_RC2 extends Crypt_Base
$r3 = (($r3 + $keys[$j++] + ((($r0 ^ $r1) & $r2) ^ $r0)) & 0xFFFF) << 5; $r3 = (($r3 + $keys[$j++] + ((($r0 ^ $r1) & $r2) ^ $r0)) & 0xFFFF) << 5;
$r3 |= $r3 >> 16; $r3 |= $r3 >> 16;
if ($j == $limit) { if ($j === $limit) {
if ($limit == 64) { if ($limit === 64) {
break; break;
} }
@ -489,8 +489,8 @@ class Crypt_RC2 extends Crypt_Base
$r0 = ($r0 | ($r0 << 16)) >> 1; $r0 = ($r0 | ($r0 << 16)) >> 1;
$r0 = ($r0 - $keys[--$j] - ((($r1 ^ $r2) & $r3) ^ $r1)) & 0xFFFF; $r0 = ($r0 - $keys[--$j] - ((($r1 ^ $r2) & $r3) ^ $r1)) & 0xFFFF;
if ($j == $limit) { if ($j === $limit) {
if (!$limit) { if ($limit === 0) {
break; break;
} }
@ -581,8 +581,8 @@ class Crypt_RC2 extends Crypt_Base
((($r0 ^ $r1) & $r2) ^ $r0)) & 0xFFFF) << 5; ((($r0 ^ $r1) & $r2) ^ $r0)) & 0xFFFF) << 5;
$r3 |= $r3 >> 16;'; $r3 |= $r3 >> 16;';
if ($j == $limit) { if ($j === $limit) {
if ($limit == 64) { if ($limit === 64) {
break; break;
} }
@ -619,8 +619,8 @@ class Crypt_RC2 extends Crypt_Base
$r0 = ($r0 - ' . $keys[--$j] . ' - $r0 = ($r0 - ' . $keys[--$j] . ' -
((($r1 ^ $r2) & $r3) ^ $r1)) & 0xFFFF;'; ((($r1 ^ $r2) & $r3) ^ $r1)) & 0xFFFF;';
if ($j == $limit) { if ($j === $limit) {
if (!$limit) { if ($limit === 0) {
break; break;
} }