On Mon, Feb 28, 2011 at 9:03 AM, Jean-Marc Desperrier <jmd...@gmail.com> wrote: > Hi, > > There was some talk last october about accessing the mp_int API from > javascript, and so freezing it in order to make it available as a frozen > API. > > Nelson concluded that the one difficult point would be to freeze the mpdigit > structure, since it currently has machine/processor-version dependent > definitions. > > I just got interested in trying to revive this subject. > First, what should serve as the reference definition of the mp_int API ? > Would it be just > http://mxr.mozilla.org/security/source/security/nss/lib/freebl/mpi/mpi.h ?
I guess that's the file. You may need to download the original MPI distribution and find out which headers are considered the public header. > Second, at one point I found this > http://swtch.com/plan9port/man/man3/mp.html which not in fact exactly the > same API, but which gave me an interesting idea as inside it the mpint > functions are completely separated from the mpdigit functions. > > What not use as a public freezed API a version of the API that simply > removes everything that uses mp_digit ? > mp_digit is only an optimization in case the manipulated number is small, I > believe that in many cases this optimization is not very significant. Not > using it in the public API would not really have a performance impact, and > would make things much easier I believe. If you make the mp_int structure opaque, you won't need to expose the mp_digit type. So this is certainly a viable solution. The downside is that you won't be able to allocate mp_int local variables; everything mp_int variable needs to be allocated from the heap. Wan-Teh -- dev-tech-crypto mailing list dev-tech-crypto@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-tech-crypto