diff --git a/lightspark-crypto-go/internal/lightspark_crypto.go b/lightspark-crypto-go/internal/lightspark_crypto.go index 69c5c6a..a2493fa 100644 --- a/lightspark-crypto-go/internal/lightspark_crypto.go +++ b/lightspark-crypto-go/internal/lightspark_crypto.go @@ -47,139 +47,139 @@ typedef struct RustCallStatus { // ⚠️ increment the version suffix in all instances of UNIFFI_SHARED_HEADER_V4 in this file. ⚠️ #endif // def UNIFFI_SHARED_H -void ffi_lightspark_crypto_420_KeyPair_object_free( +void ffi_lightspark_crypto_7bff_KeyPair_object_free( void* ptr, RustCallStatus* out_status ); -RustBuffer lightspark_crypto_420_KeyPair_get_public_key( +RustBuffer lightspark_crypto_7bff_KeyPair_get_public_key( void* ptr, RustCallStatus* out_status ); -RustBuffer lightspark_crypto_420_KeyPair_get_private_key( +RustBuffer lightspark_crypto_7bff_KeyPair_get_private_key( void* ptr, RustCallStatus* out_status ); -void ffi_lightspark_crypto_420_Mnemonic_object_free( +void ffi_lightspark_crypto_7bff_Mnemonic_object_free( void* ptr, RustCallStatus* out_status ); -void* lightspark_crypto_420_Mnemonic_random( +void* lightspark_crypto_7bff_Mnemonic_random( RustCallStatus* out_status ); -void* lightspark_crypto_420_Mnemonic_from_entropy( +void* lightspark_crypto_7bff_Mnemonic_from_entropy( RustBuffer entropy, RustCallStatus* out_status ); -void* lightspark_crypto_420_Mnemonic_from_phrase( +void* lightspark_crypto_7bff_Mnemonic_from_phrase( RustBuffer phrase, RustCallStatus* out_status ); -RustBuffer lightspark_crypto_420_Mnemonic_as_string( +RustBuffer lightspark_crypto_7bff_Mnemonic_as_string( void* ptr, RustCallStatus* out_status ); -void ffi_lightspark_crypto_420_Seed_object_free( +void ffi_lightspark_crypto_7bff_Seed_object_free( void* ptr, RustCallStatus* out_status ); -void* lightspark_crypto_420_Seed_new( +void* lightspark_crypto_7bff_Seed_new( RustBuffer seed, RustCallStatus* out_status ); -void* lightspark_crypto_420_Seed_from_mnemonic( +void* lightspark_crypto_7bff_Seed_from_mnemonic( void* mnemonic, RustCallStatus* out_status ); -RustBuffer lightspark_crypto_420_Seed_as_bytes( +RustBuffer lightspark_crypto_7bff_Seed_as_bytes( void* ptr, RustCallStatus* out_status ); -void ffi_lightspark_crypto_420_InvoiceSignature_object_free( +void ffi_lightspark_crypto_7bff_InvoiceSignature_object_free( void* ptr, RustCallStatus* out_status ); -int32_t lightspark_crypto_420_InvoiceSignature_get_recovery_id( +int32_t lightspark_crypto_7bff_InvoiceSignature_get_recovery_id( void* ptr, RustCallStatus* out_status ); -RustBuffer lightspark_crypto_420_InvoiceSignature_get_signature( +RustBuffer lightspark_crypto_7bff_InvoiceSignature_get_signature( void* ptr, RustCallStatus* out_status ); -void ffi_lightspark_crypto_420_LightsparkSigner_object_free( +void ffi_lightspark_crypto_7bff_LightsparkSigner_object_free( void* ptr, RustCallStatus* out_status ); -void* lightspark_crypto_420_LightsparkSigner_new( +void* lightspark_crypto_7bff_LightsparkSigner_new( void* seed, RustBuffer network, RustCallStatus* out_status ); -void* lightspark_crypto_420_LightsparkSigner_from_bytes( +void* lightspark_crypto_7bff_LightsparkSigner_from_bytes( RustBuffer seed, RustBuffer network, RustCallStatus* out_status ); -RustBuffer lightspark_crypto_420_LightsparkSigner_get_master_public_key( +RustBuffer lightspark_crypto_7bff_LightsparkSigner_get_master_public_key( void* ptr, RustCallStatus* out_status ); -RustBuffer lightspark_crypto_420_LightsparkSigner_derive_public_key( +RustBuffer lightspark_crypto_7bff_LightsparkSigner_derive_public_key( void* ptr, RustBuffer derivation_path, RustCallStatus* out_status ); -RustBuffer lightspark_crypto_420_LightsparkSigner_derive_public_key_hex( +RustBuffer lightspark_crypto_7bff_LightsparkSigner_derive_public_key_hex( void* ptr, RustBuffer derivation_path, RustCallStatus* out_status ); -RustBuffer lightspark_crypto_420_LightsparkSigner_derive_private_key( +RustBuffer lightspark_crypto_7bff_LightsparkSigner_derive_private_key( void* ptr, RustBuffer derivation_path, RustCallStatus* out_status ); -RustBuffer lightspark_crypto_420_LightsparkSigner_ecdh( +RustBuffer lightspark_crypto_7bff_LightsparkSigner_ecdh( void* ptr, RustBuffer public_key, RustCallStatus* out_status ); -void* lightspark_crypto_420_LightsparkSigner_sign_invoice( +void* lightspark_crypto_7bff_LightsparkSigner_sign_invoice( void* ptr, RustBuffer unsigned_invoice, RustCallStatus* out_status ); -void* lightspark_crypto_420_LightsparkSigner_sign_invoice_hash( +void* lightspark_crypto_7bff_LightsparkSigner_sign_invoice_hash( void* ptr, RustBuffer unsigned_invoice, RustCallStatus* out_status ); -RustBuffer lightspark_crypto_420_LightsparkSigner_derive_key_and_sign( +RustBuffer lightspark_crypto_7bff_LightsparkSigner_derive_key_and_sign( void* ptr, RustBuffer message, RustBuffer derivation_path, @@ -189,72 +189,72 @@ RustBuffer lightspark_crypto_420_LightsparkSigner_derive_key_and_sign( RustCallStatus* out_status ); -RustBuffer lightspark_crypto_420_LightsparkSigner_get_per_commitment_point( +RustBuffer lightspark_crypto_7bff_LightsparkSigner_get_per_commitment_point( void* ptr, RustBuffer derivation_path, uint64_t per_commitment_point_idx, RustCallStatus* out_status ); -RustBuffer lightspark_crypto_420_LightsparkSigner_release_per_commitment_secret( +RustBuffer lightspark_crypto_7bff_LightsparkSigner_release_per_commitment_secret( void* ptr, RustBuffer derivation_path, uint64_t per_commitment_point_idx, RustCallStatus* out_status ); -RustBuffer lightspark_crypto_420_LightsparkSigner_generate_preimage_nonce( +RustBuffer lightspark_crypto_7bff_LightsparkSigner_generate_preimage_nonce( void* ptr, RustCallStatus* out_status ); -RustBuffer lightspark_crypto_420_LightsparkSigner_generate_preimage( +RustBuffer lightspark_crypto_7bff_LightsparkSigner_generate_preimage( void* ptr, RustBuffer nonce, RustCallStatus* out_status ); -RustBuffer lightspark_crypto_420_LightsparkSigner_generate_preimage_hash( +RustBuffer lightspark_crypto_7bff_LightsparkSigner_generate_preimage_hash( void* ptr, RustBuffer nonce, RustCallStatus* out_status ); -void ffi_lightspark_crypto_420_Validation_init_callback( +void ffi_lightspark_crypto_7bff_Validation_init_callback( ForeignCallback callback_stub, RustCallStatus* out_status ); -RustBuffer lightspark_crypto_420_sign_ecdsa( +RustBuffer lightspark_crypto_7bff_sign_ecdsa( RustBuffer msg, RustBuffer private_key_bytes, RustCallStatus* out_status ); -int8_t lightspark_crypto_420_verify_ecdsa( +int8_t lightspark_crypto_7bff_verify_ecdsa( RustBuffer msg, RustBuffer signature_bytes, RustBuffer public_key_bytes, RustCallStatus* out_status ); -RustBuffer lightspark_crypto_420_encrypt_ecies( +RustBuffer lightspark_crypto_7bff_encrypt_ecies( RustBuffer msg, RustBuffer public_key_bytes, RustCallStatus* out_status ); -RustBuffer lightspark_crypto_420_decrypt_ecies( +RustBuffer lightspark_crypto_7bff_decrypt_ecies( RustBuffer cipher_text, RustBuffer private_key_bytes, RustCallStatus* out_status ); -void* lightspark_crypto_420_generate_keypair( +void* lightspark_crypto_7bff_generate_keypair( RustCallStatus* out_status ); -RustBuffer lightspark_crypto_420_handle_remote_signing_webhook_event( +RustBuffer lightspark_crypto_7bff_handle_remote_signing_webhook_event( RustBuffer webhook_data, RustBuffer webhook_signature, RustBuffer webhook_secret, @@ -263,29 +263,29 @@ RustBuffer lightspark_crypto_420_handle_remote_signing_webhook_event( RustCallStatus* out_status ); -RustBuffer ffi_lightspark_crypto_420_rustbuffer_alloc( +RustBuffer ffi_lightspark_crypto_7bff_rustbuffer_alloc( int32_t size, RustCallStatus* out_status ); -RustBuffer ffi_lightspark_crypto_420_rustbuffer_from_bytes( +RustBuffer ffi_lightspark_crypto_7bff_rustbuffer_from_bytes( ForeignBytes bytes, RustCallStatus* out_status ); -void ffi_lightspark_crypto_420_rustbuffer_free( +void ffi_lightspark_crypto_7bff_rustbuffer_free( RustBuffer buf, RustCallStatus* out_status ); -RustBuffer ffi_lightspark_crypto_420_rustbuffer_reserve( +RustBuffer ffi_lightspark_crypto_7bff_rustbuffer_reserve( RustBuffer buf, int32_t additional, RustCallStatus* out_status ); -int32_t lightspark_crypto_420_cgo_Validation(uint64_t, int32_t, RustBuffer, RustBuffer *); +int32_t lightspark_crypto_7bff_cgo_Validation(uint64_t, int32_t, RustBuffer, RustBuffer *); */ import "C" @@ -345,7 +345,7 @@ func stringToCRustBuffer(str string) C.RustBuffer { func (rb rustBuffer) free() { rustCall(func(status *C.RustCallStatus) bool { - C.ffi_lightspark_crypto_420_rustbuffer_free(rb.self, status) + C.ffi_lightspark_crypto_7bff_rustbuffer_free(rb.self, status) return false }) } @@ -685,7 +685,10 @@ type FfiConverterstring struct{} var FfiConverterstringINSTANCE = FfiConverterstring{} func (FfiConverterstring) lift(cRustBuf C.RustBuffer) string { - reader := fromCRustBuffer(cRustBuf).asReader() + rustBuf := fromCRustBuffer(cRustBuf) + defer rustBuf.free() + + reader := rustBuf.asReader() b, err := io.ReadAll(reader) if err != nil { panic(fmt.Errorf("reading reader: %w", err)) @@ -793,7 +796,7 @@ func (_self *InvoiceSignature) GetRecoveryId() int32 { defer _self.ffiObject.decrementPointer() return FfiConverterint32INSTANCE.lift(rustCall(func(_uniffiStatus *C.RustCallStatus) C.int32_t { - return C.lightspark_crypto_420_InvoiceSignature_get_recovery_id( + return C.lightspark_crypto_7bff_InvoiceSignature_get_recovery_id( _pointer, _uniffiStatus) })) @@ -803,7 +806,7 @@ func (_self *InvoiceSignature) GetSignature() []uint8 { defer _self.ffiObject.decrementPointer() return FfiConverterSequenceuint8INSTANCE.lift(rustCall(func(_uniffiStatus *C.RustCallStatus) C.RustBuffer { - return C.lightspark_crypto_420_InvoiceSignature_get_signature( + return C.lightspark_crypto_7bff_InvoiceSignature_get_signature( _pointer, _uniffiStatus) })) @@ -823,7 +826,7 @@ func (c FfiConverterInvoiceSignature) lift(pointer unsafe.Pointer) *InvoiceSigna newFfiObject( pointer, func(pointer unsafe.Pointer, status *C.RustCallStatus) { - C.ffi_lightspark_crypto_420_InvoiceSignature_object_free(pointer, status) + C.ffi_lightspark_crypto_7bff_InvoiceSignature_object_free(pointer, status) }), } runtime.SetFinalizer(result, (*InvoiceSignature).Destroy) @@ -862,7 +865,7 @@ func (_self *KeyPair) GetPublicKey() []uint8 { defer _self.ffiObject.decrementPointer() return FfiConverterSequenceuint8INSTANCE.lift(rustCall(func(_uniffiStatus *C.RustCallStatus) C.RustBuffer { - return C.lightspark_crypto_420_KeyPair_get_public_key( + return C.lightspark_crypto_7bff_KeyPair_get_public_key( _pointer, _uniffiStatus) })) @@ -872,7 +875,7 @@ func (_self *KeyPair) GetPrivateKey() []uint8 { defer _self.ffiObject.decrementPointer() return FfiConverterSequenceuint8INSTANCE.lift(rustCall(func(_uniffiStatus *C.RustCallStatus) C.RustBuffer { - return C.lightspark_crypto_420_KeyPair_get_private_key( + return C.lightspark_crypto_7bff_KeyPair_get_private_key( _pointer, _uniffiStatus) })) @@ -892,7 +895,7 @@ func (c FfiConverterKeyPair) lift(pointer unsafe.Pointer) *KeyPair { newFfiObject( pointer, func(pointer unsafe.Pointer, status *C.RustCallStatus) { - C.ffi_lightspark_crypto_420_KeyPair_object_free(pointer, status) + C.ffi_lightspark_crypto_7bff_KeyPair_object_free(pointer, status) }), } runtime.SetFinalizer(result, (*KeyPair).Destroy) @@ -929,7 +932,7 @@ type LightsparkSigner struct { func NewLightsparkSigner(seed *Seed, network Network) (*LightsparkSigner, error) { _uniffiRV, _uniffiErr := rustCallWithError(FfiConverterTypeLightsparkSignerError{}, func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { - return C.lightspark_crypto_420_LightsparkSigner_new(FfiConverterSeedINSTANCE.lower(seed), FfiConverterTypeNetworkINSTANCE.lower(network), _uniffiStatus) + return C.lightspark_crypto_7bff_LightsparkSigner_new(FfiConverterSeedINSTANCE.lower(seed), FfiConverterTypeNetworkINSTANCE.lower(network), _uniffiStatus) }) if _uniffiErr != nil { var _uniffiDefaultValue *LightsparkSigner @@ -943,7 +946,7 @@ func NewLightsparkSigner(seed *Seed, network Network) (*LightsparkSigner, error) func LightsparkSignerFromBytes(seed []uint8, network Network) (*LightsparkSigner, error) { _uniffiRV, _uniffiErr := rustCallWithError(FfiConverterTypeLightsparkSignerError{}, func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { - return C.lightspark_crypto_420_LightsparkSigner_from_bytes(FfiConverterSequenceuint8INSTANCE.lower(seed), FfiConverterTypeNetworkINSTANCE.lower(network), _uniffiStatus) + return C.lightspark_crypto_7bff_LightsparkSigner_from_bytes(FfiConverterSequenceuint8INSTANCE.lower(seed), FfiConverterTypeNetworkINSTANCE.lower(network), _uniffiStatus) }) if _uniffiErr != nil { var _uniffiDefaultValue *LightsparkSigner @@ -959,7 +962,7 @@ func (_self *LightsparkSigner) GetMasterPublicKey() (string, error) { defer _self.ffiObject.decrementPointer() _uniffiRV, _uniffiErr := rustCallWithError(FfiConverterTypeLightsparkSignerError{}, func(_uniffiStatus *C.RustCallStatus) C.RustBuffer { - return C.lightspark_crypto_420_LightsparkSigner_get_master_public_key( + return C.lightspark_crypto_7bff_LightsparkSigner_get_master_public_key( _pointer, _uniffiStatus) }) if _uniffiErr != nil { @@ -975,7 +978,7 @@ func (_self *LightsparkSigner) DerivePublicKey(derivationPath string) (string, e defer _self.ffiObject.decrementPointer() _uniffiRV, _uniffiErr := rustCallWithError(FfiConverterTypeLightsparkSignerError{}, func(_uniffiStatus *C.RustCallStatus) C.RustBuffer { - return C.lightspark_crypto_420_LightsparkSigner_derive_public_key( + return C.lightspark_crypto_7bff_LightsparkSigner_derive_public_key( _pointer, FfiConverterstringINSTANCE.lower(derivationPath), _uniffiStatus) }) if _uniffiErr != nil { @@ -991,7 +994,7 @@ func (_self *LightsparkSigner) DerivePublicKeyHex(derivationPath string) (string defer _self.ffiObject.decrementPointer() _uniffiRV, _uniffiErr := rustCallWithError(FfiConverterTypeLightsparkSignerError{}, func(_uniffiStatus *C.RustCallStatus) C.RustBuffer { - return C.lightspark_crypto_420_LightsparkSigner_derive_public_key_hex( + return C.lightspark_crypto_7bff_LightsparkSigner_derive_public_key_hex( _pointer, FfiConverterstringINSTANCE.lower(derivationPath), _uniffiStatus) }) if _uniffiErr != nil { @@ -1007,7 +1010,7 @@ func (_self *LightsparkSigner) DerivePrivateKey(derivationPath string) (string, defer _self.ffiObject.decrementPointer() _uniffiRV, _uniffiErr := rustCallWithError(FfiConverterTypeLightsparkSignerError{}, func(_uniffiStatus *C.RustCallStatus) C.RustBuffer { - return C.lightspark_crypto_420_LightsparkSigner_derive_private_key( + return C.lightspark_crypto_7bff_LightsparkSigner_derive_private_key( _pointer, FfiConverterstringINSTANCE.lower(derivationPath), _uniffiStatus) }) if _uniffiErr != nil { @@ -1023,7 +1026,7 @@ func (_self *LightsparkSigner) Ecdh(publicKey []uint8) ([]uint8, error) { defer _self.ffiObject.decrementPointer() _uniffiRV, _uniffiErr := rustCallWithError(FfiConverterTypeLightsparkSignerError{}, func(_uniffiStatus *C.RustCallStatus) C.RustBuffer { - return C.lightspark_crypto_420_LightsparkSigner_ecdh( + return C.lightspark_crypto_7bff_LightsparkSigner_ecdh( _pointer, FfiConverterSequenceuint8INSTANCE.lower(publicKey), _uniffiStatus) }) if _uniffiErr != nil { @@ -1039,7 +1042,7 @@ func (_self *LightsparkSigner) SignInvoice(unsignedInvoice string) (*InvoiceSign defer _self.ffiObject.decrementPointer() _uniffiRV, _uniffiErr := rustCallWithError(FfiConverterTypeLightsparkSignerError{}, func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { - return C.lightspark_crypto_420_LightsparkSigner_sign_invoice( + return C.lightspark_crypto_7bff_LightsparkSigner_sign_invoice( _pointer, FfiConverterstringINSTANCE.lower(unsignedInvoice), _uniffiStatus) }) if _uniffiErr != nil { @@ -1055,7 +1058,7 @@ func (_self *LightsparkSigner) SignInvoiceHash(unsignedInvoice []uint8) (*Invoic defer _self.ffiObject.decrementPointer() _uniffiRV, _uniffiErr := rustCallWithError(FfiConverterTypeLightsparkSignerError{}, func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { - return C.lightspark_crypto_420_LightsparkSigner_sign_invoice_hash( + return C.lightspark_crypto_7bff_LightsparkSigner_sign_invoice_hash( _pointer, FfiConverterSequenceuint8INSTANCE.lower(unsignedInvoice), _uniffiStatus) }) if _uniffiErr != nil { @@ -1071,7 +1074,7 @@ func (_self *LightsparkSigner) DeriveKeyAndSign(message []uint8, derivationPath defer _self.ffiObject.decrementPointer() _uniffiRV, _uniffiErr := rustCallWithError(FfiConverterTypeLightsparkSignerError{}, func(_uniffiStatus *C.RustCallStatus) C.RustBuffer { - return C.lightspark_crypto_420_LightsparkSigner_derive_key_and_sign( + return C.lightspark_crypto_7bff_LightsparkSigner_derive_key_and_sign( _pointer, FfiConverterSequenceuint8INSTANCE.lower(message), FfiConverterstringINSTANCE.lower(derivationPath), FfiConverterboolINSTANCE.lower(isRaw), FfiConverterOptionalSequenceuint8INSTANCE.lower(addTweak), FfiConverterOptionalSequenceuint8INSTANCE.lower(mulTweak), _uniffiStatus) }) if _uniffiErr != nil { @@ -1087,7 +1090,7 @@ func (_self *LightsparkSigner) GetPerCommitmentPoint(derivationPath string, perC defer _self.ffiObject.decrementPointer() _uniffiRV, _uniffiErr := rustCallWithError(FfiConverterTypeLightsparkSignerError{}, func(_uniffiStatus *C.RustCallStatus) C.RustBuffer { - return C.lightspark_crypto_420_LightsparkSigner_get_per_commitment_point( + return C.lightspark_crypto_7bff_LightsparkSigner_get_per_commitment_point( _pointer, FfiConverterstringINSTANCE.lower(derivationPath), FfiConverteruint64INSTANCE.lower(perCommitmentPointIdx), _uniffiStatus) }) if _uniffiErr != nil { @@ -1103,7 +1106,7 @@ func (_self *LightsparkSigner) ReleasePerCommitmentSecret(derivationPath string, defer _self.ffiObject.decrementPointer() _uniffiRV, _uniffiErr := rustCallWithError(FfiConverterTypeLightsparkSignerError{}, func(_uniffiStatus *C.RustCallStatus) C.RustBuffer { - return C.lightspark_crypto_420_LightsparkSigner_release_per_commitment_secret( + return C.lightspark_crypto_7bff_LightsparkSigner_release_per_commitment_secret( _pointer, FfiConverterstringINSTANCE.lower(derivationPath), FfiConverteruint64INSTANCE.lower(perCommitmentPointIdx), _uniffiStatus) }) if _uniffiErr != nil { @@ -1119,7 +1122,7 @@ func (_self *LightsparkSigner) GeneratePreimageNonce() []uint8 { defer _self.ffiObject.decrementPointer() return FfiConverterSequenceuint8INSTANCE.lift(rustCall(func(_uniffiStatus *C.RustCallStatus) C.RustBuffer { - return C.lightspark_crypto_420_LightsparkSigner_generate_preimage_nonce( + return C.lightspark_crypto_7bff_LightsparkSigner_generate_preimage_nonce( _pointer, _uniffiStatus) })) @@ -1129,7 +1132,7 @@ func (_self *LightsparkSigner) GeneratePreimage(nonce []uint8) ([]uint8, error) defer _self.ffiObject.decrementPointer() _uniffiRV, _uniffiErr := rustCallWithError(FfiConverterTypeLightsparkSignerError{}, func(_uniffiStatus *C.RustCallStatus) C.RustBuffer { - return C.lightspark_crypto_420_LightsparkSigner_generate_preimage( + return C.lightspark_crypto_7bff_LightsparkSigner_generate_preimage( _pointer, FfiConverterSequenceuint8INSTANCE.lower(nonce), _uniffiStatus) }) if _uniffiErr != nil { @@ -1145,7 +1148,7 @@ func (_self *LightsparkSigner) GeneratePreimageHash(nonce []uint8) ([]uint8, err defer _self.ffiObject.decrementPointer() _uniffiRV, _uniffiErr := rustCallWithError(FfiConverterTypeLightsparkSignerError{}, func(_uniffiStatus *C.RustCallStatus) C.RustBuffer { - return C.lightspark_crypto_420_LightsparkSigner_generate_preimage_hash( + return C.lightspark_crypto_7bff_LightsparkSigner_generate_preimage_hash( _pointer, FfiConverterSequenceuint8INSTANCE.lower(nonce), _uniffiStatus) }) if _uniffiErr != nil { @@ -1171,7 +1174,7 @@ func (c FfiConverterLightsparkSigner) lift(pointer unsafe.Pointer) *LightsparkSi newFfiObject( pointer, func(pointer unsafe.Pointer, status *C.RustCallStatus) { - C.ffi_lightspark_crypto_420_LightsparkSigner_object_free(pointer, status) + C.ffi_lightspark_crypto_7bff_LightsparkSigner_object_free(pointer, status) }), } runtime.SetFinalizer(result, (*LightsparkSigner).Destroy) @@ -1208,7 +1211,7 @@ type Mnemonic struct { func MnemonicRandom() (*Mnemonic, error) { _uniffiRV, _uniffiErr := rustCallWithError(FfiConverterTypeLightsparkSignerError{}, func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { - return C.lightspark_crypto_420_Mnemonic_random(_uniffiStatus) + return C.lightspark_crypto_7bff_Mnemonic_random(_uniffiStatus) }) if _uniffiErr != nil { var _uniffiDefaultValue *Mnemonic @@ -1221,7 +1224,7 @@ func MnemonicRandom() (*Mnemonic, error) { func MnemonicFromEntropy(entropy []uint8) (*Mnemonic, error) { _uniffiRV, _uniffiErr := rustCallWithError(FfiConverterTypeLightsparkSignerError{}, func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { - return C.lightspark_crypto_420_Mnemonic_from_entropy(FfiConverterSequenceuint8INSTANCE.lower(entropy), _uniffiStatus) + return C.lightspark_crypto_7bff_Mnemonic_from_entropy(FfiConverterSequenceuint8INSTANCE.lower(entropy), _uniffiStatus) }) if _uniffiErr != nil { var _uniffiDefaultValue *Mnemonic @@ -1234,7 +1237,7 @@ func MnemonicFromEntropy(entropy []uint8) (*Mnemonic, error) { func MnemonicFromPhrase(phrase string) (*Mnemonic, error) { _uniffiRV, _uniffiErr := rustCallWithError(FfiConverterTypeLightsparkSignerError{}, func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { - return C.lightspark_crypto_420_Mnemonic_from_phrase(FfiConverterstringINSTANCE.lower(phrase), _uniffiStatus) + return C.lightspark_crypto_7bff_Mnemonic_from_phrase(FfiConverterstringINSTANCE.lower(phrase), _uniffiStatus) }) if _uniffiErr != nil { var _uniffiDefaultValue *Mnemonic @@ -1250,7 +1253,7 @@ func (_self *Mnemonic) AsString() string { defer _self.ffiObject.decrementPointer() return FfiConverterstringINSTANCE.lift(rustCall(func(_uniffiStatus *C.RustCallStatus) C.RustBuffer { - return C.lightspark_crypto_420_Mnemonic_as_string( + return C.lightspark_crypto_7bff_Mnemonic_as_string( _pointer, _uniffiStatus) })) @@ -1270,7 +1273,7 @@ func (c FfiConverterMnemonic) lift(pointer unsafe.Pointer) *Mnemonic { newFfiObject( pointer, func(pointer unsafe.Pointer, status *C.RustCallStatus) { - C.ffi_lightspark_crypto_420_Mnemonic_object_free(pointer, status) + C.ffi_lightspark_crypto_7bff_Mnemonic_object_free(pointer, status) }), } runtime.SetFinalizer(result, (*Mnemonic).Destroy) @@ -1307,7 +1310,7 @@ type Seed struct { func NewSeed(seed []uint8) *Seed { return FfiConverterSeedINSTANCE.lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { - return C.lightspark_crypto_420_Seed_new(FfiConverterSequenceuint8INSTANCE.lower(seed), _uniffiStatus) + return C.lightspark_crypto_7bff_Seed_new(FfiConverterSequenceuint8INSTANCE.lower(seed), _uniffiStatus) })) } @@ -1315,7 +1318,7 @@ func NewSeed(seed []uint8) *Seed { func SeedFromMnemonic(mnemonic *Mnemonic) *Seed { return FfiConverterSeedINSTANCE.lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { - return C.lightspark_crypto_420_Seed_from_mnemonic(FfiConverterMnemonicINSTANCE.lower(mnemonic), _uniffiStatus) + return C.lightspark_crypto_7bff_Seed_from_mnemonic(FfiConverterMnemonicINSTANCE.lower(mnemonic), _uniffiStatus) })) } @@ -1325,7 +1328,7 @@ func (_self *Seed) AsBytes() []uint8 { defer _self.ffiObject.decrementPointer() return FfiConverterSequenceuint8INSTANCE.lift(rustCall(func(_uniffiStatus *C.RustCallStatus) C.RustBuffer { - return C.lightspark_crypto_420_Seed_as_bytes( + return C.lightspark_crypto_7bff_Seed_as_bytes( _pointer, _uniffiStatus) })) @@ -1345,7 +1348,7 @@ func (c FfiConverterSeed) lift(pointer unsafe.Pointer) *Seed { newFfiObject( pointer, func(pointer unsafe.Pointer, status *C.RustCallStatus) { - C.ffi_lightspark_crypto_420_Seed_object_free(pointer, status) + C.ffi_lightspark_crypto_7bff_Seed_object_free(pointer, status) }), } runtime.SetFinalizer(result, (*Seed).Destroy) @@ -1930,8 +1933,8 @@ type Validation interface { // foreignCallbackTypeValidation cannot be callable be a compiled function at a same time type foreignCallbackTypeValidation struct{} -//export lightspark_crypto_420_cgo_Validation -func lightspark_crypto_420_cgo_Validation(handle C.uint64_t, method C.int32_t, args C.RustBuffer, outBuf *C.RustBuffer) C.int32_t { +//export lightspark_crypto_7bff_cgo_Validation +func lightspark_crypto_7bff_cgo_Validation(handle C.uint64_t, method C.int32_t, args C.RustBuffer, outBuf *C.RustBuffer) C.int32_t { cb := FfiConverterTypeValidationINSTANCE.lift(uint64(handle)) switch method { case 0: @@ -1978,7 +1981,7 @@ var FfiConverterTypeValidationINSTANCE = &FfiConverterTypeValidation{ // This is a static function because only 1 instance is supported for registering func (c *FfiConverterTypeValidation) register() { rustCall(func(status *C.RustCallStatus) int32 { - C.ffi_lightspark_crypto_420_Validation_init_callback(C.ForeignCallback(C.lightspark_crypto_420_cgo_Validation), status) + C.ffi_lightspark_crypto_7bff_Validation_init_callback(C.ForeignCallback(C.lightspark_crypto_7bff_cgo_Validation), status) return 0 }) } @@ -1988,6 +1991,43 @@ type FfiDestroyerTypeValidation struct{} func (FfiDestroyerTypeValidation) destroy(value Validation) { } +type FfiConverterOptionalTypeRemoteSigningResponse struct{} + +var FfiConverterOptionalTypeRemoteSigningResponseINSTANCE = FfiConverterOptionalTypeRemoteSigningResponse{} + +func (c FfiConverterOptionalTypeRemoteSigningResponse) lift(cRustBuf C.RustBuffer) *RemoteSigningResponse { + return liftFromRustBuffer[*RemoteSigningResponse](c, fromCRustBuffer(cRustBuf)) +} + +func (_ FfiConverterOptionalTypeRemoteSigningResponse) read(reader io.Reader) *RemoteSigningResponse { + if readInt8(reader) == 0 { + return nil + } + temp := FfiConverterTypeRemoteSigningResponseINSTANCE.read(reader) + return &temp +} + +func (c FfiConverterOptionalTypeRemoteSigningResponse) lower(value *RemoteSigningResponse) C.RustBuffer { + return lowerIntoRustBuffer[*RemoteSigningResponse](c, value) +} + +func (_ FfiConverterOptionalTypeRemoteSigningResponse) write(writer io.Writer, value *RemoteSigningResponse) { + if value == nil { + writeInt8(writer, 0) + } else { + writeInt8(writer, 1) + FfiConverterTypeRemoteSigningResponseINSTANCE.write(writer, *value) + } +} + +type FfiDestroyerOptionalTypeRemoteSigningResponse struct{} + +func (_ FfiDestroyerOptionalTypeRemoteSigningResponse) destroy(value *RemoteSigningResponse) { + if value != nil { + FfiDestroyerTypeRemoteSigningResponse{}.destroy(*value) + } +} + type FfiConverterOptionalSequenceuint8 struct{} var FfiConverterOptionalSequenceuint8INSTANCE = FfiConverterOptionalSequenceuint8{} @@ -2071,7 +2111,7 @@ func (FfiDestroyerSequenceuint8) destroy(sequence []uint8) { func SignEcdsa(msg []uint8, privateKeyBytes []uint8) ([]uint8, error) { _uniffiRV, _uniffiErr := rustCallWithError(FfiConverterTypeCryptoError{}, func(_uniffiStatus *C.RustCallStatus) C.RustBuffer { - return C.lightspark_crypto_420_sign_ecdsa(FfiConverterSequenceuint8INSTANCE.lower(msg), FfiConverterSequenceuint8INSTANCE.lower(privateKeyBytes), _uniffiStatus) + return C.lightspark_crypto_7bff_sign_ecdsa(FfiConverterSequenceuint8INSTANCE.lower(msg), FfiConverterSequenceuint8INSTANCE.lower(privateKeyBytes), _uniffiStatus) }) if _uniffiErr != nil { var _uniffiDefaultValue []uint8 @@ -2085,7 +2125,7 @@ func SignEcdsa(msg []uint8, privateKeyBytes []uint8) ([]uint8, error) { func VerifyEcdsa(msg []uint8, signatureBytes []uint8, publicKeyBytes []uint8) (bool, error) { _uniffiRV, _uniffiErr := rustCallWithError(FfiConverterTypeCryptoError{}, func(_uniffiStatus *C.RustCallStatus) C.int8_t { - return C.lightspark_crypto_420_verify_ecdsa(FfiConverterSequenceuint8INSTANCE.lower(msg), FfiConverterSequenceuint8INSTANCE.lower(signatureBytes), FfiConverterSequenceuint8INSTANCE.lower(publicKeyBytes), _uniffiStatus) + return C.lightspark_crypto_7bff_verify_ecdsa(FfiConverterSequenceuint8INSTANCE.lower(msg), FfiConverterSequenceuint8INSTANCE.lower(signatureBytes), FfiConverterSequenceuint8INSTANCE.lower(publicKeyBytes), _uniffiStatus) }) if _uniffiErr != nil { var _uniffiDefaultValue bool @@ -2099,7 +2139,7 @@ func VerifyEcdsa(msg []uint8, signatureBytes []uint8, publicKeyBytes []uint8) (b func EncryptEcies(msg []uint8, publicKeyBytes []uint8) ([]uint8, error) { _uniffiRV, _uniffiErr := rustCallWithError(FfiConverterTypeCryptoError{}, func(_uniffiStatus *C.RustCallStatus) C.RustBuffer { - return C.lightspark_crypto_420_encrypt_ecies(FfiConverterSequenceuint8INSTANCE.lower(msg), FfiConverterSequenceuint8INSTANCE.lower(publicKeyBytes), _uniffiStatus) + return C.lightspark_crypto_7bff_encrypt_ecies(FfiConverterSequenceuint8INSTANCE.lower(msg), FfiConverterSequenceuint8INSTANCE.lower(publicKeyBytes), _uniffiStatus) }) if _uniffiErr != nil { var _uniffiDefaultValue []uint8 @@ -2113,7 +2153,7 @@ func EncryptEcies(msg []uint8, publicKeyBytes []uint8) ([]uint8, error) { func DecryptEcies(cipherText []uint8, privateKeyBytes []uint8) ([]uint8, error) { _uniffiRV, _uniffiErr := rustCallWithError(FfiConverterTypeCryptoError{}, func(_uniffiStatus *C.RustCallStatus) C.RustBuffer { - return C.lightspark_crypto_420_decrypt_ecies(FfiConverterSequenceuint8INSTANCE.lower(cipherText), FfiConverterSequenceuint8INSTANCE.lower(privateKeyBytes), _uniffiStatus) + return C.lightspark_crypto_7bff_decrypt_ecies(FfiConverterSequenceuint8INSTANCE.lower(cipherText), FfiConverterSequenceuint8INSTANCE.lower(privateKeyBytes), _uniffiStatus) }) if _uniffiErr != nil { var _uniffiDefaultValue []uint8 @@ -2127,7 +2167,7 @@ func DecryptEcies(cipherText []uint8, privateKeyBytes []uint8) ([]uint8, error) func GenerateKeypair() (*KeyPair, error) { _uniffiRV, _uniffiErr := rustCallWithError(FfiConverterTypeCryptoError{}, func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer { - return C.lightspark_crypto_420_generate_keypair(_uniffiStatus) + return C.lightspark_crypto_7bff_generate_keypair(_uniffiStatus) }) if _uniffiErr != nil { var _uniffiDefaultValue *KeyPair @@ -2138,16 +2178,16 @@ func GenerateKeypair() (*KeyPair, error) { } -func HandleRemoteSigningWebhookEvent(webhookData []uint8, webhookSignature string, webhookSecret string, masterSeedBytes []uint8, validation Validation) (RemoteSigningResponse, error) { +func HandleRemoteSigningWebhookEvent(webhookData []uint8, webhookSignature string, webhookSecret string, masterSeedBytes []uint8, validation Validation) (*RemoteSigningResponse, error) { _uniffiRV, _uniffiErr := rustCallWithError(FfiConverterTypeRemoteSigningError{}, func(_uniffiStatus *C.RustCallStatus) C.RustBuffer { - return C.lightspark_crypto_420_handle_remote_signing_webhook_event(FfiConverterSequenceuint8INSTANCE.lower(webhookData), FfiConverterstringINSTANCE.lower(webhookSignature), FfiConverterstringINSTANCE.lower(webhookSecret), FfiConverterSequenceuint8INSTANCE.lower(masterSeedBytes), FfiConverterTypeValidationINSTANCE.lower(validation), _uniffiStatus) + return C.lightspark_crypto_7bff_handle_remote_signing_webhook_event(FfiConverterSequenceuint8INSTANCE.lower(webhookData), FfiConverterstringINSTANCE.lower(webhookSignature), FfiConverterstringINSTANCE.lower(webhookSecret), FfiConverterSequenceuint8INSTANCE.lower(masterSeedBytes), FfiConverterTypeValidationINSTANCE.lower(validation), _uniffiStatus) }) if _uniffiErr != nil { - var _uniffiDefaultValue RemoteSigningResponse + var _uniffiDefaultValue *RemoteSigningResponse return _uniffiDefaultValue, _uniffiErr } else { - return FfiConverterTypeRemoteSigningResponseINSTANCE.lift(_uniffiRV), _uniffiErr + return FfiConverterOptionalTypeRemoteSigningResponseINSTANCE.lift(_uniffiRV), _uniffiErr } } diff --git a/lightspark-crypto-go/libs/darwin/amd64/liblightspark_crypto.a b/lightspark-crypto-go/libs/darwin/amd64/liblightspark_crypto.a index 608d6bf..f95ac01 100644 Binary files a/lightspark-crypto-go/libs/darwin/amd64/liblightspark_crypto.a and b/lightspark-crypto-go/libs/darwin/amd64/liblightspark_crypto.a differ diff --git a/lightspark-crypto-go/libs/darwin/arm64/liblightspark_crypto.a b/lightspark-crypto-go/libs/darwin/arm64/liblightspark_crypto.a index c7ae4ee..08c16af 100644 Binary files a/lightspark-crypto-go/libs/darwin/arm64/liblightspark_crypto.a and b/lightspark-crypto-go/libs/darwin/arm64/liblightspark_crypto.a differ diff --git a/lightspark-crypto-go/libs/linux/amd64/liblightspark_crypto.a b/lightspark-crypto-go/libs/linux/amd64/liblightspark_crypto.a index 7a89ab3..d674b35 100644 Binary files a/lightspark-crypto-go/libs/linux/amd64/liblightspark_crypto.a and b/lightspark-crypto-go/libs/linux/amd64/liblightspark_crypto.a differ diff --git a/lightspark-crypto-go/libs/linux/arm64/liblightspark_crypto.a b/lightspark-crypto-go/libs/linux/arm64/liblightspark_crypto.a index c70cdb8..ced3f66 100644 Binary files a/lightspark-crypto-go/libs/linux/arm64/liblightspark_crypto.a and b/lightspark-crypto-go/libs/linux/arm64/liblightspark_crypto.a differ