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

Accessing scalars from Python code #101

Closed
devos50 opened this issue Aug 30, 2021 · 3 comments
Closed

Accessing scalars from Python code #101

devos50 opened this issue Aug 30, 2021 · 3 comments

Comments

@devos50
Copy link

devos50 commented Aug 30, 2021

I'm currently trying to write a few Python bindings around the FROST algorithm. To get this up and running, I need to call the secp256k1_scalar_chacha20 function, which signature seems to be defined here. The problem, however, is that I'm not entirely sure how to write the appropriate CFFI bindings to this function, given that the scalar.h file is in the src directory. The existing CFFI bindings are all related to header files in the include directory.

I tried to add the following line to the _cffi_build/build.py file:

Source('scalar.h', '#include <scalar.h>'),

I also created a scalar.h file in the _cffi_build directory with the following contents:

typedef struct {
    uint64_t d[4];
} secp256k1_scalar;

static void secp256k1_scalar_chacha20(
    secp256k1_scalar *r1,
    secp256k1_scalar *r2,
    const unsigned char *seed,
    uint64_t idx
);

When running python3 setup.py build, I'm getting the following error:

build/temp.macosx-11-x86_64-3.9/_libsecp256k1.c:570:10: fatal error: 'scalar.h' file not found

Anyone knows what I'm doing wrong here? Any help would be highly appreciated!

@MementoRC
Copy link
Collaborator

coincurve provides bindings for libsecp256k1, not libsecp256k1-zkp. The feature you are trying to access are not implemented in libsecp256k1.
@ofek given how old this is, I surmise the issue can be closed

@ofek
Copy link
Owner

ofek commented Mar 15, 2024

Feel free to close this yourself at your leisure!

@MementoRC
Copy link
Collaborator

@devos50 Please re-open if you feel my assessment was incorrect or this was closed inappropriately. Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants