
org.spongycastle.crypto.params.TweakableBlockCipherParameters Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of core Show documentation
Show all versions of core Show documentation
Spongy Castle is a package-rename (org.bouncycastle.* to org.spongycastle.*) of Bouncy Castle
intended for the Android platform. Android unfortunately ships with a stripped-down version of
Bouncy Castle, which prevents easy upgrades - Spongy Castle overcomes this and provides a full,
up-to-date version of the Bouncy Castle cryptographic libs.
package org.spongycastle.crypto.params;
import org.spongycastle.crypto.CipherParameters;
import org.spongycastle.util.Arrays;
/**
* Parameters for tweakable block ciphers.
*/
public class TweakableBlockCipherParameters
implements CipherParameters
{
private final byte[] tweak;
private final KeyParameter key;
public TweakableBlockCipherParameters(final KeyParameter key, final byte[] tweak)
{
this.key = key;
this.tweak = Arrays.clone(tweak);
}
/**
* Gets the key.
*
* @return the key to use, or null
to use the current key.
*/
public KeyParameter getKey()
{
return key;
}
/**
* Gets the tweak value.
*
* @return the tweak to use, or null
to use the current tweak.
*/
public byte[] getTweak()
{
return tweak;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy