Package com.mku.salmon.transform
Class AesDefaultTransformer
- java.lang.Object
-
- com.mku.salmon.transform.AesCTRTransformer
-
- com.mku.salmon.transform.AesDefaultTransformer
-
- All Implemented Interfaces:
ICTRTransformer
public class AesDefaultTransformer extends AesCTRTransformer
Salmon AES transformer based on the javax.crypto routines.
-
-
Field Summary
-
Fields inherited from class com.mku.salmon.transform.AesCTRTransformer
BLOCK_SIZE, EXPANDED_KEY_SIZE
-
-
Constructor Summary
Constructors Constructor Description AesDefaultTransformer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
decryptData(byte[] srcBuffer, int srcOffset, byte[] destBuffer, int destOffset, int count)
Decrypt the data.int
encryptData(byte[] srcBuffer, int srcOffset, byte[] destBuffer, int destOffset, int count)
Encrypt the data.void
init(byte[] key, byte[] nonce)
Initialize the default Java AES cipher transformer.-
Methods inherited from class com.mku.salmon.transform.AesCTRTransformer
getBlock, getCounter, getExpandedKey, getKey, getNonce, increaseCounter, resetCounter, setExpandedKey, syncCounter
-
-
-
-
Method Detail
-
init
public void init(byte[] key, byte[] nonce)
Initialize the default Java AES cipher transformer.- Specified by:
init
in interfaceICTRTransformer
- Overrides:
init
in classAesCTRTransformer
- Parameters:
key
- The AES256 key to use.nonce
- The nonce to use.- Throws:
SecurityException
- Thrown if there is a security exception
-
encryptData
public int encryptData(byte[] srcBuffer, int srcOffset, byte[] destBuffer, int destOffset, int count)
Encrypt the data.- Parameters:
srcBuffer
- The source byte array.srcOffset
- The source byte offset.destBuffer
- The destination byte array.destOffset
- The destination byte offset.count
- The number of bytes to transform.- Returns:
- The number of bytes transformed.
- Throws:
SecurityException
- Thrown if there is a security exception
-
decryptData
public int decryptData(byte[] srcBuffer, int srcOffset, byte[] destBuffer, int destOffset, int count)
Decrypt the data.- Parameters:
srcBuffer
- The source byte array.srcOffset
- The source byte offset.destBuffer
- The destination byte array.destOffset
- The destination byte offset.count
- The number of bytes to transform.- Returns:
- The number of bytes transformed.
- Throws:
SecurityException
- Thrown if there is a security exception
-
-