caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: mukesh tiwari <mukeshtiwari.iiitm@gmail.com>
To: "forum@x9c.fr" <forum@x9c.fr>, caml-list@inria.fr
Subject: Re: [Caml-list] Calling Java function from OCaml
Date: Fri, 13 Apr 2018 13:01:07 +1000	[thread overview]
Message-ID: <CAFHZvE9y6hab-Nu5xBhxUVwYZQbT9K4j9LM1zxyy4q+Tk71mSQ@mail.gmail.com> (raw)
In-Reply-To: <6AE89499-0C31-4798-BC90-B5712709E405@x9c.fr>

[-- Attachment #1: Type: text/plain, Size: 3250 bytes --]

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.

I am also wondering if these things (unicrypt functionality of encryption,
decryption and zero knowledge proof) can be realized by CertiCrypt [7] ?

Best regards,
Mukesh Tiwari


[1]
https://github.com/mukeshtiwari/EncryptionSchulze/blob/master/code/ballot_mat.txt
[2] https://nvotes.com/multiplicative-vs-additive-homomorphic-elgamal/
[3] https://github.com/bfh-evg/unicrypt
[4]
https://github.com/mukeshtiwari/EncryptionSchulze/blob/master/code/EncryptionSchulze.v#L713
[5]
https://github.com/mukeshtiwari/EncryptionSchulze/blob/master/code/lib.ml
[6]
https://github.com/mukeshtiwari/EncryptionSchulze/blob/master/code/lib.ml#L74
[7] https://github.com/EasyCrypt

On Fri, Apr 13, 2018 at 4:57 AM, forum@x9c.fr <forum@x9c.fr> wrote:

>
> Le 12 avr. 2018 à 10:40, mukesh tiwari <mukeshtiwari.iiitm@gmail.com> a
> écrit :
>
> Hi Everyone,
> I am trying to call some Java functions from OCaml (Extracted from Coq if
> it matters). I am familiar with ocamljava [1], but it says that "*The
> generated code usually runs faster than OCaml bytecode but slower than
> native code. Memory consumption and startup time are also higher, but
> leveraging the multiple cores of a machine can help reaching the
> performance level of native code.*", and I don't want to leave the OCaml
> native code. One suggestion I got on #ocaml channel is using RPC and a
> quick Google search leads to ocaml-rpc [2].  I am wondering if experts from
> OCaml community could please give me some suggestions.
>
>
> For the record, the performance of ocamljava-compiled code
> heavily depends on the programming style. Numerical imperative
> or i/o-bound code can be on par with ocamlopt-compiled code,
> while code based on exceptions for control flow or abundant indirect
> calls can be slower than ocamlc-compiled code. I am afraid
> extracted code is likely to fall in the second category.
>
> It is also noteworthy that you can run into problems with extracted
> code. I suspect extracted code might contain call to "Obj.magic",
> as the type system of Coq is slightly more powerful than the one
> of OCaml. The issue is that that OCaml-Java uses a different
> memory layout, so that "Obj.magic" might not yield the same result
> as in vanilla OCaml.
>
>
> Best regards,
>
> Xavier Clerc
>
> PS: if you are able to share your code, I might be able to give you
> a less generic assessment.
>

-- 
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

[-- Attachment #2: Type: text/html, Size: 4573 bytes --]

  reply	other threads:[~2018-04-13  3:01 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 [this message]
2018-04-15 18:26     ` forum

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=CAFHZvE9y6hab-Nu5xBhxUVwYZQbT9K4j9LM1zxyy4q+Tk71mSQ@mail.gmail.com \
    --to=mukeshtiwari.iiitm@gmail.com \
    --cc=caml-list@inria.fr \
    --cc=forum@x9c.fr \
    /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).