agora inbox for pgsql-hackers@postgresql.org  
help / color / mirror / Atom feed
From: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>
To: Peter Eisentraut <peter@eisentraut.org>
Cc: Daniel Gustafsson <daniel@yesql.se>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: pgcrypto: remove useless px_memset() and BF_ASM
Date: Tue, 01 Sep 2026 13:35:29 +0100
Message-ID: <87zey1xi7i.fsf@wibble.ilmari.org> (raw)
In-Reply-To: <71e4b3c9-571f-49d3-881d-0f40b0ca55eb@eisentraut.org>
References: <87ldew2yqu.fsf@wibble.ilmari.org>
	<9B96C179-32FA-4715-BC26-4E31D9EFF3A2@yesql.se>
	<71e4b3c9-571f-49d3-881d-0f40b0ca55eb@eisentraut.org>

Peter Eisentraut <peter@eisentraut.org> writes:

> On 09.04.26 21:07, Daniel Gustafsson wrote:
>>> On 9 Apr 2026, at 13:51, Dagfinn Ilmari Mannsåker <ilmari@ilmari.org> wrote:
>> 
>>> In the thread about centralised architecture detection, I noticed
>>> that the BF_ASM macro in crypt-blowfish.c has never been defined to
>>> anything but 0, and the _BF_body_r() function it would call has
>>> never existed, so that can be got rid of.
>> Agreed.  I didn't do enough archaeology to figure out what upstream
>> has/had or why it was removed, but it's been dead for 25 odd years so
>> it's about time to remove.
>> 
>>> While investigating at that, I also noticed that px_memset(), which
>>> has the comment /* memset that must not be optimized away */, is
>>> only ever called with zero for the value, which could be better
>>> written with explicit_bzero() now that we have that.
>> One could imagine various tricks for rewriting px_memset to
>> explicit_bzero in order to reduce the churn, but since this code is
>> very rarely backpatched into it's not a big problem IMHO.
>
> I have committed these two patches.  One of them was also discussed in
> another thread, but I have co-credited this thread.

Thanks!

- ilmari






view thread (4+ messages)

Message-ID: <87zey1xi7i.fsf@wibble.ilmari.org>
Permalink:  ../87zey1xi7i.fsf@wibble.ilmari.org/
Also on:    postgresql.org/message-id/87zey1xi7i.fsf@wibble.ilmari.org

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: ilmari@ilmari.org, peter@eisentraut.org, daniel@yesql.se, pgsql-hackers@lists.postgresql.org
  Subject: Re: pgcrypto: remove useless px_memset() and BF_ASM
  In-Reply-To: <87zey1xi7i.fsf@wibble.ilmari.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox