SECp256k1.php 898 B

1234567891011121314151617181920212223242526
  1. <?php
  2. /*
  3. * The SECp256k1 curve
  4. * Fundamental ECC Function for Bitcoin/Zetacoin compatable Crypto Currency
  5. * @author Daniel Morante
  6. * Some parts may contain work based on Jan Moritz Lindemann, Matyas Danter, and Joey Hewitt
  7. */
  8. class SECp256k1 {
  9. public $a;
  10. public $b;
  11. public $p;
  12. public $n;
  13. public $G;
  14. public function __construct(){
  15. $this->a = gmp_init('0', 10);
  16. $this->b = gmp_init('7', 10);
  17. $this->p = gmp_init('FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F', 16);
  18. $this->n = gmp_init('FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141', 16);
  19. $this->G = array('x' => gmp_init('55066263022277343669578718895168534326250603453777594175500187360389116729240'),
  20. 'y' => gmp_init('32670510020758816978083085130507043184471273380659243275938904335757337482424'));
  21. }
  22. }
  23. ?>