Skip to content

Commit

Permalink
Bug #16214 - BTWOC type support for getPrime(). QA fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
CloCkWeRX committed May 24, 2009
1 parent 5598e2b commit ec4561f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion DiffieHellman.php
Expand Up @@ -305,9 +305,13 @@ public function getPrime($type = self::NUMBER)
require_once('Crypt/DiffieHellman/Exception.php');
throw new Crypt_DiffieHellman_Exception('No prime number has been set');
}

if ($type == self::NUMBER) {
return $this->_prime;
} else if ($type == self::BTWOC) {
return $this->_math->btwoc($this->_math->toBinary($this->_prime));
}

return $this->_math->toBinary($this->_prime);
}

Expand Down Expand Up @@ -414,4 +418,4 @@ protected function _generatePrivateKey()
return $rand;
}

}
}

0 comments on commit ec4561f

Please sign in to comment.