Package dk.hyperdivision.multisig_hmac
Class Verify
java.lang.Object
dk.hyperdivision.multisig_hmac.Verify
public class Verify extends Object
Verify represents a verification of a signature of data against a list of keys.
- Author:
- Amalie Due Jensen
-
Constructor Summary
Constructors Constructor Description Verify() -
Method Summary
Modifier and Type Method Description static List<Integer>keyIndexes(int BitField)Computes the indexes of the keys (i.e. high bits)static intLeadingZeros(int BitField)static intPopCount(int BitField)Computes the number of keys (i.e. high bits)static booleanverify(List<IndexKey> Keys, Combine Signature, byte[] data, int Threshold, String Algorithm, int BYTES)Verifies a signature of data against a list of keys
-
Constructor Details
-
Verify
public Verify()
-
-
Method Details
-
verify
public static boolean verify(List<IndexKey> Keys, Combine Signature, byte[] data, int Threshold, String Algorithm, int BYTES) throws InvalidKeyException, NoSuchAlgorithmExceptionVerifies a signature of data against a list of keys- Parameters:
Keys- - list of all keysSignature- - combined signaturedata- - data which has been signedThreshold- - minimum number of keys that the list Keys should containAlgorithm- - algorithm used for HMACBYTES- - length of signature- Returns:
- verification of the signature (true/false)
- Throws:
InvalidKeyException- - if the given key is inappropriate for initializing this HMACNoSuchAlgorithmException- - if the specified algorithm is not available
-
keyIndexes
Computes the indexes of the keys (i.e. high bits)- Parameters:
BitField- - indexes of keys represented as one integer- Returns:
- indexes of keys in a list
-
PopCount
public static int PopCount(int BitField)Computes the number of keys (i.e. high bits)- Parameters:
BitField- - indexes of keys represented as one integer- Returns:
- the number of keys
-
LeadingZeros
public static int LeadingZeros(int BitField)
-