Top Description Inners Fields Constructors Methods
org.bouncycastle.crypto.general

public final Class SipHash

extends Object
Class Inheritance
Imports
java.security.SecureRandom, org.bouncycastle.crypto.Algorithm, .AuthenticationParameters, .IllegalKeyException, .SymmetricKey, .SymmetricSecretKey, org.bouncycastle.crypto.internal.KeyGenerationParameters, .Mac, .ValidatedSymmetricKey, org.bouncycastle.crypto.internal.macs.TruncatingMac

Source class for implementations of SipHash based algorithms

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
SipHash.AuthParameters

Parameters for SipHash MAC modes.

public static class
SipHash.KeyGenerator

SipHash key generator.

public static class
SipHash.MACOperatorFactory

Factory for producing SipHash MAC calculators.

Field Summary

Modifier and TypeField and Description
public static final GeneralAlgorithm
public static final GeneralAlgorithm
public static final GeneralAlgorithm

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private static boolean
invalidKeySize(int keyLength)

private static ValidatedSymmetricKey
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ALGORITHMback to summary
public static final GeneralAlgorithm ALGORITHM
SIPHASH_2_4back to summary
public static final GeneralAlgorithm SIPHASH_2_4
SIPHASH_4_8back to summary
public static final GeneralAlgorithm SIPHASH_4_8

Constructor Detail

SipHashback to summary
private SipHash()

Method Detail

invalidKeySizeback to summary
private static boolean invalidKeySize(int keyLength)
validateKeyback to summary
private static ValidatedSymmetricKey validateKey(SymmetricKey key, Parameters parameters)
org.bouncycastle.crypto.general back to summary

public final Class SipHash.AuthParameters

extends GeneralParameters<GeneralAlgorithm>
implements AuthenticationParameters<SipHash.AuthParameters>
Class Inheritance
All Implemented Interfaces
org.bouncycastle.crypto.AuthenticationParameters, org.bouncycastle.crypto.Parameters

Parameters for SipHash MAC modes.

Field Summary

Modifier and TypeField and Description
private final int

Constructor Summary

AccessConstructor and Description
private
AuthParameters(GeneralAlgorithm algorithm, int macSizeInBits)

public
public

Method Summary

Modifier and TypeMethod and Description
public int
getMACSizeInBits()

Implements org.bouncycastle.crypto.AuthenticationParameters.getMACSizeInBits.

Return the size of the MAC these parameters are for.
public SipHash.AuthParameters
withMACSize(int
bit length of the MAC length.
macSizeInBits
)

Implements org.bouncycastle.crypto.AuthenticationParameters.withMACSize.

Create a parameter set with the specified MAC size associated with it.
Inherited from org.bouncycastle.crypto.general.GeneralParameters:
getAlgorithm

Field Detail

macSizeInBitsback to summary
private final int macSizeInBits

Constructor Detail

AuthParametersback to summary
private AuthParameters(GeneralAlgorithm algorithm, int macSizeInBits)
AuthParametersback to summary
public AuthParameters()
AuthParametersback to summary
public AuthParameters(GeneralAlgorithm algorithm)

Method Detail

getMACSizeInBitsback to summary
public int getMACSizeInBits()

Implements org.bouncycastle.crypto.AuthenticationParameters.getMACSizeInBits.

Doc from org.bouncycastle.crypto.AuthenticationParameters.getMACSizeInBits.

Return the size of the MAC these parameters are for.

Returns:int

the MAC size in bits.

withMACSizeback to summary
public SipHash.AuthParameters withMACSize(int macSizeInBits)

Implements org.bouncycastle.crypto.AuthenticationParameters.withMACSize.

Doc from org.bouncycastle.crypto.AuthenticationParameters.withMACSize.

Create a parameter set with the specified MAC size associated with it.

Parameters
macSizeInBits:int

bit length of the MAC length.

Returns:SipHash.AuthParameters

the new parameter set.

org.bouncycastle.crypto.general back to summary

public final Class SipHash.KeyGenerator

extends GuardedSymmetricKeyGenerator
Class Inheritance

SipHash key generator.

Field Summary

Modifier and TypeField and Description
private final GeneralAlgorithm
private final SecureRandom

Constructor Summary

AccessConstructor and Description
public
public

Method Summary

Modifier and TypeMethod and Description
public SymmetricKey
Inherited from org.bouncycastle.crypto.general.GuardedSymmetricKeyGenerator:
generateKey

Field Detail

algorithmback to summary
private final GeneralAlgorithm algorithm
randomback to summary
private final SecureRandom random

Constructor Detail

KeyGeneratorback to summary
public KeyGenerator(SecureRandom random)
KeyGeneratorback to summary
public KeyGenerator(GeneralAlgorithm algorithm, SecureRandom random)

Method Detail

doGenerateKeyback to summary
public SymmetricKey doGenerateKey()

Implements abstract org.bouncycastle.crypto.general.GuardedSymmetricKeyGenerator.doGenerateKey.

org.bouncycastle.crypto.general back to summary

public final Class SipHash.MACOperatorFactory

extends GuardedMACOperatorFactory<SipHash.AuthParameters>
Class Inheritance

Factory for producing SipHash MAC calculators.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected int
protected Mac
private Mac
Inherited from org.bouncycastle.crypto.general.GuardedMACOperatorFactory:
createOutputMACCalculator

Constructor Detail

MACOperatorFactoryback to summary
public MACOperatorFactory()

Method Detail

calculateMACSizeback to summary
protected int calculateMACSize(SipHash.AuthParameters parameters)

Implements abstract org.bouncycastle.crypto.general.GuardedMACOperatorFactory.calculateMACSize.

Annotations
@Override
createMACback to summary
protected Mac createMAC(SymmetricKey key, final SipHash.AuthParameters parameters)

Implements abstract org.bouncycastle.crypto.general.GuardedMACOperatorFactory.createMAC.

Annotations
@Override
getMacback to summary
private Mac getMac(SipHash.AuthParameters parameters)