Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Tue, 2 May 2006 21:24:39 +0400
From: Solar Designer <solar@...nwall.com>
To: john-users@...ts.openwall.com
Subject: Re: MinGW build

On Tue, May 02, 2006 at 05:51:18PM +0200, Michal Luczaj wrote:
> Solar Designer wrote:
> > Well, you're still using the return value from clock() to emulate the
> > return value of times().  According to POSIX.1-2001, clock() "shall
> > return the implementation's best approximation to the processor time
> > used by the process ...", whereas times() "shall return the elapsed real
> > time ..."  So this patch looks wrong to me.
> 
> Does it mean that glibc is wrong too? In The GNU C Library at
> http://www.gnu.org/software/libc/manual/html_node/Processor-Time.html I
> red that:
> 
> "The return value [of times()] is the calling process' CPU time (_the
> same value you get from clock()_. times returns (clock_t)(-1) to
> indicate failure."

Yes, the glibc documentation appears to be wrong in this respect.  JtR
and my other programs rely on times(2) returning real time elapsed in
CLK_TCKs or sysconf(_SC_CLK_TCK)s - and this has worked as intended for
many years on many systems, including on glibc.  So it's just a glibc
documentation bug.

> What is more, after running --test, it seemed that everything was fine:
> Benchmarking: Traditional DES [64/64 BS MMX]... DONE
> Many salts:     593832 c/s real, 596535 c/s virtual
> Only one salt:  538966 c/s real, 548912 c/s virtual

Yes, this does look realistic.  Can you please try running two instances
simultaneously to see how the numbers will change?

-- 
Alexander Peslyak <solar at openwall.com>
GPG key ID: B35D3598  fp: 6429 0D7E F130 C13E C929  6447 73C3 A290 B35D 3598
http://www.openwall.com - bringing security into open computing environments

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.