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

internal: Add libsecp256k1 c library. #2810

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

JoeGruffins
Copy link
Member

Add a c library that has some primitive cryptographic functions needed for working with adaptor signatures.

part of #2754

copy(nonce[:], encode.RandomBytes(32))
key := [32]byte{}
copy(key[:], privKey.Serialize())
n := (*C.uchar)(unsafe.Pointer(&nonce))
Copy link
Member Author

@JoeGruffins JoeGruffins Jun 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Am I supposed to use C.free on these?

@JoeGruffins JoeGruffins force-pushed the addlibsecp256k1library branch 2 times, most recently from 6448f91 to 8e7f104 Compare June 13, 2024 07:17
@JoeGruffins
Copy link
Member Author

I guess this doesn't work as an external package as is because the c code must be built. Was there a way to ensure it is built? Also doesn't currently work on windows and maybe osx. Maybe best to move to internal anyway for now?

@JoeGruffins JoeGruffins changed the title dex: Add libsecp256k1 c library. internal: Add libsecp256k1 c library. Jun 14, 2024
@JoeGruffins
Copy link
Member Author

Moved to internal which should mean it cannot be imported by other projects.

@jrick
Copy link
Member

jrick commented Jun 19, 2024

If this becomes part of the build we'll need to remove it from our https://github.com/decred/release release builder. The cross compilation depends on the project being pure go.

@JoeGruffins
Copy link
Member Author

If this becomes part of the build we'll need to remove it from our https://github.com/decred/release release builder. The cross compilation depends on the project being pure go.

This will only be used by a separate monero proof of concept app. We are going to develop something in go for the client/server later, in a different proposal. We intend for this to be temporary.

@JoeGruffins
Copy link
Member Author

Added four more methods.

@JoeGruffins JoeGruffins force-pushed the addlibsecp256k1library branch 2 times, most recently from 5a31ba1 to b1564c3 Compare July 24, 2024 09:02
@JoeGruffins JoeGruffins force-pushed the addlibsecp256k1library branch 2 times, most recently from f1ef19b to fcb1ff6 Compare August 9, 2024 06:17
Add a c library that has some primitive cryptographic functions needed
for working with adaptor signatures.
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

Successfully merging this pull request may close these issues.

2 participants