java.lang.Object
net.i2p.crypto.SipHashInline
SipHash implementation with hand inlining the SIPROUND.
To know details about SipHash, see; "a fast short-input PRF" https://www.131002.net/siphash/
SIPROUND is defined in siphash24.c that can be downloaded from the above site. Following license notice is subject to change based on the licensing policy of siphash24.c.
I2P mods: add off/len version
For constant keys see net.i2p.util.SipHash.
Constructor Summary
ConstructorsMethod Summary
All MethodsModifier and TypeMethodDescriptionstatic longhash24(long k0, long k1, byte[] data) Hash the whole ofdatawith SipHash-2-4 under a 16 byte key split across two longs.static longhash24(long k0, long k1, byte[] data, int off, int len) Hash a slice ofdatawith SipHash-2-4 under a 16 byte key split across two longs.
Constructor Details
SipHashInline
private SipHashInline()Static class, no instances.
Method Details
hash24
public static long hash24(long k0, long k1, byte[] data) Hash the whole ofdatawith SipHash-2-4 under a 16 byte key split across two longs.- Parameters:
k0- the first 8 bytes of the keyk1- the last 8 bytes of the keydata- the bytes to hash- Returns:
- the 64-bit SipHash-2-4 output
hash24
public static long hash24(long k0, long k1, byte[] data, int off, int len) Hash a slice ofdatawith SipHash-2-4 under a 16 byte key split across two longs. Bytes outside the slice are ignored, so a message may be hashed in place without copying it.- Parameters:
k0- the first 8 bytes of the keyk1- the last 8 bytes of the keydata- the buffer holding the messageoff- index of the first message byte to absorblen- number of message bytes to absorb starting at off- Returns:
- the 64-bit SipHash-2-4 output