Package com.mku.salmon.transform
Class SalmonAesIntrTransformer
java.lang.Object
com.mku.salmon.transform.SalmonAES256CTRTransformer
com.mku.salmon.transform.SalmonNativeTransformer
com.mku.salmon.transform.SalmonAesIntrTransformer
- All Implemented Interfaces:
ISalmonCTRTransformer
Salmon AES transformer implemented with AES intrinsics.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
The constant to pass to the native code while initializing.Fields inherited from class com.mku.salmon.transform.SalmonAES256CTRTransformer
BLOCK_SIZE, EXPANDED_KEY_SIZE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
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 native Aes intrinsics transformer.Methods inherited from class com.mku.salmon.transform.SalmonNativeTransformer
getNativeProxy, setNativeProxy
Methods inherited from class com.mku.salmon.transform.SalmonAES256CTRTransformer
getBlock, getCounter, getExpandedKey, getKey, getNonce, increaseCounter, resetCounter, setExpandedKey, syncCounter
-
Field Details
-
AES_IMPL_AES_INTR
public static final int AES_IMPL_AES_INTRThe constant to pass to the native code while initializing.- See Also:
-
-
Constructor Details
-
SalmonAesIntrTransformer
public SalmonAesIntrTransformer()
-
-
Method Details
-
init
public void init(byte[] key, byte[] nonce) Initialize the native Aes intrinsics transformer.- Specified by:
init
in interfaceISalmonCTRTransformer
- Overrides:
init
in classSalmonAES256CTRTransformer
- Parameters:
key
- The AES key to use.nonce
- The nonce to use.- Throws:
SalmonSecurityException
- Thrown if there is a security exception
-
encryptData
public int encryptData(byte[] srcBuffer, int srcOffset, byte[] destBuffer, int destOffset, int count) Encrypt the data.- Specified by:
encryptData
in interfaceISalmonCTRTransformer
- Overrides:
encryptData
in classSalmonNativeTransformer
- 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.
-
decryptData
public int decryptData(byte[] srcBuffer, int srcOffset, byte[] destBuffer, int destOffset, int count) Decrypt the data.- Specified by:
decryptData
in interfaceISalmonCTRTransformer
- Overrides:
decryptData
in classSalmonNativeTransformer
- 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.
-