Class NativeProxy

java.lang.Object
com.mku.salmon.bridge.NativeProxy
All Implemented Interfaces:
INativeProxy

public class NativeProxy extends Object implements INativeProxy
Proxy class for use with windows native library.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    Load the native library
    void
    salmonExpandKey(byte[] key, byte[] expandedKey)
    Proxy Key schedule algorithm for expanding the 32 byte key to 240 bytes required
    void
    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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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:
      salmonInit in interface INativeProxy
      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:
      salmonExpandKey in interface INativeProxy
      Parameters:
      key - The key
      expandedKey - 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 interface INativeProxy
      Parameters:
      key - The key
      counter - The counter
      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 be transform.
      Returns:
      The transformed data.