Bitpay\Util\UtilTest::testDoubleAndAdd PHP Метод

testDoubleAndAdd() публичный Метод

public testDoubleAndAdd ( )
    public function testDoubleAndAdd()
    {
        $point = Util::doubleAndAdd('0', new Point(0, 0));
        $this->assertInstanceOf('Bitpay\\PointInterface', $point);
        $this->assertTrue($point->isInfinity());
        $point = Util::doubleAndAdd('1', new Point(1, 1));
        $this->assertEquals('1', $point->getX());
        $this->assertEquals('1', $point->getY());
        $point = new Point('0x' . substr(Secp256k1::G, 2, 64), '0x' . substr(Secp256k1::G, 66, 64));
        $R = Util::doubleAndAdd('0xb7dafe35d7d1aab78b53982c8ba554584518f86d50af565c98e053613c8f15e0', $point);
        $this->assertEquals('14976827122927988984909748681266837395089399768482149532452617485742004777865', $R->getX());
        $this->assertEquals('5009713401941157350243425146365130573323232660945282226881202857781593637456', $R->getY());
        $R = Util::doubleAndAdd('0xfd7c6914790d3bbf3184d9830e3f1a327e951e3478dd0b28f0fd3b0e774bbd68', $point);
        $this->assertEquals('65041784833307054098962518952641430476519680065454324565175938819000678523383', $R->getX());
        $this->assertEquals('53140314933116045874248958072587249546886301333167874306830834776596206062743', $R->getY());
    }