Class VRFRigged
- java.lang.Object
-
- com.h2tcoin.takamakachain.utils.vrf.tree.VRFRigged
-
- All Implemented Interfaces:
VerifiableRandomFunctionInterface
public class VRFRigged extends Object implements VerifiableRandomFunctionInterface
- Author:
- giovanni.antino@h2tcoin.com
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(NodeStakeBean sb)
ConcurrentSkipListMap<String,ConcurrentSkipListSet<Integer>>
createDistribution(int epoch)
static VRFRigged
getInstance()
String
getSeed(int epoch)
returns the seed to be used when calculating the next VRF distributionboolean
isSeedSet()
void
resetInstance()
void
setSeed(String seed)
-
-
-
Method Detail
-
getInstance
public static VRFRigged getInstance()
-
resetInstance
public void resetInstance()
- Specified by:
resetInstance
in interfaceVerifiableRandomFunctionInterface
-
add
public void add(NodeStakeBean sb) throws NoSuchAlgorithmException, HashEncodeException, HashAlgorithmNotFoundException, HashProviderNotFoundException
- Specified by:
add
in interfaceVerifiableRandomFunctionInterface
- Parameters:
sb
-- Throws:
NoSuchAlgorithmException
HashEncodeException
HashAlgorithmNotFoundException
HashProviderNotFoundException
-
setSeed
public void setSeed(String seed) throws NoSuchAlgorithmException, HashEncodeException, HashAlgorithmNotFoundException, HashProviderNotFoundException
- Specified by:
setSeed
in interfaceVerifiableRandomFunctionInterface
- Throws:
NoSuchAlgorithmException
HashEncodeException
HashAlgorithmNotFoundException
HashProviderNotFoundException
-
isSeedSet
public boolean isSeedSet()
- Specified by:
isSeedSet
in interfaceVerifiableRandomFunctionInterface
-
createDistribution
public ConcurrentSkipListMap<String,ConcurrentSkipListSet<Integer>> createDistribution(int epoch) throws NoSuchAlgorithmException, HashEncodeException, HashAlgorithmNotFoundException, HashProviderNotFoundException
- Specified by:
createDistribution
in interfaceVerifiableRandomFunctionInterface
- Throws:
NoSuchAlgorithmException
HashEncodeException
HashAlgorithmNotFoundException
HashProviderNotFoundException
-
getSeed
public String getSeed(int epoch)
returns the seed to be used when calculating the next VRF distribution- Parameters:
epoch
-slot
-sid
-- Returns:
-
-