From 1726ad16b251918067eaeb0b48d43b5b10bb9678 Mon Sep 17 00:00:00 2001 From: Jeremy Klein Date: Wed, 20 Sep 2023 22:28:01 -0700 Subject: [PATCH] Expose the secp operations to go --- lightspark-crypto-go/signing.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/lightspark-crypto-go/signing.go b/lightspark-crypto-go/signing.go index 278ae1a..f2a491f 100644 --- a/lightspark-crypto-go/signing.go +++ b/lightspark-crypto-go/signing.go @@ -186,6 +186,22 @@ func GeneratePreimageHash(seedBytes []byte, nonce []byte) ([]byte, error) { return signer.GeneratePreimageHash(nonce) } +func SignEcdsa(message []byte, privateKey []byte) ([]byte, error) { + return internal.SignEcdsa(message, privateKey) +} + +func VerifyEcdsa(message []byte, signature []byte, publicKey []byte) (bool, error) { + return internal.VerifyEcdsa(message, signature, publicKey) +} + +func EncryptEcies(message []byte, publicKey []byte) ([]byte, error) { + return internal.EncryptEcies(message, publicKey) +} + +func DecryptEcies(message []byte, privateKey []byte) ([]byte, error) { + return internal.DecryptEcies(message, privateKey) +} + func getLightsparkSigner(seedBytes []byte, network BitcoinNetwork) (*internal.LightsparkSigner, error) { seed := internal.NewSeed(seedBytes) defer seed.Destroy()