Class BlockCipher

java.lang.Object
Direct Known Subclasses:
Aes, Des3

public abstract class BlockCipher
extends NativeStruct
Common API for block ciphers.
Version:
1.0, March 2017
Author:
Moisés Guimarães
  • Field Summary

    Fields inherited from class com.wolfssl.wolfcrypt.NativeStruct

    NULL
  • Constructor Summary

    Constructors 
    Constructor Description
    BlockCipher()  
  • Method Summary

    Modifier and Type Method Description
    protected abstract void native_set_key​(byte[] key, byte[] iv, int opmode)  
    protected abstract int native_update​(int opmode, byte[] input, int offset, int length, byte[] output, int outputOffset)  
    protected abstract int native_update​(int opmode, java.nio.ByteBuffer input, int offset, int length, java.nio.ByteBuffer output, int outputOffset)  
    void releaseNativeStruct()
    Releases the host data stored in a NativeStruct.
    void setKey​(byte[] key, byte[] iv, int opmode)  
    byte[] update​(byte[] input)  
    byte[] update​(byte[] input, int offset, int length)  
    int update​(byte[] input, int offset, int length, byte[] output, int outputOffset)  
    int update​(java.nio.ByteBuffer input, java.nio.ByteBuffer output)  
    void willUseKey()  

    Methods inherited from class com.wolfssl.wolfcrypt.NativeStruct

    finalize, getNativeStruct, mallocNativeStruct, setNativeStruct

    Methods inherited from class java.lang.Object

    clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • native_set_key

      protected abstract void native_set_key​(byte[] key, byte[] iv, int opmode)
    • native_update

      protected abstract int native_update​(int opmode, byte[] input, int offset, int length, byte[] output, int outputOffset)
    • native_update

      protected abstract int native_update​(int opmode, java.nio.ByteBuffer input, int offset, int length, java.nio.ByteBuffer output, int outputOffset)
    • setKey

      public void setKey​(byte[] key, byte[] iv, int opmode)
    • willUseKey

      public void willUseKey()
    • update

      public byte[] update​(byte[] input)
    • update

      public byte[] update​(byte[] input, int offset, int length)
    • update

      public int update​(byte[] input, int offset, int length, byte[] output, int outputOffset) throws javax.crypto.ShortBufferException
      Throws:
      javax.crypto.ShortBufferException
    • update

      public int update​(java.nio.ByteBuffer input, java.nio.ByteBuffer output) throws javax.crypto.ShortBufferException
      Throws:
      javax.crypto.ShortBufferException
    • releaseNativeStruct

      public void releaseNativeStruct()
      Description copied from class: NativeStruct
      Releases the host data stored in a NativeStruct. This method provides a way to release host data without depending on the garbage collector to get around to releasing it. Derived objects whose native data structures have their own free functions, should be override this method to call that function.
      Overrides:
      releaseNativeStruct in class NativeStruct