Skip to content
This repository has been archived by the owner on Dec 30, 2020. It is now read-only.

Apply fixes from StyleCI #253

Merged
merged 1 commit into from
Sep 15, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions src/Component/Core/Util/Ecc/Curve.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ public function getPoint(\GMP $x, \GMP $y, ?\GMP $order = null): Point
}

/**
* @param \GMP $x
* @param \GMP $y
* @param \GMP $x
* @param \GMP $y
*
* @return PublicKey
*/
Expand All @@ -136,7 +136,6 @@ public function getPublicKeyFrom(\GMP $x, \GMP $y): PublicKey
throw new \RuntimeException('Generator point has x and y out of range.');
}


return PublicKey::create($point);
}

Expand Down Expand Up @@ -251,7 +250,7 @@ public function mul(Point $one, \GMP $n): Point

Point::cswap($r[0], $r[1], $j ^ 1);

$r[0] = $this->add($r[0],$r[1]);
$r[0] = $this->add($r[0], $r[1]);
$r[1] = $this->getDouble($r[1]);

Point::cswap($r[0], $r[1], $j ^ 1);
Expand Down Expand Up @@ -291,7 +290,7 @@ public function equals(Curve $other): bool
*/
public function __toString(): string
{
return 'curve(' . GmpMath::toString($this->getA()) . ', ' . GmpMath::toString($this->getB()) . ', ' . GmpMath::toString($this->getPrime()) . ')';
return 'curve('.GmpMath::toString($this->getA()).', '.GmpMath::toString($this->getB()).', '.GmpMath::toString($this->getPrime()).')';
}

/**
Expand Down
14 changes: 7 additions & 7 deletions src/Component/Core/Util/Ecc/Point.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ final class Point
/**
* Initialize a new instance.
*
* @param \GMP $x
* @param \GMP $y
* @param \GMP $order
* @param bool $infinity
* @param \GMP $x
* @param \GMP $y
* @param \GMP $order
* @param bool $infinity
*
* @throws \RuntimeException when either the curve does not contain the given coordinates or
* when order is not null and P(x, y) * order is not equal to infinity
Expand All @@ -84,8 +84,8 @@ private function __construct(\GMP $x, \GMP $y, \GMP $order, bool $infinity = fal
}

/**
* @param \GMP $x
* @param \GMP $y
* @param \GMP $x
* @param \GMP $y
* @param \GMP|null $order
*
* @return Point
Expand Down Expand Up @@ -169,7 +169,7 @@ private static function cswapBoolean(bool &$a, bool &$b, int $cond)
/**
* @param \GMP $sa
* @param \GMP $sb
* @param int $cond
* @param int $cond
*/
private static function cswapGMP(\GMP &$sa, \GMP &$sb, int $cond)
{
Expand Down
1 change: 1 addition & 0 deletions src/Component/Core/Util/Ecc/PublicKey.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ private function __construct(Point $point)

/**
* @param Point $point
*
* @return PublicKey
*/
public static function create(Point $point): PublicKey
Expand Down