The necessary code for MOST platforms is already in OpenSSL

Look for OPENSSL_rdtsc in the crypto. directory.
O.K. Not all platforms have this, but Sparc, x86/x86_64, s390, ppc,
Itanium, apha,PA-RISC , ARM have some variant - admitted, quite a few
hardware variants don't have a TSC, but that's determinable at runtime and
you could drop back to gettimeofday() to cover those.

It's at least "better" than gettimeofday() for this purpose - i.e. most of
the bits can't be determined from outside the box, it moves faster, and
it's cheaper  to read.

Peter




From:   Stephan Mueller <smuel...@chronox.de>
To:     openssl-dev@openssl.org,
Date:   16/01/2014 07:45
Subject:        Re: [PATCH] Reseed PRNG on PID change
Sent by:        owner-openssl-...@openssl.org



Am Donnerstag, 16. Januar 2014, 07:41:21 schrieb Peter Waltenberg:

Hi Peter,

>You have access to high speed event counters on most platforms now.
>Where those are available, use them for reseed data instead of
>gettimeofday(). Far higher resolution, far less performance impact.

That implies, however, either hardware-specific code (i.e. special CPU
instruction) or per operating system specific code (special system call,
library call).

Ciao
Stephan

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       openssl-dev@openssl.org
Automated List Manager                           majord...@openssl.org



______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       openssl-dev@openssl.org
Automated List Manager                           majord...@openssl.org

Reply via email to