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

Add Go and uniffi support for derive_private_key #32

Merged
merged 7 commits into from
Sep 13, 2023
Merged
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
412 changes: 355 additions & 57 deletions lightspark-crypto-go/internal/lightspark_crypto.go

Large diffs are not rendered by default.

Binary file modified lightspark-crypto-go/libs/darwin/amd64/liblightspark_crypto.a
Binary file not shown.
Binary file modified lightspark-crypto-go/libs/darwin/arm64/liblightspark_crypto.a
Binary file not shown.
Binary file modified lightspark-crypto-go/libs/linux/amd64/liblightspark_crypto.a
Binary file not shown.
Binary file modified lightspark-crypto-go/libs/linux/arm64/liblightspark_crypto.a
Binary file not shown.
10 changes: 10 additions & 0 deletions lightspark-crypto-go/signing.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,16 @@ func DerivePublicKey(seedBytes []byte, network BitcoinNetwork, derivationPath st
return signer.DerivePublicKey(derivationPath)
}

func DerivePrivateKey(seedBytes []byte, network BitcoinNetwork, derivationPath string) (string, error) {
signer, err := getLightsparkSigner(seedBytes, network)
if err != nil {
return "", err
}
defer signer.Destroy()

return signer.DerivePrivateKey(derivationPath)
}

func DeriveKeyAndSign(seedBytes []byte, network BitcoinNetwork, message []byte, derivationPath string, isRaw bool, addTweak *[]byte, multTweak *[]byte) ([]byte, error) {
signer, err := getLightsparkSigner(seedBytes, network)
if err != nil {
Expand Down
Loading