Package com.mku.salmon.bridge
Class NativeProxy
- java.lang.Object
-
- com.mku.salmon.bridge.NativeProxy
-
- All Implemented Interfaces:
INativeProxy
public class NativeProxy extends java.lang.Object implements INativeProxy
Proxy class for use with windows native library.
-
-
Constructor Summary
Constructors Constructor Description NativeProxy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
loadLibrary()
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
-
-
-
Method Detail
-
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, Aes = 2, Aes GPU = 3)
-
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.
-
-