[Swan-dev] hash table size and hash

Paul Wouters paul at nohats.ca
Wed Oct 18 18:03:49 UTC 2017


On Wed, 18 Oct 2017, Andrew Cagney wrote:

> these use: 
> 
>         for (j = 0; j < COOKIE_SIZE; j++)
>                 i = i * 407 + icookie[j] + rcookie[j];
> 
> where 407 isn't prime (does anyone know where 407 came from? if not I'll change that to a prime 521 which I'm choosing randomly) and
> I'll change the math to:

It was already in freeswan-1.97 (and possibly older)

https://download.libreswan.org/old-freeswan/old/freeswan-1.97/pluto/state.c

Paul


More information about the Swan-dev mailing list