Skip to content

Commit cef46b4

Browse files
authored
Merge pull request #29 from make-software/update-ecc-lib
Replaced mdanter/ecc package with paragonie/ecc, and got rid of secp256k1-php extension
2 parents 729833b + ca945f1 commit cef46b4

File tree

7 files changed

+261
-134
lines changed

7 files changed

+261
-134
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -19,25 +19,6 @@ jobs:
1919
uses: shivammathur/setup-php@v2
2020
with:
2121
php-version: '7.4'
22-
ini-values: extension=secp256k1.so
23-
24-
- name: Clone libsecp256k1 repository
25-
uses: GuillaumeFalourd/clone-github-repo-action@v2
26-
with:
27-
owner: 'bitcoin-core'
28-
repository: 'secp256k1'
29-
30-
- name: Configure secp256k1
31-
run: cd secp256k1 && ./autogen.sh && ./configure --enable-experimental --enable-module-{ecdh,recovery} && make && sudo make install && cd ..
32-
33-
- name: Clone secp256k1-php repository
34-
uses: GuillaumeFalourd/clone-github-repo-action@v2
35-
with:
36-
owner: 'Bit-Wasp'
37-
repository: 'secp256k1-php'
38-
39-
- name: Install secp256k1-php
40-
run: cd secp256k1-php/secp256k1 && phpize && ./configure --with-secp256k1 && make && sudo make install && cd ..
4122

4223
- uses: actions/checkout@v3
4324

@@ -47,4 +28,4 @@ jobs:
4728
- name: Run test suite
4829
run: composer run-script test
4930
env:
50-
CASPER_PHP_SDK_TEST_NODE_URL: "88.99.100.42:7777"
31+
CASPER_PHP_SDK_TEST_NODE_URL: "95.216.240.135:7777"

README.md

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,29 +6,6 @@ The PHP SDK allows developers to interact with the Casper Network using PHP. Thi
66
composer require make-software/casper-php-sdk
77
```
88

9-
### IMPORTANT
10-
For using `Secp256K1` keys you need to install and enable [secp256k1-php](https://github.com/Bit-Wasp/secp256k1-php) extension:
11-
```bash
12-
git clone git@github.com:bitcoin-core/secp256k1 && \
13-
cd secp256k1 && \
14-
./autogen.sh && \
15-
./configure --enable-experimental --enable-module-{ecdh,recovery} && \
16-
make && sudo make install && \
17-
cd ../
18-
```
19-
```bash
20-
git clone git@github.com:Bit-Wasp/secp256k1-php && \
21-
cd secp256k1-php/secp256k1 && \
22-
phpize && \
23-
./configure --with-secp256k1 && \
24-
make && sudo make install && \
25-
cd ../../
26-
```
27-
Enable extension by adding the following line to your `php.ini` file
28-
```
29-
extension=secp256k1.so
30-
```
31-
329
## Usage
3310
### Creating RpcClient
3411
Create `RpcClient` by passing node url and headers (optional) to constructor

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
"ext-sodium": "*",
1414
"ext-gmp": "*",
1515
"ext-mbstring": "*",
16-
"mdanter/ecc": "^1.0",
17-
"ionux/phactor": "1.0.8"
16+
"ionux/phactor": "1.0.8",
17+
"paragonie/ecc": "^2.3"
1818
},
1919
"autoload": {
2020
"psr-4": {

composer.lock

Lines changed: 179 additions & 31 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Util/Crypto/AsymmetricKey.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ abstract public function exportPublicKeyInPem(): string;
7878
abstract public function exportPrivateKeyInPem(): string;
7979

8080
/**
81-
* Sign the message and retrun hex-encoded signature
81+
* Sign the message and return hex-encoded signature
8282
*
8383
* @param string $message
8484
* @return string

0 commit comments

Comments
 (0)