Robert Relyea wrote:
About the
only use I could reasonable see for it would be to support PKCS #11
modules.
The other use would be as an optimized base for a big num
implementation, and that's what the original distribution says : "ANSI C
code library that performs arbitrary precision integer arithmetic
functions" ( http://spinning-yarns.org/michael/mpi/#what ).
If you want to have big nums, it's a bit stupid to separately implement
something that is in fact functionally equivalent to mpi.h
we really would need to design an ABI
freezable interface with things like opaque equivalents to mp_ints --
It can be just handling "mp_int *" as an opaque pointer.
which means you couldn't allocate them on the stack like we typically do
in freebl.
You're right, the current ABI can't be used as is, it would be needed to
add "mp_int* mp_new(int n)" and "void mp_free(mp_int *b)".
In answer to WTC's message :
> 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.
Which is here : http://spinning-yarns.org/michael/mpi/#where. It's
almost 100% identical to the mpi.h inside, so it's not easier to make it
opaque. OTOH the steps are just making "mp_int *" opaque, excluding the
mp_digit functions, adding mp_new/mp_free, it's not *big*.
--
dev-tech-crypto mailing list
dev-tech-crypto@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-tech-crypto