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 Details

  • Method Details

    • verify

      public static boolean verify​(List<IndexKey> Keys, Combine Signature, byte[] data, int Threshold, String Algorithm, int BYTES) throws InvalidKeyException, NoSuchAlgorithmException
      Verifies a signature of data against a list of keys
      Parameters:
      Keys - - list of all keys
      Signature - - combined signature
      data - - data which has been signed
      Threshold - - minimum number of keys that the list Keys should contain
      Algorithm - - algorithm used for HMAC
      BYTES - - length of signature
      Returns:
      verification of the signature (true/false)
      Throws:
      InvalidKeyException - - if the given key is inappropriate for initializing this HMAC
      NoSuchAlgorithmException - - if the specified algorithm is not available
    • keyIndexes

      public static List<Integer> keyIndexes​(int BitField)
      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)