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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidLoad the native libraryvoidsalmonExpandKey(byte[] key, byte[] expandedKey) Proxy Key schedule algorithm for expanding the 32 byte key to 240 bytes requiredvoidsalmonInit(int aesImpl) Proxy Init the native code with AES implementation, and hash length options.intsalmonTransform(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:
salmonInitin 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:
salmonExpandKeyin 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:
salmonTransformin 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.
-