Low-level logical functions?

Barukh Ziv barukh.ziv at gmail.com
Sun Nov 8 20:00:23 CET 2009


Hi,

Continuing on the usage of Low-level functions, here's another question:
many low-level functions (described in Chapter 8 of the Manual), get
pointers to mpn_lib_t structure, that is, big number's raw data. The
question is: how these pointers may be obtained in the first place? I see 2
possibilities:

1. Using export() function, which may require unnecessary copying.
2. Using "Internals" (chapter 17), which is declared as being informatory
only, without any compatibility considerations.

Are there other ways to do this, which are both secure and efficient?

Regards,
Barukh.

On Sat, Nov 7, 2009 at 8:23 PM, Torbjorn Granlund <tg at gmplib.org> wrote:

> Barukh Ziv <barukh.ziv at gmail.com> writes:
>
>  If I understand correctly, internal functions cannot be called from
> outside
>  code?
>
> In this case, they will not always be visible from outside code, since
> they become macros unless written in assembly.
>
> But most internal functions can be called, but user code that does that
> works with just certain GMP releases.
>
>  Is there any planned date for v4.4 release?
>
> We haven't planned a date, but a planned set of features.
>
>  If you permit, I would like to ask another question: it looks like it may
> be
>  beneficial to have carry-less arithmetic over integers in GMP. An
> important
>  application of this is arithmetic over GF(2^m) (so called binary fields),
>  which are important in Elliptic Curve Cryptography (ECC).
>
>  It is true that cary-less addition/subtraction may be efficiently
>  implemented by means of logical XOR. It's not the case for the
>  multiplicaition, though. Using hardware support, this may be greatly
>  optimized. Here's the message I received from Alfred Menezes, one of
> leading
>  specialists in ECC:
>  "Intel announced in 2008 that their future processors would be equipped
> with
>  a "PCLMULQDQ" instruction ...
>
>  As far as I know, a processor supporting the above instruction, is already
>  in the market.
>
> I thought that instruction was still about a year into the future.
>
> In the meantime, one should be able to get decent speed by spreading out
> the GF(2) coeffients with 3 zero guard bits between each coeffient.
> Each multiplication would need a MUL and two AND.  Actually, the AND
> can be executed lazily.
>
> You might want to take a look at Pierrick Gaudry's and Emmanuel Thomé's
> MPFQ library, http://mpfq.gforge.inria.fr/.  I haven't looked it myself,
> but these are clever guys.
>
> --
> Torbjörn
>


More information about the gmp-discuss mailing list