2017 © Pedro Peláez
 

library secp256k1

Ethereum secp256k1 library in PHP.

image

web3p/secp256k1

Ethereum secp256k1 library in PHP.

  • Tuesday, March 20, 2018
  • by sc0Vu
  • Repository
  • 1 Watchers
  • 1 Stars
  • 179 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 3 Open issues
  • 4 Versions
  • 44 % Grown

The README.md

secp256k1

secp256k1 for ethereum, this package depends on mdanter/ecc package., (*1)

Build Status codecov Licensed under the MIT License, (*2)

Install

Set minimum stability to dev, (*3)

composer require web3p/secp256k1

Usage

Sign a message:, (*4)

use Web3p\Secp256k1\Secp256k1;
use Web3p\Secp256k1\Serializer\HexSignatureSerializer;

$secp256k1 = new Secp256k1();

// return signature contains r and s.
// message and privateKey are hex string
$signature = $secp256k1->sign($message, $privateKey);

// get r
$r = $signature->getR();

// get s
$s = $signature->getS();

// encode to hex
$serializer = new HexSignatureSerializer();
$signatureString = $serializer->serialize($signature);

// or you can call toHex
$signatureString = $signature->toHex();

Verify a message:, (*5)

use Web3p\Secp256k1\Secp256k1;

$secp256k1 = new Secp256k1();

// signature was created from sign method.
// hash and publicKey are hex string
$isVerified = $secp256k1->verify($hash, $signature, $publicKey);

API

Todo., (*6)

License

MIT, (*7)

The Versions

20/03 2018

dev-master

9999999-dev

Ethereum secp256k1 library in PHP.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar sc0Vu

20/03 2018

v0.2

0.2.0.0

Ethereum secp256k1 library in PHP.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar sc0Vu

13/03 2018

0.1.1

0.1.1.0

Ethereum secp256k1 library in PHP.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar sc0Vu

16/02 2018

0.1

0.1.0.0

Ethereum secp256k1 library in PHP.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar sc0Vu