Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: ECDH drop #3

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 3 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ From [libsecp256k1](https://github.com/bitcoin-core/secp256k1.git), make sure `l

```
$ ./autogen.sh
$ ./configure --enable-module-ecdh --enable-module-recovery --enable-experimental
$ ./configure --enable-module-recovery --enable-experimental
$ make
$ sudo make install
```
Expand Down Expand Up @@ -44,7 +44,7 @@ $ cd ./secp256k1
$ git submodule init
$ git submodule update
$ ./autogen.sh
$ ./configure --enable-module-ecdh --enable-module-recovery --enable-experimental
$ ./configure --enable-module-recovery --enable-experimental
$ make
$ sudo make install
```
Expand Down Expand Up @@ -73,7 +73,7 @@ $ pipenv run python ./secpy256k1/examples/ex_script.py

### Functions and Context Initialzation

Barring `context_create`, the first argument to each function is a `secp256k1_context` object. The context object is initialized as `SECP256K1_CONTEXT_NONE`, `SECP256K1_CONTEXT_VERIFY`, or `SECP256K1_CONTEXT_SIGN`.
Barring `context_create`, the first argument to each function is a `secp256k1_context` object. The context object is initialized as `SECP256K1_CONTEXT_NONE`, `SECP256K1_CONTEXT_VERIFY`, or `SECP256K1_CONTEXT_SIGN`.

For functions that are context agnostic, it is customary to use `SECP256K1_NONE`. These functions are:
- `context_destroy` Destroy a secp256k1 context object.
Expand Down Expand Up @@ -231,10 +231,3 @@ Tweak a private key by multiplying `tweak` it by a tweak value:
```
func_ret, priv_key_tweaked = secpy256k1.ec_privkey_tweak_mul(ctx=secp256k1_ctx, seckey=priv_key, tweak=tweak)
```

### EC Diffie-Hellman

Compute an ECDH secret in constant time:
```
func_ret, ecdh_secret = secpy256k1.ecdh(ctx=secp256k1_ctx, pubkey=secp256k1_pubkey, privkey=priv_key)
```
4 changes: 1 addition & 3 deletions secpy256k1/build_secp256k1/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
secp256k1_header = []
secp256k1_header.append(
os.path.join(dir_path, 'secp256k1_headers/secp256k1_cdef.h'))
secp256k1_header.append(
os.path.join(dir_path, 'secp256k1_headers/secp256k1_ecdh_cdef.h'))


for header in secp256k1_header:
with open(header, 'rt') as h:
Expand All @@ -18,7 +17,6 @@
"_secpy256k1", # This enters the namespace automatically.
"""
#include "secp256k1.h"
#include "secp256k1_ecdh.h"
""",
include_dirs=['./secp256k1/include'], # secp256k1 install loc
library_dirs=['./secp256k1/.libs'],
Expand Down
31 changes: 0 additions & 31 deletions secpy256k1/build_secp256k1/secp256k1_headers/secp256k1_ecdh.h

This file was deleted.

17 changes: 0 additions & 17 deletions secpy256k1/build_secp256k1/secp256k1_headers/secp256k1_ecdh_cdef.h

This file was deleted.