From 3906dd28e4d18b6434095c5057f550d10d6c3324 Mon Sep 17 00:00:00 2001 From: Ma Bingyao Date: Wed, 2 Mar 2016 23:39:42 +0800 Subject: [PATCH] Fixed mx on windows x64. --- xxtea.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xxtea.php b/xxtea.php index 071fe59..aceea82 100644 --- a/xxtea.php +++ b/xxtea.php @@ -10,7 +10,7 @@ | Roger M. Needham | | | | Code Author: Ma Bingyao | -| LastModified: Mar 10, 2015 | +| LastModified: Mar 2, 2016 | | | \**********************************************************/ @@ -52,7 +52,7 @@ private static function int32($n) { } private static function mx($sum, $y, $z, $p, $e, $k) { - return (($z >> 5 ^ $y << 2) + ($y >> 3 ^ $z << 4)) ^ (($sum ^ $y) + ($k[$p & 3 ^ $e] ^ $z)); + return ((($z >> 5 & 0x07ffffff) ^ $y << 2) + (($y >> 3 & 0x1fffffff) ^ $z << 4)) ^ (($sum ^ $y) + ($k[$p & 3 ^ $e] ^ $z)); } private static function fixk($k) {