-
Notifications
You must be signed in to change notification settings - Fork 0
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
Produce JNI Binding for Cryptography Library #2
Comments
2023-10-25 Rohit is working on this. Not all that simple. |
Thanks for the JNI interface, which raises some thoughts, as follows.
DeRecCryptoBridgeMessage {
repeated CommittedDeRecShare shares = 1;
}
public interface ShamirInterfaces {
interface SplitterFactory {
/**
* create a new Shamir splitter
* @param random a random number generator
* @param count the number of shares to produce
* @param threshold the recombination threshold
* @return a splitter
*/
Splitter newSplitter(SecureRandom random, int count, int threshold);
}
interface Splitter {
/**
* Split a secret according to the parameters established
* @param id a secret id
* @param version a version
* @param secret some bytes
* @return a list of shares suitable for redistribution
*/
List<byte[]> split(DeRecSecret.Id id, int version, byte[] secret);
byte[] combine(DeRecSecret.Id id, int version, List<byte[]> shares);
}
}
|
The JNI implementation does not depend on the protobuf definition, and can be used even if the protobuf definitions evolve. We are using the protobuf here as a serialization method to communicate between the java land and rust land, as jni-rs does not seem to provide conveninent methods for passing structs back and forth (FWICT). So, we are using protobuf to encode API arguments and responses as byte arrays. It just happens to be the case that the protobufs in |
The intent is that the |
In response:
|
I think (de) serialization is a small fraction of the total compute cost, which includes polynomial arithmetic and SHA computations. Moreover, these operations are happening on sharer side (not helper), and presumably not that often, right? |
For clarity, I think the scope of this work should include a) test suite (including performance), b) some kind of implementation agnostic interface such as that proposed above, c) a versioned JAR containing binaries for common deployment options, d) usage examples. |
Agreed on meeting of 2023-10-17 that @rsinha would produce Java binding via JNI.
The text was updated successfully, but these errors were encountered: