Package com.mku.salmon.bridge
Interface INativeProxy
-
- All Known Implementing Classes:
NativeProxy
public interface INativeProxy
Interface to native libraries that provide AES-256 encryption in CTR mode.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
salmonExpandKey(byte[] key, byte[] expandedKey)
Expands the specified AES encryption key.void
salmonInit(int aesImpl)
Initializes the native library with the specified AES implementation.int
salmonTransform(byte[] key, byte[] counter, byte[] srcBuffer, int srcOffset, byte[] destBuffer, int destOffset, int count)
Transforms data using CTR mode.
-
-
-
Method Detail
-
salmonInit
void salmonInit(int aesImpl)
Initializes the native library with the specified AES implementation.- Parameters:
aesImpl
- The AES implementation, seeProviderType
for possible values
-
salmonExpandKey
void salmonExpandKey(byte[] key, byte[] expandedKey)
Expands the specified AES encryption key.- Parameters:
key
- The AES-256 encryption key (32 bytes)expandedKey
- The expanded key (240 bytes)
-
salmonTransform
int salmonTransform(byte[] key, byte[] counter, byte[] srcBuffer, int srcOffset, byte[] destBuffer, int destOffset, int count)
Transforms data using CTR mode. CTR mode is symmetric so you should use it for both encryption and decryption.- Parameters:
key
- The AES-256 encryption key (32 bytes)counter
- The counter (16 bytes)srcBuffer
- 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 transform.- Returns:
- The number of bytes transformed.
-
-