Package com.mku.salmon.bridge
Class NativeProxy
java.lang.Object
com.mku.salmon.bridge.NativeProxy
- All Implemented Interfaces:
INativeProxy
Proxy class for use with windows native library.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
Load the native libraryvoid
salmonExpandKey
(byte[] key, byte[] expandedKey) Proxy Key schedule algorithm for expanding the 32 byte key to 240 bytes requiredvoid
salmonInit
(int aesImpl) Proxy Init the native code with AES implementation, and hash length options.int
salmonTransform
(byte[] key, byte[] counter, byte[] srcBuffer, int srcOffset, byte[] destBuffer, int destOffset, int count) Proxy Transform the input byte array using AES-256 CTR mode
-
Constructor Details
-
NativeProxy
public NativeProxy()
-
-
Method Details
-
salmonInit
public void salmonInit(int aesImpl) Proxy Init the native code with AES implementation, and hash length options.- Specified by:
salmonInit
in interfaceINativeProxy
- Parameters:
aesImpl
- AES implementation type (Aes Intrinsics = 1, TinyAES = 2)
-
loadLibrary
protected void loadLibrary()Load the native library -
salmonExpandKey
public void salmonExpandKey(byte[] key, byte[] expandedKey) Proxy Key schedule algorithm for expanding the 32 byte key to 240 bytes required- Specified by:
salmonExpandKey
in interfaceINativeProxy
- Parameters:
key
- The keyexpandedKey
- The expanded key
-
salmonTransform
public int salmonTransform(byte[] key, byte[] counter, byte[] srcBuffer, int srcOffset, byte[] destBuffer, int destOffset, int count) Proxy Transform the input byte array using AES-256 CTR mode- Specified by:
salmonTransform
in interfaceINativeProxy
- Parameters:
key
- The keycounter
- The countersrcBuffer
- The source byte array.srcOffset
- The source byte offset.destBuffer
- The destination byte array.destOffset
- The destination byte offset.count
- The count of bytes to be transform.- Returns:
- The transformed data.
-