Class SP80038FWrapEngine
- java.lang.Object
-
- org.bouncycastle.crypto.internal.wrappers.SP80038FWrapEngine
-
- All Implemented Interfaces:
Wrapper
public final class SP80038FWrapEngine extends java.lang.Objectan implementation of the AES Key Wrapper from the NIST Key Wrap Specification as described in RFC 3394/SP800-38F.For further details see: http://www.ietf.org/rfc/rfc3394.txt and http://csrc.nist.gov/encryption/kms/key-wrap.pdf.
-
-
Field Summary
Fields Modifier and Type Field Description protected intdeltaprotected BlockCipherengineprotected booleanforWrappingprotected byte[]ivprotected static byte[]ivKWprotected static byte[]ivKWPprotected KeyParameterparamprotected booleanwrapCipherMode
-
Constructor Summary
Constructors Constructor Description SP80038FWrapEngine(BlockCipher engine, boolean useReverseDirection)Create a RFC 3394 WrapEngine specifying the direction for wrapping and unwrapping..
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetAlgorithmName()Return the name of the algorithm the wrapper implements.voidinit(boolean forWrapping, CipherParameters param)protected voidinvW(int n, byte[] block, byte[] a)byte[]unwrap(byte[] in, int inOff, int inLen)protected byte[]W(int n, byte[] block)byte[]wrap(byte[] in, int inOff, int inLen)
-
-
-
Field Detail
-
ivKW
protected static final byte[] ivKW
-
ivKWP
protected static final byte[] ivKWP
-
wrapCipherMode
protected final boolean wrapCipherMode
-
engine
protected final BlockCipher engine
-
delta
protected final int delta
-
iv
protected final byte[] iv
-
param
protected KeyParameter param
-
forWrapping
protected boolean forWrapping
-
-
Constructor Detail
-
SP80038FWrapEngine
public SP80038FWrapEngine(BlockCipher engine, boolean useReverseDirection)
Create a RFC 3394 WrapEngine specifying the direction for wrapping and unwrapping..- Parameters:
engine- the block cipher to be used for wrapping.useReverseDirection- true if engine should be used in decryption mode for wrapping, false otherwise.
-
-
Method Detail
-
getAlgorithmName
public java.lang.String getAlgorithmName()
Description copied from interface:WrapperReturn the name of the algorithm the wrapper implements.- Returns:
- the name of the algorithm the wrapper implements.
-
wrap
public byte[] wrap(byte[] in, int inOff, int inLen)
-
unwrap
public byte[] unwrap(byte[] in, int inOff, int inLen) throws InvalidCipherTextException- Throws:
InvalidCipherTextException
-
init
public void init(boolean forWrapping, CipherParameters param)
-
W
protected byte[] W(int n, byte[] block)
-
invW
protected void invW(int n, byte[] block, byte[] a)
-
-