java.lang.Object
com.coderslagoon.crypto.estreamj.ciphers.phelix.Phelix
All Implemented Interfaces:
ICipher

public class Phelix extends Object implements ICipher
The Phelix implementation, based on the original PhelixJ package by CODERSLAGOON.
  • Field Details

  • Constructor Details

    • Phelix

      public Phelix(int macSize)
  • Method Details

    • erase

      public void erase()
      Description copied from interface: ICipher
      Erases all sensitive data. Instance MUST be abadonned afterwards.
      Specified by:
      erase in interface ICipher
    • reset

      public void reset()
      Description copied from interface: ICipher
      Resets the instance, so it can be reused.
      Specified by:
      reset in interface ICipher
    • setupKey

      public void setupKey(int mode, byte[] key, int keyOfs) throws ESJException
      Description copied from interface: ICipher
      Sets up a new key with the existing instance.
      Specified by:
      setupKey in interface ICipher
      Parameters:
      mode - see MODE_xxx
      key - buffer with key material
      keyOfs - where the key starts
      Throws:
      ESJException - if any error occurs
    • setupKeyEx

      public void setupKeyEx(int mode, byte[] key, int keyOfs, int keySize) throws ESJException
      Throws:
      ESJException
    • setupNonce

      public void setupNonce(byte[] nonce, int nonceOfs)
      Description copied from interface: ICipher
      Sets up a new nonce with the existing cipher instance.
      Specified by:
      setupNonce in interface ICipher
      Parameters:
      nonce - buffer with nonce material
      nonceOfs - where the nonce starts
    • process

      public void process(byte[] inBuf, int inbufOfs, byte[] outBuf, int outbufOfs, int msgLen) throws ESJException
      Description copied from interface: ICipher
      Processes data.
      Specified by:
      process in interface ICipher
      Parameters:
      inBuf - input buffer
      inbufOfs - where to start reading from the input buffer
      outBuf - output buffer
      outbufOfs - where to start writing in the output buffer
      msgLen - number of bytes to process, must be aligned to the cipher's word size except on the last call where an arbitrary size can be used
      Throws:
      ESJException - in any error occurred
    • processAAD

      public void processAAD(byte[] aad, int aadOfs, int aadLen) throws ESJException
      Throws:
      ESJException
    • finalize

      public void finalize(byte[] mac, int macOfs)
    • getKeySize

      public int getKeySize()
      Specified by:
      getKeySize in interface ICipher
      Returns:
      key size in bytes
    • getMacSize

      public int getMacSize()
    • getNonceSize

      public int getNonceSize()
      Specified by:
      getNonceSize in interface ICipher
      Returns:
      nonce size in bytes.
    • getWordSize

      public int getWordSize()
      Specified by:
      getWordSize in interface ICipher
      Returns:
      alignment of data needed during calls into process()
    • isPatented

      public boolean isPatented()
      Specified by:
      isPatented in interface ICipher
      Returns:
      true: algorithm is patented, check with vendor for license details / false: free to use in private and commercial applications
    • register

      public static void register()