public abstract class AbstractRedundancyOperation extends Operation implements org.bouncycastle.asn1.ASN1Choice, Serializable, Dumpable
Modifier and Type | Field and Description |
---|---|
static int |
DATA_STRIPES |
static int |
GF_SIZE |
static int |
INPUT_ID |
static int |
KEYS |
static int |
OUTPUT_ID |
static int |
REDUNDANCY |
static long |
serialVersionUID |
CRLF
Constructor and Description |
---|
AbstractRedundancyOperation(org.bouncycastle.asn1.ASN1Encodable to)
Create object from ASN.1 code.
|
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.
|
Modifier and Type | Method and Description |
---|---|
String |
dumpValueNotation(String prefix,
DumpType dumpType)
Dumps the ASN1 value representation of the removeRedundancy operation.
|
int |
getDataStripes() |
int |
getGfSize() |
int |
getInputId() |
SymmetricKey[] |
getKeys()
Gets the omega parameter of the Galois field.
|
int |
getOutputId()
gets the id of the first output payload block.
|
int |
getRedundancy() |
protected void |
parse(org.bouncycastle.asn1.ASN1Encodable p) |
int |
setDataStripes(int stripes)
Sets the number of data stripes for this operation.
|
int |
setGfSize(int omega)
Sets the omega parameter of the Galois field.
|
int |
setInputId(int id)
Sets the id of the first input id of the payload.
|
SymmetricKey[] |
setKeys(List<SymmetricKey> keys)
Sets the keys to be used to encrypt all input respective output fields.
|
int |
setOutputId(int id)
Sets the id of the first output block of the function.
|
int |
setRedundancy(int stripes)
sets the number of redundancy stripes.
|
org.bouncycastle.asn1.ASN1Object |
toAsn1Object(DumpType dumpType)
Dumps an ASN.1 representation of the object.
|
getNewInstance, getTagNumber, setTagNumber
fromBase64, fromHex, parse, prepareDump, toBase64, toBitString, toBytes, toDer, toHex
public static final long serialVersionUID
public static final int INPUT_ID
public static final int DATA_STRIPES
public static final int REDUNDANCY
public static final int KEYS
public static final int OUTPUT_ID
public static final int GF_SIZE
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.
inputId
- first ID of the input workspacedataStripes
- number of data stripes contained in operationredundancy
- number of redundancy stripesstripeKeys
- keys for the resulting stripes (number should be dataStripes+redundancy)newFirstId
- first output IDgfSize
- Size of the Galois Field in bitspublic AbstractRedundancyOperation(org.bouncycastle.asn1.ASN1Encodable to) throws IOException
Create object from ASN.1 code.
to
- the ASN.1 codeIOException
- if parsing of ASN.1 code failsprotected final void parse(org.bouncycastle.asn1.ASN1Encodable p) throws IOException
parse
in class AbstractBlock
IOException
public org.bouncycastle.asn1.ASN1Object toAsn1Object(DumpType dumpType) throws IOException
Dumpable
Dumps an ASN.1 representation of the object.
toAsn1Object
in interface Dumpable
dumpType
- the dump type to be usedIOException
- if dumping of the object fails due to an illegal internal state of the
objectpublic String dumpValueNotation(String prefix, DumpType dumpType)
Dumps the ASN1 value representation of the removeRedundancy operation.
dumpValueNotation
in interface Block
public final int setInputId(int id)
Sets the id of the first input id of the payload.
id
- the new first input idpublic final int getInputId()
public final int setDataStripes(int stripes)
Sets the number of data stripes for this operation.
stripes
- The number of data stripes to be used for the redundancy operationArithmeticException
- if all stripes together are not accommodated in the given GF fieldpublic final int getDataStripes()
public final int setRedundancy(int stripes)
sets the number of redundancy stripes.
stripes
- the number of redundancy stripes to be setArithmeticException
- if the defined GF size is unable to accommodated all valuespublic int getRedundancy()
public final SymmetricKey[] setKeys(List<SymmetricKey> keys)
Sets the keys to be used to encrypt all input respective output fields.
keys
- a list of keysArithmeticException
- if the number of keys does not match the number of stripespublic SymmetricKey[] getKeys()
Gets the omega parameter of the Galois field.
public final int setGfSize(int omega)
Sets the omega parameter of the Galois field.
omega
- the omega of the new GFArithmeticException
- if the number of all stripes in total (
data and redundancy) exceeds the address space of the GFpublic final int getGfSize()
public int setOutputId(int id)
Sets the id of the first output block of the function.
id
- the first id to be usedpublic int getOutputId()
gets the id of the first output payload block.
Copyright © 2023. All rights reserved.