public class Mask extends Object
| Constructor and Description |
|---|
Mask(List<Point> publics,
byte[] mask)
Create a read-only mask from a set of public keys and the given bitmask.
|
| Modifier and Type | Method and Description |
|---|---|
int |
countEnabled()
Count the number of enabled public keys in the participation mask.
|
int |
countTotal()
Count the total number of public keys in this mask.
|
Point |
getAggregate()
Gets the aggregate public key according to the mask.
|
List<Point> |
getPublics()
Get the list of public keys involved in the mask
|
boolean |
indexEnabled(int i)
Checks whether the given index is enabled in the mask or not.
|
boolean |
keyEnabled(Point p)
Checks whether the index, corresponding to the given key, is enabled in the mask or not.
|
int |
len()
Gets the length of the mask in bytes.
|
String |
toString() |
public Mask(List<Point> publics, byte[] mask) throws CothorityCryptoException
publics - is the set of public keys.mask - is the bit mask, the number of bits must be greater than or equal to the number of public keys.CothorityCryptoException - is thrown when the list of public keys is empty.public int len()
public Point getAggregate()
public List<Point> getPublics()
public boolean indexEnabled(int i)
throws IndexOutOfBoundsException
i - is the index.IndexOutOfBoundsException - when i >= the number of public keys.public boolean keyEnabled(Point p) throws CothorityCryptoException
p - is the public key.CothorityCryptoException - if the key is not found.public int countEnabled()
public int countTotal()
Copyright © 2019. All rights reserved.