Class SalmonAesIntrTransformer

All Implemented Interfaces:
ISalmonCTRTransformer

public class SalmonAesIntrTransformer extends SalmonNativeTransformer
Salmon AES transformer implemented with AES intrinsics.
  • Field Details

    • AES_IMPL_AES_INTR

      public static final int AES_IMPL_AES_INTR
      The constant to pass to the native code while initializing.
      See Also:
  • Constructor Details

    • SalmonAesIntrTransformer

      public SalmonAesIntrTransformer()
  • Method Details

    • init

      public void init(byte[] key, byte[] nonce)
      Initialize the native Aes intrinsics transformer.
      Specified by:
      init in interface ISalmonCTRTransformer
      Overrides:
      init in class SalmonAES256CTRTransformer
      Parameters:
      key - The AES key to use.
      nonce - The nonce to use.
      Throws:
      SalmonSecurityException - Thrown if there is a security exception
    • encryptData

      public int encryptData(byte[] srcBuffer, int srcOffset, byte[] destBuffer, int destOffset, int count)
      Encrypt the data.
      Specified by:
      encryptData in interface ISalmonCTRTransformer
      Overrides:
      encryptData in class SalmonNativeTransformer
      Parameters:
      srcBuffer - The source byte array.
      srcOffset - The source byte offset.
      destBuffer - The destination byte array.
      destOffset - The destination byte offset.
      count - The number of bytes to transform.
      Returns:
      The number of bytes transformed.
    • decryptData

      public int decryptData(byte[] srcBuffer, int srcOffset, byte[] destBuffer, int destOffset, int count)
      Decrypt the data.
      Specified by:
      decryptData in interface ISalmonCTRTransformer
      Overrides:
      decryptData in class SalmonNativeTransformer
      Parameters:
      srcBuffer - The source byte array.
      srcOffset - The source byte offset.
      destBuffer - The destination byte array.
      destOffset - The destination byte offset.
      count - The number of bytes to transform.
      Returns:
      The number of bytes transformed.