Java JNI bridge to salmon native library.
More...
#include <jni.h>
#include <stdint.h>
Go to the source code of this file.
|
JNIEXPORT void JNICALL | Java_com_mku_salmon_bridge_NativeProxy_init (JNIEnv *env, jclass thiz, jint aesImplType) |
|
JNIEXPORT void JNICALL | Java_com_mku_salmon_bridge_NativeProxy_expandkey (JNIEnv *env, jclass thiz, jbyteArray jKey, jbyteArray jExpandedKey) |
|
JNIEXPORT jint JNICALL | Java_com_mku_salmon_bridge_NativeProxy_transform (JNIEnv *env, jclass thiz, jbyteArray jKey, jbyteArray jCounter, jbyteArray jSrcBuffer, jint srcOffset, jbyteArray jDestBuffer, jint destOffset, jint count) |
|
Java JNI bridge to salmon native library.
◆ Java_com_mku_salmon_bridge_NativeProxy_expandkey()
JNIEXPORT void JNICALL Java_com_mku_salmon_bridge_NativeProxy_expandkey |
( |
JNIEnv * | env, |
|
|
jclass | thiz, |
|
|
jbyteArray | jKey, |
|
|
jbyteArray | jExpandedKey ) |
Expand an AES-256 32-byte key to a 240-byte set of round keys.
- Parameters
-
jKey | The AES-256 (32-byte) key to expand. |
jExpandedKey | The expanded key (240-bytes). |
◆ Java_com_mku_salmon_bridge_NativeProxy_init()
JNIEXPORT void JNICALL Java_com_mku_salmon_bridge_NativeProxy_init |
( |
JNIEnv * | env, |
|
|
jclass | thiz, |
|
|
jint | aesImplType ) |
Initialize the transformer.
- Parameters
-
aesImplType | The AES implementation: see: AES_IMPL_AES_INTR, AES_IMPL_TINY_AES, AES_IMPL_AES_GPU |
◆ Java_com_mku_salmon_bridge_NativeProxy_transform()
JNIEXPORT jint JNICALL Java_com_mku_salmon_bridge_NativeProxy_transform |
( |
JNIEnv * | env, |
|
|
jclass | thiz, |
|
|
jbyteArray | jKey, |
|
|
jbyteArray | jCounter, |
|
|
jbyteArray | jSrcBuffer, |
|
|
jint | srcOffset, |
|
|
jbyteArray | jDestBuffer, |
|
|
jint | destOffset, |
|
|
jint | count ) |
Transform the data using AES-256 CTR mode.
- Parameters
-
jCounter | The counter to use. |
jSrcBuffer | The source byte array. |
srcOffset | The source byte offset. |
jDestBuffer | The destination byte array. |
destOffset | The destination byte offset. |
count | The number of bytes to transform. |
- Returns
- The number of bytes transformed.