@@ 588-596 (lines=9) @@ | ||
585 | { |
|
586 | return '04' . $pubKey['x'] . $pubKey['y']; |
|
587 | } |
|
588 | else |
|
589 | { |
|
590 | if(gmp_strval(gmp_mod(gmp_init($pubKey['y'], 16), gmp_init(2, 10))) == 0) |
|
591 | $pubKey = '02' . $pubKey['x']; //if $pubKey['y'] is even |
|
592 | else |
|
593 | $pubKey = '03' . $pubKey['x']; //if $pubKey['y'] is odd |
|
594 | ||
595 | return $pubKey; |
|
596 | } |
|
597 | } |
|
598 | ||
599 | /*** |
|
@@ 695-698 (lines=4) @@ | ||
692 | if(empty($pubKeyPts)) |
|
693 | $pubKeyPts = $this->getPubKeyPoints(); |
|
694 | ||
695 | if(gmp_strval(gmp_mod(gmp_init($pubKeyPts['y'], 16), gmp_init(2, 10))) == 0) |
|
696 | $compressedPubKey = '02' . $pubKeyPts['x']; //if $pubKey['y'] is even |
|
697 | else |
|
698 | $compressedPubKey = '03' . $pubKeyPts['x']; //if $pubKey['y'] is odd |
|
699 | ||
700 | return $compressedPubKey; |
|
701 | } |