public interface UniqueByteRepresentable
Such objects can, for example, be used as input to a HashFunction.
Unlike in the Representable interface, all UniqueByteRepresentable instances are guaranteed to
be mapped to the same byte representation if the object is the same.
If two objects are not the same, but are of the same type, their unique byte representation must differ,
i.e. the mapping is injective.
(For the sake of sanity and performance, "of the same type" here means also that they are part of the same context,
e.g., based on the same group / use the same public parameters)
| Modifier and Type | Method and Description |
|---|---|
default byte[] |
getUniqueByteRepresentation()
An injective mapping of the domain of this object to a
byte[]. |
ByteAccumulator |
updateAccumulator(ByteAccumulator accumulator)
Updates the ByteAccumulator with the unique byte representation of this object.
|
ByteAccumulator updateAccumulator(ByteAccumulator accumulator)
The input to the accumulators update function is an injective (with respect to a given domain) byte encoding of this object.
For many use-cases, the AnnotatedUbrUtil can be used to quickly implement this method.
default byte[] getUniqueByteRepresentation()
byte[].
Shorthand for updateAccumulator(new ByteArrayAccumulator()).extractBytes().
Implementors of the UniqueByteRepresentable interface should override
updateAccumulator(ByteAccumulator) instead.