From bd07457f3410fa8086bcd7f7fa4d226b6152e210 Mon Sep 17 00:00:00 2001 From: JP Aumasson Date: Sat, 8 Nov 2014 18:43:13 +0100 Subject: experimental 128-bit mode --- siphash24.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'siphash24.c') diff --git a/siphash24.c b/siphash24.c index a260dcb..350433f 100644 --- a/siphash24.c +++ b/siphash24.c @@ -70,6 +70,10 @@ int siphash( unsigned char *out, const unsigned char *in, unsigned long long in v1 ^= k1; v0 ^= k0; +#ifdef DOUBLE + v1 ^= 0xee; +#endif + for ( ; in != end; in += 8 ) { m = U8TO64_LE( in ); @@ -124,12 +128,27 @@ int siphash( unsigned char *out, const unsigned char *in, unsigned long long in printf( "(%3d) v2 %08x %08x\n", ( int )inlen, ( u32 )( v2 >> 32 ), ( u32 )v2 ); printf( "(%3d) v3 %08x %08x\n", ( int )inlen, ( u32 )( v3 >> 32 ), ( u32 )v3 ); #endif + +#ifndef DOUBLE v2 ^= 0xff; +#else + v2 ^= 0xee; +#endif for( i=0; i