includes/diffiehellman.php
changeset 1030 23959360dcfd
parent 801 eb8b23f11744
child 1080 6358f769ecb1
--- a/includes/diffiehellman.php	Thu Jul 02 08:57:13 2009 -0400
+++ b/includes/diffiehellman.php	Thu Jul 02 08:58:54 2009 -0400
@@ -107,7 +107,8 @@
   function safe_add ($x, $y) {
     $lsw = ($x & 0xFFFF) + ($y & 0xFFFF);
     $msw = ($x >> 16) + ($y >> 16) + ($lsw >> 16);
-    return ($msw << 16) | ($lsw & 0xFFFF);
+    // 2009-07-02 Added & 0xFFFFFFFF here to fix problem on PHP w/ native 64-bit integer support (rev. 1030)
+    return (($msw << 16) | ($lsw & 0xFFFF)) & 0xFFFFFFFF;
   }
   function rshz($X, $n)
   {