Class AbstractRedundancyOperation

All Implemented Interfaces:
Serializable, Block, Dumpable, org.bouncycastle.asn1.ASN1Choice
Direct Known Subclasses:
AddRedundancyOperation, RemoveRedundancyOperation

public abstract class AbstractRedundancyOperation extends Operation implements org.bouncycastle.asn1.ASN1Choice, Serializable, Dumpable
Represents a the Blending specification of the router block.
See Also:
  • Field Details

  • Constructor Details

    • AbstractRedundancyOperation

      public AbstractRedundancyOperation(int inputId, int dataStripes, int redundancy, List<SymmetricKey> stripeKeys, int newFirstId, int gfSize)

      Creates an appropriate operation with the given GF size and properties.

      Parameters:
      inputId - first ID of the input workspace
      dataStripes - number of data stripes contained in operation
      redundancy - number of redundancy stripes
      stripeKeys - keys for the resulting stripes (number should be dataStripes+redundancy)
      newFirstId - first output ID
      gfSize - Size of the Galois Field in bits
    • AbstractRedundancyOperation

      public AbstractRedundancyOperation(org.bouncycastle.asn1.ASN1Encodable to) throws IOException

      Create object from ASN.1 code.

      Parameters:
      to - the ASN.1 code
      Throws:
      IOException - if parsing of ASN.1 code fails
  • Method Details

    • parse

      protected final void parse(org.bouncycastle.asn1.ASN1Encodable p) throws IOException
      Specified by:
      parse in class AbstractBlock
      Throws:
      IOException
    • toAsn1Object

      public org.bouncycastle.asn1.ASN1Object toAsn1Object(DumpType dumpType) throws IOException
      Description copied from interface: Dumpable

      Dumps an ASN.1 representation of the object.

      Specified by:
      toAsn1Object in interface Dumpable
      Parameters:
      dumpType - the dump type to be used
      Returns:
      the ASN.1 string representation of the object
      Throws:
      IOException - if dumping of the object fails due to an illegal internal state of the object
    • dumpValueNotation

      public String dumpValueNotation(String prefix, DumpType dumpType)

      Dumps the ASN1 value representation of the removeRedundancy operation.

      Specified by:
      dumpValueNotation in interface Block
      Returns:
      the representation of the object
    • setInputId

      public final int setInputId(int id)

      Sets the id of the first input id of the payload.

      Parameters:
      id - the new first input id
      Returns:
      the previously set first input id
    • getInputId

      public final int getInputId()
    • setDataStripes

      public final int setDataStripes(int stripes)

      Sets the number of data stripes for this operation.

      Parameters:
      stripes - The number of data stripes to be used for the redundancy operation
      Returns:
      the previously set number of stripes
      Throws:
      ArithmeticException - if all stripes together are not accommodated in the given GF field
    • getDataStripes

      public final int getDataStripes()
    • setRedundancy

      public final int setRedundancy(int stripes)

      sets the number of redundancy stripes.

      Parameters:
      stripes - the number of redundancy stripes to be set
      Returns:
      the previous number of redundancy stripes
      Throws:
      ArithmeticException - if the defined GF size is unable to accommodated all values
    • getRedundancy

      public int getRedundancy()
    • setKeys

      public final SymmetricKey[] setKeys(List<SymmetricKey> keys)

      Sets the keys to be used to encrypt all input respective output fields.

      Parameters:
      keys - a list of keys
      Returns:
      the old list of keys
      Throws:
      ArithmeticException - if the number of keys does not match the number of stripes
    • getKeys

      public SymmetricKey[] getKeys()

      Gets the omega parameter of the Galois field.

      Returns:
      the omega parameter of the GF.
    • setGfSize

      public final int setGfSize(int omega)

      Sets the omega parameter of the Galois field.

      Parameters:
      omega - the omega of the new GF
      Returns:
      the previous omega parameter of the GF.
      Throws:
      ArithmeticException - if the number of all stripes in total ( data and redundancy) exceeds the address space of the GF
    • getGfSize

      public final int getGfSize()
    • setOutputId

      public int setOutputId(int id)

      Sets the id of the first output block of the function.

      Parameters:
      id - the first id to be used
      Returns:
      old first value (before the write
    • getOutputId

      public int getOutputId()

      gets the id of the first output payload block.

      Returns:
      id of the respective block