Mailing List Archive

Re: [Announce] Libgcrypt 1.3.2 (devel) released
Werner Koch <wk@gnupg.org> writes:

> We are pleased to announce the availability of Libgcrypt 1.3.2.

Thanks! It builds fine here under debian x86 and debian MinGW32+Wine,
including 'make check'.

One nit, under MinGW32+Wine the 'benchmark' self test doesn't print
useful timings. That isn't important, but just in case you hadn't
noticed this and happen to know of a trivial patch to solve it, that
would be great.

MD5 27855594513760256ms 27855594513760256ms 4978691729784832ms
SHA1 27855594513760256ms 27855594513760256ms 4978691729784832ms
RIPEMD160 27855594513760256ms 27855594513760256ms 4978691729784832ms
TIGER192 27855594513760256ms 27855594513760256ms 4978691729784832ms
SHA256 27855594513760256ms 27855594513760256ms 4978691729784832ms
...

As far as I recall, earlier version used to say '0ms' instead, but I may
be mistaken. The difference may be because of wine changes too.
Anyway, not a big deal.

/Simon

_______________________________________________
Gcrypt-devel mailing list
Gcrypt-devel@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gcrypt-devel
Re: [Announce] Libgcrypt 1.3.2 (devel) released [ In reply to ]
On Mon, 3 Dec 2007 12:13, simon@josefsson.org said:

> As far as I recall, earlier version used to say '0ms' instead, but I may
> be mistaken. The difference may be because of wine changes too.
> Anyway, not a big deal.

Well, I fixed the timing code and they give proper results on XP. Thus
I conclude that this is a Wine problem. Find below the relevant code.



Shalom-Salam,

Werner


static void
start_timer (void)
{
#ifdef _WIN32
GetProcessTimes (GetCurrentProcess (),
&started_at.creation_time, &started_at.exit_time,
&started_at.kernel_time, &started_at.user_time);
stopped_at = started_at;
#else
struct tms tmp;

times (&tmp);
started_at = stopped_at = tmp.tms_utime;
#endif
}

static void
stop_timer (void)
{
#ifdef _WIN32
GetProcessTimes (GetCurrentProcess (),
&stopped_at.creation_time, &stopped_at.exit_time,
&stopped_at.kernel_time, &stopped_at.user_time);
#else
struct tms tmp;

times (&tmp);
stopped_at = tmp.tms_utime;
#endif
}

static const char *
elapsed_time (void)
{
static char buf[50];
#if _WIN32
unsigned long long t1, t2, t;

t1 = (((unsigned long long)started_at.kernel_time.dwHighDateTime << 32)
+ started_at.kernel_time.dwLowDateTime);
t1 += (((unsigned long long)started_at.user_time.dwHighDateTime << 32)
+ started_at.user_time.dwLowDateTime);
t2 = (((unsigned long long)stopped_at.kernel_time.dwHighDateTime << 32)
+ stopped_at.kernel_time.dwLowDateTime);
t2 += (((unsigned long long)stopped_at.user_time.dwHighDateTime << 32)
+ stopped_at.user_time.dwLowDateTime);
t = (t2 - t1)/10000;
snprintf (buf, sizeof buf, "%5lums", (unsigned long)t );
#else
snprintf (buf, sizeof buf, "%5.0fms",
(((double) (stopped_at - started_at))/CLOCKS_PER_SEC)*10000000);
#endif
return buf;
}

--
Die Gedanken sind frei. Auschnahme regelt ein Bundeschgesetz.


_______________________________________________
Gcrypt-devel mailing list
Gcrypt-devel@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gcrypt-devel