Rand_status so slow on windows

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Rand_status so slow on windows

Duane Storey

Anyone know why rand_status is so slow on windows?  Any suggestions how to speed it up?

 

 

CONFIDENTIALITY NOTICE

This email and any files transmitted with it contains proprietary information and, unless expressly stated otherwise, all contents and attachments are confidential. This email is intended for the addressee(s) only and access by anyone else is unauthorized. If you are not an addressee, any disclosure, distribution, printing or copying of the contents of this email or its attachments, or any action taken in reliance on it, is unauthorized and may be unlawful. If you are not an addressee, please inform the sender immediately and then delete this email and any copies of it. Thank you for your co-operation.

 

Reply | Threaded
Open this post in threaded view
|

RE: Rand_status so slow on windows

Steven Reddie
RAND_status will trigger seeding of the PRNG if it has not been initialised.  On Windows the entropy gathering can take a long time due to the heap walking and performance counter accesses.  Whether it completes in a reasonable time or takes much longer can depend on current system activity and what performance counters have been installed.  Although adding entropy data with RAND_add increments the entropy count it doesn't set the initialized flag that rand_status uses.  I believe the only ways to fix this are:
1. Drop in your own PRNG implementation with RAND_set_rand_method
2. Drop in your own ENGINE that provides a PRNG implementation with RAND_set_rand_engine
3. Change the OpenSSL source code


From: [hidden email] [mailto:[hidden email]] On Behalf Of Duane Storey
Sent: Friday, 21 October 2005 10:10 AM
To: [hidden email]
Subject: Rand_status so slow on windows

Anyone know why rand_status is so slow on windows?  Any suggestions how to speed it up?

 

 

CONFIDENTIALITY NOTICE

This email and any files transmitted with it contains proprietary information and, unless expressly stated otherwise, all contents and attachments are confidential. This email is intended for the addressee(s) only and access by anyone else is unauthorized. If you are not an addressee, any disclosure, distribution, printing or copying of the contents of this email or its attachments, or any action taken in reliance on it, is unauthorized and may be unlawful. If you are not an addressee, please inform the sender immediately and then delete this email and any copies of it. Thank you for your co-operation.

 

Reply | Threaded
Open this post in threaded view
|

RE: Rand_status so slow on windows

Duane Storey

I find even using rand_load_file doesn’t set the state to initialized.. i.e. calling rand_status still causes that huge lag to occur.. can anyone recommend any code changes that may speed this up?

 

Thanks.

 

CONFIDENTIALITY NOTICE

This email and any files transmitted with it contains proprietary information and, unless expressly stated otherwise, all contents and attachments are confidential. This email is intended for the addressee(s) only and access by anyone else is unauthorized. If you are not an addressee, any disclosure, distribution, printing or copying of the contents of this email or its attachments, or any action taken in reliance on it, is unauthorized and may be unlawful. If you are not an addressee, please inform the sender immediately and then delete this email and any copies of it. Thank you for your co-operation.


From: [hidden email] [mailto:[hidden email]] On Behalf Of Steven Reddie
Sent: Thursday, October 20, 2005 7:41 PM
To: [hidden email]
Subject: RE: Rand_status so slow on windows

 

RAND_status will trigger seeding of the PRNG if it has not been initialised.  On Windows the entropy gathering can take a long time due to the heap walking and performance counter accesses.  Whether it completes in a reasonable time or takes much longer can depend on current system activity and what performance counters have been installed.  Although adding entropy data with RAND_add increments the entropy count it doesn't set the initialized flag that rand_status uses.  I believe the only ways to fix this are:

1. Drop in your own PRNG implementation with RAND_set_rand_method

2. Drop in your own ENGINE that provides a PRNG implementation with RAND_set_rand_engine

3. Change the OpenSSL source code

 


From: [hidden email] [mailto:[hidden email]] On Behalf Of Duane Storey
Sent: Friday, 21 October 2005 10:10 AM
To: [hidden email]
Subject: Rand_status so slow on windows

Anyone know why rand_status is so slow on windows?  Any suggestions how to speed it up?

 

 

CONFIDENTIALITY NOTICE

This email and any files transmitted with it contains proprietary information and, unless expressly stated otherwise, all contents and attachments are confidential. This email is intended for the addressee(s) only and access by anyone else is unauthorized. If you are not an addressee, any disclosure, distribution, printing or copying of the contents of this email or its attachments, or any action taken in reliance on it, is unauthorized and may be unlawful. If you are not an addressee, please inform the sender immediately and then delete this email and any copies of it. Thank you for your co-operation.

 

Reply | Threaded
Open this post in threaded view
|

RE: Rand_status so slow on windows

Steven Reddie
Yes, that's right.  The initialized flag is local to the module that it is in and is only set when calling RAND_status and I think one other function (maybe RAND_get_bytes).  If you wish to modify the OpenSSL code directly you could get rid of the "if (!initialized)" test and rely only on the "if (entropy_gatherered < ENTROPY_NEEDED)"statement that follows it.


From: [hidden email] [mailto:[hidden email]] On Behalf Of Duane Storey
Sent: Friday, 21 October 2005 2:42 PM
To: [hidden email]
Subject: RE: Rand_status so slow on windows

I find even using rand_load_file doesn’t set the state to initialized.. i.e. calling rand_status still causes that huge lag to occur.. can anyone recommend any code changes that may speed this up?

 

Thanks.

 

CONFIDENTIALITY NOTICE

This email and any files transmitted with it contains proprietary information and, unless expressly stated otherwise, all contents and attachments are confidential. This email is intended for the addressee(s) only and access by anyone else is unauthorized. If you are not an addressee, any disclosure, distribution, printing or copying of the contents of this email or its attachments, or any action taken in reliance on it, is unauthorized and may be unlawful. If you are not an addressee, please inform the sender immediately and then delete this email and any copies of it. Thank you for your co-operation.


From: [hidden email] [mailto:[hidden email]] On Behalf Of Steven Reddie
Sent: Thursday, October 20, 2005 7:41 PM
To: [hidden email]
Subject: RE: Rand_status so slow on windows

 

RAND_status will trigger seeding of the PRNG if it has not been initialised.  On Windows the entropy gathering can take a long time due to the heap walking and performance counter accesses.  Whether it completes in a reasonable time or takes much longer can depend on current system activity and what performance counters have been installed.  Although adding entropy data with RAND_add increments the entropy count it doesn't set the initialized flag that rand_status uses.  I believe the only ways to fix this are:

1. Drop in your own PRNG implementation with RAND_set_rand_method

2. Drop in your own ENGINE that provides a PRNG implementation with RAND_set_rand_engine

3. Change the OpenSSL source code

 


From: [hidden email] [mailto:[hidden email]] On Behalf Of Duane Storey
Sent: Friday, 21 October 2005 10:10 AM
To: [hidden email]
Subject: Rand_status so slow on windows

Anyone know why rand_status is so slow on windows?  Any suggestions how to speed it up?

 

 

CONFIDENTIALITY NOTICE

This email and any files transmitted with it contains proprietary information and, unless expressly stated otherwise, all contents and attachments are confidential. This email is intended for the addressee(s) only and access by anyone else is unauthorized. If you are not an addressee, any disclosure, distribution, printing or copying of the contents of this email or its attachments, or any action taken in reliance on it, is unauthorized and may be unlawful. If you are not an addressee, please inform the sender immediately and then delete this email and any copies of it. Thank you for your co-operation.