From cb01434a67d8acc727144dedfe89507368b76fe6 Mon Sep 17 00:00:00 2001 From: Sam Bohler Date: Wed, 26 Nov 2014 15:39:08 -0500 Subject: [PATCH] Removed pointTest. Not in use and we can add it again later with fixes and tests --- src/Bitpay/Util/Util.php | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/src/Bitpay/Util/Util.php b/src/Bitpay/Util/Util.php index 18c8784..9dcd706 100644 --- a/src/Bitpay/Util/Util.php +++ b/src/Bitpay/Util/Util.php @@ -404,34 +404,4 @@ class Util return strrev($byte); } - /** - * y^2 (mod p) = x^3 + ax + b (mod p) - * - * @param PointInterface $point - * @param CurveParameterInterface $parameters - */ - public static function pointTest(PointInterface $point, CurveParameterInterface $parameters = null) - { - if (null === $parameters) { - $parameters = new Secp256k1(); - } - - // y^2 - $y2 = Math::pow($point->getY(), 2); - // x^3 - $x3 = Math::pow($point->getX(), 3); - // ax - $ax = Math::mul($parameters->aHex(), $point->getX()); - - $left = Math::mod($y2, $parameters->pHex()); - $right = Math::mod( - Math::add( - Math::add($x3, $ax), - $parameters->bHex() - ), - $parameters->pHex() - ); - - return ($left == $right); - } }