herumi / mcl

a portable and fast pairing-based cryptography library
BSD 3-Clause "New" or "Revised" License
458 stars 157 forks source link

WIP: Rust-lang FFI #67

Closed adambudziak closed 4 years ago

adambudziak commented 4 years ago

Hi,

I started implementing a Rust FFI for this (really great) library, and because I noticed that this repo already contains FFIs for a few other languages, I created this PR to let you know, that a next one will be soon available.

I'd like to ask you if you prefer to include this FFI right here in this repo (if so - this is the PR for that), or should I create a separate one for it.

Generally, I'm planning to make this FFI more available to others by publishing it on crates.io, creating proper docs with examples, and this will require that the rust crate is inside of its own repo. So if we wanted to store it here as well, we would need to use submodules or something like that.

Right now, the FFI only covers these functions which were used in the pairing_c.c example. (you can see the rust version in ffi/rust/mcl/examples/pairing.rs.

The code is still garbage, please don't judge (for now).

herumi commented 4 years ago

Thank you for the useful patch. Just now, I'm studying Rust and start writing FFI for it. I'll merge it, so please wait a moment.

adambudziak commented 4 years ago

Are you planning on writing a fully-blown Rust API, or just low-level FFI bindings?

I needed to publish my bindings on crates.io (and used name mcl), so if you'd like to publish it as well under this name, I can (try to, don't know how) rename it for you.

So I guess you don't need my PR here, right?

herumi commented 4 years ago

I'm going to create an easy-to-use Rust class API.

I needed to publish my bindings on crates.io (and used name mcl), so if you'd >like to publish it as well under this name, I can (try to, don't know how) rename it for you.

Thank you for your kindness. I want to use the name mcl, but I'll use the other name (mcl-rust or so) if you could not change it.

So I guess you don't need my PR here, right?

No, you don't. I'll check your code by myself because it is very useful for me.

adambudziak commented 4 years ago

Ok, I'll try to rename the crate today in the evening.

No, you don't. I'll check your code by myself because it is very useful for me.

To be honest, my code has bad quality at the moment, and not worth learning from. But if you need anything, you can contact me.

adambudziak commented 4 years ago

Ok, I checked, and while I can't rename a crate, I can transfer the ownership to you. Then you'd just need to publish a new version pointing to your repository.