Interface PacketCipher

All Known Subinterfaces:
AESCBCModePacketCipher, AESCCMModePacketCipher, AESCFBModePacketCipher, AESCTRModePacketCipher, AESGCMModePacketCipher, AESGCMSIVModePacketCipher
All Known Implementing Classes:
AESCBCPacketCipher, AESCCMPacketCipher, AESCFBPacketCipher, AESCTRPacketCipher, AESGCMPacketCipher, AESGCMSIVPacketCipher, AESNativeCBCPacketCipher, AESNativeCCMPacketCipher, AESNativeCFBPacketCipher, AESNativeCTRPacketCipher, AESNativeGCMPacketCipher, AESNativeGCMSIVPacketCipher

public interface PacketCipher
Packet ciphers are reusable instances that perform one complete transformation with known input and output message lengths.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    getOutputSize(boolean encryption, CipherParameters parameters, int len)
    Returns the expected output size for direction and parameters.
    int
    processPacket(boolean encryption, CipherParameters parameters, byte[] input, int inOff, int len, byte[] output, int outOff)
    Process a packet.
  • Method Details

    • getOutputSize

      int getOutputSize(boolean encryption, CipherParameters parameters, int len)
      Returns the expected output size for direction and parameters.
      Parameters:
      encryption - encryption if true
      parameters - The cipher parameters
      len - the input length.
      Returns:
      the required minimum output length in bytes.
    • processPacket

      int processPacket(boolean encryption, CipherParameters parameters, byte[] input, int inOff, int len, byte[] output, int outOff) throws PacketCipherException
      Process a packet.
      Parameters:
      encryption - encryption if true
      parameters - The key parameters
      input - The input byte array
      inOff - Offset within byte array to start reading input.
      len - the number of bytes of input to process.
      output - The output array
      outOff - the offset within the output array to start writing output.
      Returns:
      Throws:
      PacketCipherException - if the transformation encounters an error.