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 FFI bindings? #95

Open
vkomenda opened this issue Dec 5, 2019 · 5 comments
Open

Add FFI bindings? #95

vkomenda opened this issue Dec 5, 2019 · 5 comments

Comments

@vkomenda
Copy link
Contributor

vkomenda commented Dec 5, 2019

This is not an issue with the crate but rather a question. As it happens, not all projects using this crate are written in Rust. Which is why such projects need to import the crate using FFI. When writing Ocaml FFI, I found that it is an extension of what a standard C API would have been, although I hadn't intended to write a C FFI in the first place.

Would it make sense to add a standard C FFI to this crate so that it could either be used on its own or embedded in more complex FFI for other languages like Ocaml?

The benefit of having a standard FFI from the crate user point of view is peer review and memory safety. For example, the FFI would keep secret keys on the Rust heap and not pass it over the FFI.

@afck
Copy link
Collaborator

afck commented Dec 6, 2019

I like the idea, but do you think it would be feasible to implement that as a separate crate, i.e. have a threshold_crypto_c crate that depends on threshold_crypto and exposes a C-compatible API, and ships with C header files?
It would be cleaner to have it separate, and I don't think it would require access to any private internals of the threshold_crypto crate.

@vkomenda
Copy link
Contributor Author

vkomenda commented Dec 6, 2019

Thanks for the suggestion. A separate crate should do the job perfectly.

@afck
Copy link
Collaborator

afck commented Dec 6, 2019

Great! I won't be able to work on it any time soon, but I'd be happy to help with the review.

@vkomenda
Copy link
Contributor Author

vkomenda commented Dec 6, 2019

Thank you very much!

@vkomenda vkomenda closed this as completed Dec 6, 2019
@afck
Copy link
Collaborator

afck commented Mar 11, 2020

Actually, let's keep this open until such a crate exists. It would be really great to have FFI bindings.

@afck afck reopened this Mar 11, 2020
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

No branches or pull requests

2 participants