Re: Support getrandom() for pg_strong_random() source - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: Support getrandom() for pg_strong_random() source
Date
Msg-id 675a70ab-9657-4bd6-876f-b8d01f8e24b7@eisentraut.org
Whole thread Raw
In response to Re: Support getrandom() for pg_strong_random() source  (Jacob Champion <jacob.champion@enterprisedb.com>)
Responses Re: Support getrandom() for pg_strong_random() source
List pgsql-hackers
On 30.07.25 18:13, Jacob Champion wrote:
> On Wed, Jul 30, 2025 at 4:09 AM Peter Eisentraut<peter@eisentraut.org> wrote:
>> The POSIX description of getentropy() says:
>>
>> "The intended use of this function is to create a seed for other
>> pseudo-random number generators."
>>
>> So using getentropy() for generating the random numbers that are passed
>> back to the application code would appear to be the wrong use.
> What are the situations in which a stream of numbers would be suitable
> for seeding a CSPRNG, but not suitable as output from a CSPRNG?

I imagine a "get entropy" operation could be very slow or even blocking, 
whereas a random number generator might just have to do some arithmetic 
starting from the previous seed state.

I mean, they called it "get entropy", not "get random", for a reason?




pgsql-hackers by date:

Previous
From: Andrei Lepikhov
Date:
Subject: Re: track generic and custom plans in pg_stat_statements
Next
From: Álvaro Herrera
Date:
Subject: Re: pg_dump --with-* options