Rev 846 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 846 | Rev 874 | ||
---|---|---|---|
Line 18... | Line 18... | ||
18 | * If a later version of SEC2 comes out wherein some $a$ values are non-zero we can create a |
18 | * If a later version of SEC2 comes out wherein some $a$ values are non-zero we can create a |
19 | * new method for those. eg. KoblitzA1Prime.php or something. |
19 | * new method for those. eg. KoblitzA1Prime.php or something. |
20 | * |
20 | * |
21 | * PHP version 5 and 7 |
21 | * PHP version 5 and 7 |
22 | * |
22 | * |
- | 23 | * @category Crypt |
|
- | 24 | * @package EC |
|
23 | * @author Jim Wigginton <terrafrost@php.net> |
25 | * @author Jim Wigginton <terrafrost@php.net> |
24 | * @copyright 2017 Jim Wigginton |
26 | * @copyright 2017 Jim Wigginton |
25 | * @license http://www.opensource.org/licenses/mit-license.html MIT License |
27 | * @license http://www.opensource.org/licenses/mit-license.html MIT License |
26 | * @link http://pear.php.net/package/Math_BigInteger |
28 | * @link http://pear.php.net/package/Math_BigInteger |
27 | */ |
29 | */ |
Line 32... | Line 34... | ||
32 | use phpseclib3\Math\PrimeField; |
34 | use phpseclib3\Math\PrimeField; |
33 | 35 | ||
34 | /** |
36 | /** |
35 | * Curves over y^2 = x^3 + b |
37 | * Curves over y^2 = x^3 + b |
36 | * |
38 | * |
- | 39 | * @package KoblitzPrime |
|
37 | * @author Jim Wigginton <terrafrost@php.net> |
40 | * @author Jim Wigginton <terrafrost@php.net> |
- | 41 | * @access public |
|
38 | */ |
42 | */ |
39 | class KoblitzPrime extends Prime |
43 | class KoblitzPrime extends Prime |
40 | { |
44 | { |
41 | // don't overwrite setCoefficients() with one that only accepts one parameter so that |
45 | // don't overwrite setCoefficients() with one that only accepts one parameter so that |
42 | // one might be able to switch between KoblitzPrime and Prime more easily (for benchmarking |
46 | // one might be able to switch between KoblitzPrime and Prime more easily (for benchmarking |
Line 45... | Line 49... | ||
45 | /** |
49 | /** |
46 | * Multiply and Add Points |
50 | * Multiply and Add Points |
47 | * |
51 | * |
48 | * Uses a efficiently computable endomorphism to achieve a slight speedup |
52 | * Uses a efficiently computable endomorphism to achieve a slight speedup |
49 | * |
53 | * |
50 | * Adapted from: |
54 | * Adapted from https://git.io/vxbrP |
51 | * https://github.com/indutny/elliptic/blob/725bd91/lib/elliptic/curve/short.js#L219 |
- | |
52 | * |
55 | * |
53 | * @return int[] |
56 | * @return int[] |
54 | */ |
57 | */ |
55 | public function multiplyAddPoints(array $points, array $scalars) |
58 | public function multiplyAddPoints(array $points, array $scalars) |
56 | { |
59 | { |