Close

gPEAC-LEA19

A project log for PEAC Pisano with End-Around Carry algorithm

Add X to Y and Y to X, says the song. And carry on.

yann-guidon-ygdesYann Guidon / YGDES 11/29/2025 at 11:040 Comments

The modulus 741454 is excellent but it can be made more so.

Log 172. Hashing with PEAC39/2 has great info but let's consider something else: the LEAQ opcode on x86-64. This can compute something like x = y + (z×8) + const in a single cycle.

Which is awesome because if we have x using 16 bits, the ×8 does a <<3 and x  now gets 19 bits.

In fact 65535×9=589815 < 741454

741454 - 589815 = 151639 > 2^17

So the constant/offset is smaller now and the avalanche is much better because the input will affect the MSB sooner.

There is not even a need to select a prime number since it wouldn't change the orbit length when x=0. A bit pattern like 0x17777 (=96119) works just as well.

Discussions