caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "forum@x9c.fr" <forum@x9c.fr>
To: mukesh tiwari <mukeshtiwari.iiitm@gmail.com>
Cc: Xavier Clerc <forum@x9c.fr>, caml-list@inria.fr
Subject: Re: [Caml-list] Calling Java function from OCaml
Date: Sun, 15 Apr 2018 19:26:31 +0100	[thread overview]
Message-ID: <747DAA0C-B1C9-4ECF-A3D2-3AEBF2D42604@x9c.fr> (raw)
In-Reply-To: <CAFHZvE9y6hab-Nu5xBhxUVwYZQbT9K4j9LM1zxyy4q+Tk71mSQ@mail.gmail.com>


> Le 13 avr. 2018 à 04:01, mukesh tiwari <mukeshtiwari.iiitm@gmail.com> a écrit :
> 
> Hi Xavier, and Gabriel,
> Thank you very much for reply. Let me give me general understanding of my project. I am trying to count encrypted ballots (Additive Elgamal) which is matrix of ciphertext. We multiply these ballots (matrices) point wise and decrypt it to get additive final value in plaintext [2]. For encryption, decryption and zero knowledge proof, we are using unicrypt library [3]. You can see the encryption part in Coq as Axiom [4] and will be realized by java functions from unicrypt library in extracted OCaml code [5].  We will replace the Z [6] with big_int in OCaml. 

Thanks for sharing the details.

I am afraid OCaml-Java might not be a good fit, for at least two
(related) reasons:
  - the implementation of `big_int` that ships with OCaml-Java
    has been very lightly tested, and I would not be surprised if
    it turned out to be buggy;
  - if you do not replace type `z` with  `big_int` your code will be
    unbearably slow (it, of course, applies to both ocamlopt- and
    ocamljava-compiled code, but the price of allocating short-lived
    object is significantly higher on the JVM).

Obviously, another possibility would be to use BigIntegers from
the JDK [1]. It looks like the class contains all the primitives you
need (I only skimmed over `lib.ml`, though).


Best regards,

Xavier Clerc

[1] https://docs.oracle.com/javase/7/docs/api/java/math/BigInteger.html


-- 
Caml-list mailing list.  Subscription management and archives:
https://sympa.inria.fr/sympa/arc/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

      reply	other threads:[~2018-04-15 18:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-12  9:40 mukesh tiwari
2018-04-12 10:00 ` Gabriel Scherer
2018-04-12 19:06   ` forum
2018-04-12 18:57 ` forum
2018-04-13  3:01   ` mukesh tiwari
2018-04-15 18:26     ` forum [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=747DAA0C-B1C9-4ECF-A3D2-3AEBF2D42604@x9c.fr \
    --to=forum@x9c.fr \
    --cc=caml-list@inria.fr \
    --cc=mukeshtiwari.iiitm@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).