You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Perl's global var PL_hash_state_w is 24608 bytes long on 32b Win32 blead perl. That is 24608/4096=6.0078 OS pages of memory. I can't imagine 24KB of randomness being somehow more secure than half a KB or 1 KB of randomness. Current TLS 1.3's max is 256 bytes/2048 bits. My/default perl build is using zaphod32+sbox32_hash combo. > 24 input str len is the divider between the 2 algos. Is this massive global var a default config mistake or intentional?
Steps to Reproduce
Check sizeof(PL_hash_state_w) or PERL_HASH_STATE_BYTES. 24608 bytes came from a obj code analyzer that looked at perl541.dll. I didn't look at the code enough to determine why its 24KB. There could be a (PTR_SIZE * 8) * _foo aka (32 * 8) * _foo
vs (4 * 8) * _foo bug somewhere.
Since Perl 5.18 we have included support for multiple hash functions, although from time to time we change which functions we support, and which function is default (currently SBOX+SIPHASH13 on 64 bit builds and SBOX+ZAPHOD32 for 32 bit builds). [...]
SBOX32 requires 1k of storage per character it can hash, and it must populate that storage with 256 32-bit random values as well. [...]
By default Perl will use SBOX32 to hash strings 24 bytes or shorter, you can change this length by setting SBOX32_MAX_LEN to the desired length, with the maximum length being 256. [...]
Description
Perl's global var PL_hash_state_w is 24608 bytes long on 32b Win32 blead perl. That is 24608/4096=6.0078 OS pages of memory. I can't imagine 24KB of randomness being somehow more secure than half a KB or 1 KB of randomness. Current TLS 1.3's max is 256 bytes/2048 bits. My/default perl build is using zaphod32+sbox32_hash combo.
> 24
input str len is the divider between the 2 algos. Is this massive global var a default config mistake or intentional?Steps to Reproduce
Check
sizeof(PL_hash_state_w)
orPERL_HASH_STATE_BYTES
. 24608 bytes came from a obj code analyzer that looked at perl541.dll. I didn't look at the code enough to determine why its 24KB. There could be a(PTR_SIZE * 8) * _foo
aka(32 * 8) * _foo
vs
(4 * 8) * _foo
bug somewhere.Expected behavior
A var much smaller than 24KB.
Perl configuration
The text was updated successfully, but these errors were encountered: