Top Description Fields Constructors Methods
org.bouncycastle.crypto.macs

public Class SipHash128

extends SipHash
Class Inheritance
Imports
org.bouncycastle.crypto.DataLengthException, org.bouncycastle.util.Pack

Implementation of SipHash with 128 bit output.

Based on the SipHash and the C reference implementation https://github.com/veorq/SipHash.

Field Summary

Inherited from org.bouncycastle.crypto.macs.SipHash:
cdk0k1mv0v1v2v3wordCountwordPos

Constructor Summary

AccessConstructor and Description
public
SipHash128()

SipHash128-2-4

public
SipHash128(int
the number of compression rounds
c
,
int
the number of finalization rounds
d
)

SipHash128-c-d

Method Summary

Modifier and TypeMethod and Description
public long
public int
doFinal(byte[]
the array the MAC is to be output to.
out
,
int
the offset into the out buffer the output is to start at.
outOff
)

Overrides org.bouncycastle.crypto.macs.SipHash.doFinal.

Implements org.bouncycastle.crypto.Mac.doFinal.

Compute the final stage of the MAC writing the output to the out parameter.
public String
getAlgorithmName()

Overrides org.bouncycastle.crypto.macs.SipHash.getAlgorithmName.

Implements org.bouncycastle.crypto.Mac.getAlgorithmName.

Return the name of the algorithm the MAC implements.
public int
getMacSize()

Overrides org.bouncycastle.crypto.macs.SipHash.getMacSize.

Implements org.bouncycastle.crypto.Mac.getMacSize.

Return the block size for this MAC (in bytes).
public void
Inherited from org.bouncycastle.crypto.macs.SipHash:
applySipRoundsinitprocessMessageWordrotateLeftupdateupdate

Constructor Detail

SipHash128back to summary
public SipHash128()

SipHash128-2-4

SipHash128back to summary
public SipHash128(int c, int d)

SipHash128-c-d

Parameters
c:int

the number of compression rounds

d:int

the number of finalization rounds

Method Detail

doFinalback to summary
public long doFinal() throws DataLengthException, IllegalStateException

Overrides org.bouncycastle.crypto.macs.SipHash.doFinal.

doFinalback to summary
public int doFinal(byte[] out, int outOff) throws DataLengthException, IllegalStateException

Overrides org.bouncycastle.crypto.macs.SipHash.doFinal.

Implements org.bouncycastle.crypto.Mac.doFinal.

Doc from org.bouncycastle.crypto.Mac.doFinal.

Compute the final stage of the MAC writing the output to the out parameter.

doFinal leaves the MAC in the same state it was after the last init.

Parameters
out:byte[]

the array the MAC is to be output to.

outOff:int

the offset into the out buffer the output is to start at.

Exceptions
DataLengthException:
if there isn't enough space in out.
IllegalStateException:
if the MAC is not initialised.
getAlgorithmNameback to summary
public String getAlgorithmName()

Overrides org.bouncycastle.crypto.macs.SipHash.getAlgorithmName.

Implements org.bouncycastle.crypto.Mac.getAlgorithmName.

Doc from org.bouncycastle.crypto.Mac.getAlgorithmName.

Return the name of the algorithm the MAC implements.

Returns:String

the name of the algorithm the MAC implements.

getMacSizeback to summary
public int getMacSize()

Overrides org.bouncycastle.crypto.macs.SipHash.getMacSize.

Implements org.bouncycastle.crypto.Mac.getMacSize.

Doc from org.bouncycastle.crypto.Mac.getMacSize.

Return the block size for this MAC (in bytes).

Returns:int

the block size for this MAC in bytes.

resetback to summary
public void reset()

Overrides org.bouncycastle.crypto.macs.SipHash.reset.

Implements org.bouncycastle.crypto.Mac.reset.

Doc from org.bouncycastle.crypto.Mac.reset.

Reset the MAC. At the end of resetting the MAC should be in the in the same state it was after the last init (if there was one).