Re: Libgcrypt (hopefully not OT)

2013-05-06 Thread Werner Koch
On Fri,  3 May 2013 23:27, robe...@broadcom.com said:

> I am using Libgcrypt 1.5.2 with gcc v 4.5.3 on Cygwin to use the MPI
> functions. Can you please provide some guidance on how to handle
> signed and negative MPIs? I cannot seem to get a negative MPI, which

Negative numbers are supported by the MPI subsystem but a rarely used.
There is a macro mpi_is_neg to test for it.  We have no explict function
to negate an MPI.  You would need to resort to somthing like

  void
  make_negative (gcry_mpi_t value)
  {
gcry_mpi_t zero = gcry_mpi_new (0);
gcry_mpi_sub (value, zero, value);
gcry_mpi_release (zero);
  }

Not pretty elegant or fast given that it only needs to toggle a bit.
For the use of some macros the sign bit is exposed, so you could use a
bad hack to do it faster.

> As an alternative,  Is it possible to use the ecc functions with a custom 
> random number generator algorithm?

Are you looking into deterministic DSA, similar to the
draft-pornin-deterministic-dsa-01 I-D?  We recently started a discussion
on gcrypt-de...@gnupg.org about this.  That ML would anyway be a better
place for your questions.


Shalom-Salam,

   Werner

-- 
Die Gedanken sind frei.  Ausnahmen regelt ein Bundesgesetz.


___
Gnupg-users mailing list
Gnupg-users@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnupg-users


Libgcrypt (hopefully not OT)

2013-05-03 Thread Bob (Robert) Cavanaugh
Hi All,

I am using Libgcrypt 1.5.2 with gcc v 4.5.3 on Cygwin to use the MPI functions. 
Can you please provide some guidance on how to handle signed and negative MPIs? 
I cannot seem to get a negative MPI, which is causing problems with other 
computations (specifically gcry_mpi_invm never returns and hangs).

As an alternative,  Is it possible to use the ecc functions with a custom 
random number generator algorithm?

Thanks,
 
Bob Cavanaugh
Broadcom Corporation
16340 West Bernardo Drive
San Diego CA 92127
Work:858-521-5562
Fax: 858-385-8810
Cell:858-361-2068
 


___
Gnupg-users mailing list
Gnupg-users@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnupg-users