Salmon
Loading...
Searching...
No Matches
salmon-jni.h File Reference

Java JNI bridge to salmon native library. More...

#include <jni.h>
#include <stdint.h>

Go to the source code of this file.

Functions

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)
 

Detailed Description

Java JNI bridge to salmon native library.

Function Documentation

◆ 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
jKeyThe AES-256 (32-byte) key to expand.
jExpandedKeyThe 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
aesImplTypeThe 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
jCounterThe counter to use.
jSrcBufferThe source byte array.
srcOffsetThe source byte offset.
jDestBufferThe destination byte array.
destOffsetThe destination byte offset.
countThe number of bytes to transform.
Returns
The number of bytes transformed.