[OTR-dev] Re: Libgcrypt slowness in generation of keys

Twan Fox twanfox at gmail.com
Wed Apr 19 23:08:34 EDT 2006

Ian Goldberg wrote:
> On Wed, Apr 19, 2006 at 08:49:32PM -0500, Twan Fox wrote:
>> All,
>> I might've been slightly hasty in my prior posting. Seems a full clean 
>> and rebuild of my plugin brought the time down to something more 
>> reasonable (sub-60 seconds or so), though part of me is a little 
>> bothered still by the way it the program was made unresponsive during 
>> the entropy gathering phase of the key generation.
> If your UI thread is the one doing the key generation, then it will
> naturally make the app unresponsive.  Just do appropriate locking in a
> separate thread.
> But 60 seconds still seems crazy.  What happens if you just make a
> trivially small app that just calls otrl_privkey_generate with
> appropriate arguments?  Can you track down what's causing the problem?
A trivially small app generates a key file pretty fast. I'd say around 5 
seconds or so. It was a debug variant of the program, and for some 
reason, the libgcrypt program makes use of a set of dummy va_list args 
for one of it's calls when generating a key. Sends pop-up messages that 
kind of disrupt the process of generation and make accurate timekeeping 
difficult. I rebuilt the libraries (libgpg-error, libgcrypt, libotr) as 
a release version and compiled my plugin as a release version. 
Eliminating the pop-up warnings, I think it takes somewhere on the order 
of 10 seconds to generate a key for one account.


   |----> Plugins loaded:
                AIM/ICQ medium plugin
                Audio/Video Plugin (default)
                Trillian OTR plugin

A pretty lean environment to test in. When I said 'sub-60 seconds,' I 
was making an out of my rear guestimation. It was no more than 60 
seconds, but it was long enough for me to have noticed. I think 10 
seconds is acceptable for key generation. I'm not sure what Gaim OTR's 
lag is on it. And, while I'd love to thread the key generation off into 
something behind the scenes, I'm not entirely sure just how, within 
Windows. :(

Once again, this looks like it is programmer error, with the programmer 
being me.


More information about the OTR-dev mailing list