On Fri, Jan 08, 1999 at 15:22:50 +0100, Niels M�ller wrote:
> News in the 1999-01-08 snapshot:
> 
> A new program lsh_writekey to save a generated key pair to disk.

Is lsh_writekey supposed to work already?

On my system, lsh_writekey dumps core. I've tried to track down the problem,
but failed. As far as I've been able to establish, during the run of
dss_nist_gen some of the internal administration of GMP gets corrupted.
Sometime after the call of dss_nist_gen(), it dumps.
When I add a debug_mpz(t) after the call to dss_nist_gen() in lsh_keygen.c,
the dump is in the execution of that (gdb lsh_keygen ; set args -d):
#0  0x40067dae in mpz_sizeinbase ()
#1  0x804c8d0 in write_mpz (n=0x6e222246) at werror.c:299
#2  0x804c975 in debug_mpz (n=0x6e222246) at werror.c:314
#3  0x80494ea in main (argc=2, argv=0xbffff6cc) at lsh_keygen.c:144
Note that t isn't involved in the call at all, and should still be zero.

The thing I understand least about this, is that the value of t (passed into
debug_mpz's n) changes magically:
Breakpoint 1, main (argc=2, argv=0xbffff6cc) at lsh_keygen.c:144
144       debug_mpz(t);
(gdb) p t
$1 = {{_mp_alloc = 1, _mp_size = 0, _mp_d = 0x8056e18}}
(gdb) step
debug_mpz (n=0x15d6dfa9) at werror.c:313
313       if (debug_flag)
(gdb) p n
$2 = (__mpz_struct *) 0x400ffb40
(gdb) p *n
$3 = {_mp_alloc = 134574104, _mp_size = 134574104, _mp_d = 0x400ffb40}

Ray
-- 
ART  A friend of mine in Tulsa, Okla., when I was about eleven years old. 
I'd be interested to hear from him. There are so many pseudos around taking 
his name in vain. 
- The Hipcrime Vocab by Chad C. Mulligan 

Reply via email to