public inbox for [email protected]
help / color / mirror / Atom feedpgcrypto: remove useless px_memset() and BF_ASM
2+ messages / 2 participants
[nested] [flat]
* pgcrypto: remove useless px_memset() and BF_ASM
@ 2026-04-09 10:51 Dagfinn Ilmari Mannsåker <[email protected]>
2026-04-09 19:07 ` Re: pgcrypto: remove useless px_memset() and BF_ASM Daniel Gustafsson <[email protected]>
0 siblings, 1 reply; 2+ messages in thread
From: Dagfinn Ilmari Mannsåker @ 2026-04-09 10:51 UTC (permalink / raw)
To: [email protected]
Hi Hackers,
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.
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.
Attached are patches for both.
- ilmari
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: pgcrypto: remove useless px_memset() and BF_ASM
2026-04-09 10:51 pgcrypto: remove useless px_memset() and BF_ASM Dagfinn Ilmari Mannsåker <[email protected]>
@ 2026-04-09 19:07 ` Daniel Gustafsson <[email protected]>
0 siblings, 0 replies; 2+ messages in thread
From: Daniel Gustafsson @ 2026-04-09 19:07 UTC (permalink / raw)
To: Dagfinn Ilmari Mannsåker <[email protected]>; +Cc: [email protected]
> On 9 Apr 2026, at 13:51, Dagfinn Ilmari Mannsåker <[email protected]> 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'll have another look with fresh eyes once back in the office.
--
Daniel Gustafsson
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2026-04-09 19:07 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-04-09 10:51 pgcrypto: remove useless px_memset() and BF_ASM Dagfinn Ilmari Mannsåker <[email protected]>
2026-04-09 19:07 ` Daniel Gustafsson <[email protected]>
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox