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 force-pushed the addlibsecp256k1library branch from 8e7f104 to be12d55 Compare June 14, 2024 03:53
@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 JoeGruffins force-pushed the addlibsecp256k1library branch from be12d55 to 4c89d42 Compare July 3, 2024 07:42
@JoeGruffins JoeGruffins force-pushed the addlibsecp256k1library branch from 4c89d42 to 490ec36 Compare July 20, 2024 01:39
@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
@JoeGruffins JoeGruffins force-pushed the addlibsecp256k1library branch from fcb1ff6 to e67b1dc Compare August 16, 2024 04:17
@JoeGruffins JoeGruffins force-pushed the addlibsecp256k1library branch 2 times, most recently from ba9a320 to c3463b3 Compare September 3, 2024 04:35
@JoeGruffins JoeGruffins force-pushed the addlibsecp256k1library branch from c3463b3 to fb4fafc Compare September 24, 2024 02:28
Copy link
Contributor

@dev-warrior777 dev-warrior777 left a comment

Choose a reason for hiding this comment

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

All good!

Add a c library that has some primitive cryptographic functions needed
for working with adaptor signatures.
@JoeGruffins JoeGruffins force-pushed the addlibsecp256k1library branch from fb4fafc to 654e79a Compare October 1, 2024 05:00
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.

3 participants