On 02/28/2011 09:03 AM, Jean-Marc Desperrier 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.
We currently don't even expose the mpi API for good reason. About the only use I could reasonable see for it would be to support PKCS #11 modules. I would not support exposing it for general applications. > > 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 > ? The API was not designed to be an ABI freezable interface. Performance is critical, and applications are not allowed to use it. If we were to export it (for the above purpose), we really would need to design an ABI freezable interface with things like opaque equivalents to mp_ints -- which means you couldn't allocate them on the stack like we typically do in freebl. > > 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. What use are you planning of making of the API? bob
-- dev-tech-crypto mailing list dev-tech-crypto@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-tech-crypto