• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

famoser / elliptic / 16577142134

28 Jul 2025 06:28PM UTC coverage: 94.369% (-1.2%) from 95.58%
16577142134

Pull #15

github

web-flow
Merge 1ae6c035b into d917b1701
Pull Request #15: Improve bernstein math

236 of 256 new or added lines in 31 files covered. (92.19%)

35 existing lines in 3 files now uncovered.

1324 of 1403 relevant lines covered (94.37%)

8.13 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

68.42
/src/Math/Traits/NativeMathTrait.php
1
<?php
2

3
namespace Famoser\Elliptic\Math\Traits;
4

5
use Famoser\Elliptic\Primitives\Point;
6

7
trait NativeMathTrait
8
{
NEW
9
    public function isInfinity(Point $point): bool
×
10
    {
NEW
11
        $native = $this->calculator->affineToNative($point);
×
12

NEW
13
        return $this->calculator->isInfinity($native);
×
14
    }
15

NEW
16
    public function getInfinity(): Point
×
17
    {
NEW
18
        $native = $this->calculator->getInfinity();
×
19

NEW
20
        return $this->calculator->nativeToAffine($native);
×
21
    }
22

23
    public function add(Point $a, Point $b): Point
24✔
24
    {
25
        $nativeA = $this->calculator->affineToNative($a);
24✔
26
        $nativeB = $this->calculator->affineToNative($b);
24✔
27

28
        $nativeResult = $this->calculator->add($nativeA, $nativeB);
24✔
29

30
        return $this->calculator->nativeToAffine($nativeResult);
24✔
31
    }
32

33
    public function double(Point $a): Point
24✔
34
    {
35
        $nativeA = $this->calculator->affineToNative($a);
24✔
36

37
        $nativeResult = $this->calculator->double($nativeA);
24✔
38

39
        return $this->calculator->nativeToAffine($nativeResult);
24✔
40
    }
41

42
    public function mul(Point $point, \GMP $factor): Point
24✔
43
    {
44
        $native = $this->calculator->affineToNative($point);
24✔
45

46
        $nativeResult = $this->calculator->mul($native, $factor);
24✔
47

48
        return $this->calculator->nativeToAffine($nativeResult);
24✔
49
    }
50
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc