Rev 1042 | Rev 1339 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1042 | Rev 1111 | ||
---|---|---|---|
Line 261... | Line 261... | ||
261 | $t = $this->value->powMod($q, static::$modulo[$this->instanceID]); |
261 | $t = $this->value->powMod($q, static::$modulo[$this->instanceID]); |
262 | list($temp) = $q->add($one)->divide($two); |
262 | list($temp) = $q->add($one)->divide($two); |
263 | $r = $this->value->powMod($temp, static::$modulo[$this->instanceID]); |
263 | $r = $this->value->powMod($temp, static::$modulo[$this->instanceID]); |
264 | 264 | ||
265 | while (!$t->equals($one)) { |
265 | while (!$t->equals($one)) { |
266 | $i = clone $one; |
266 | for ($i == clone $one; $i->compare($m) < 0; $i = $i->add($one)) { |
267 | - | ||
268 | while (!$t->powMod($two->pow($i), static::$modulo[$this->instanceID])->equals($one)) { |
267 | if ($t->powMod($two->pow($i), static::$modulo[$this->instanceID])->equals($one)) { |
269 | $i = $i->add($one); |
268 | break; |
- | 269 | } |
|
270 | } |
270 | } |
271 | 271 | ||
272 | if ($i->compare($m) >= 0) { |
272 | if ($i->compare($m) == 0) { |
273 | return false; |
273 | return false; |
274 | } |
274 | } |
275 | $b = $c->powMod($two->pow($m->subtract($i)->subtract($one)), static::$modulo[$this->instanceID]); |
275 | $b = $c->powMod($two->pow($m->subtract($i)->subtract($one)), static::$modulo[$this->instanceID]); |
276 | $m = $i; |
276 | $m = $i; |
277 | $c = $reduce($b->multiply($b)); |
277 | $c = $reduce($b->multiply($b)); |