Package com.horizen.schnorrnative
Class ValidatorKeysUpdatesList
- java.lang.Object
-
- com.horizen.schnorrnative.ValidatorKeysUpdatesList
-
- All Implemented Interfaces:
AutoCloseable
public class ValidatorKeysUpdatesList extends Object implements AutoCloseable
-
-
Constructor Summary
Constructors Constructor Description ValidatorKeysUpdatesList(List<SchnorrPublicKey> signingKeysList, List<SchnorrPublicKey> masterKeysList, List<SchnorrPublicKey> updatedSigningKeysList, List<SchnorrPublicKey> updatedMasterKeysList, List<SchnorrSignature> updatedSigningKeysSkSignaturesList, List<SchnorrSignature> updatedSigningKeysMkSignaturesList, List<SchnorrSignature> updatedMasterKeysSkSignaturesList, List<SchnorrSignature> updatedMasterKeysMkSignaturesList, long maxPks)Create a set group for validators keys and signature updates.
-
Method Summary
-
-
-
Constructor Detail
-
ValidatorKeysUpdatesList
public ValidatorKeysUpdatesList(List<SchnorrPublicKey> signingKeysList, List<SchnorrPublicKey> masterKeysList, List<SchnorrPublicKey> updatedSigningKeysList, List<SchnorrPublicKey> updatedMasterKeysList, List<SchnorrSignature> updatedSigningKeysSkSignaturesList, List<SchnorrSignature> updatedSigningKeysMkSignaturesList, List<SchnorrSignature> updatedMasterKeysSkSignaturesList, List<SchnorrSignature> updatedMasterKeysMkSignaturesList, long maxPks)
Create a set group for validators keys and signature updates.- Parameters:
signingKeysList- - The current signers' public keys.masterKeysList- - The current signers' master public keys.updatedSigningKeysList- - The list of updated signing keys. Should be equal to `signingKeysList` except where keys have changed. If no keys have changed, then this list should be equal to `signingKeysList`.updatedMasterKeysList- - The list of updated master signing keys. Should be equal to `masterKeysList` except where keys have changed. If no keys have changed, then this list should be equal to `masterKeysList`.updatedSigningKeysSkSignaturesList- - signatures made with old signing keys for new signing keys, elements can be empty if there was no updateupdatedSigningKeysMkSignaturesList- - signatures made with old master keys for new signing keys, elements can be empty if there was no updateupdatedMasterKeysSkSignaturesList- - signatures made with old signing keys for new master keys, elements can be empty if there was no updateupdatedMasterKeysMkSignaturesList- - signatures made with old master keys for new master keys, elements can be empty if there was no updatemaxPks- - the maximum number of key validators
-
-
Method Detail
-
getSigningKeys
public SchnorrPublicKey[] getSigningKeys()
-
getMasterKeys
public SchnorrPublicKey[] getMasterKeys()
-
getInputKeysRootHash
public static FieldElement getInputKeysRootHash(SchnorrPublicKey[] signingKeys, SchnorrPublicKey[] masterKeys, long maxPks) throws Exception
Utility: computes the validator keys merkle root given the set of signing keys and master keys passed as input to the function.- Parameters:
signingKeys- - The signers' public keys.masterKeys- - The signers' master public keys.maxPks- - Maximum number of pks- Returns:
- the merkle root given the set of signing keys and master keys passed as input to the function
- Throws:
Exception- - if it was not possible to compute the root
-
getKeysRootHash
public FieldElement getKeysRootHash() throws Exception
Computes the current validator keys merkle root.- Returns:
- the current validator keys merkle root.
- Throws:
Exception- - if it was not possible to compute the root
-
getUpdatedSigningKeys
public SchnorrPublicKey[] getUpdatedSigningKeys()
-
getUpdatedMasterKeys
public SchnorrPublicKey[] getUpdatedMasterKeys()
-
getUpdatedKeysRootHash
public FieldElement getUpdatedKeysRootHash() throws Exception
Computes the updated validator keys merkle root.- Returns:
- the updated validator keys merkle root
- Throws:
Exception- - if it was not possible to compute the root
-
getUpdatedSigningKeysSkSignatures
public SchnorrSignature[] getUpdatedSigningKeysSkSignatures()
-
getUpdatedSigningKeysMkSignatures
public SchnorrSignature[] getUpdatedSigningKeysMkSignatures()
-
getUpdatedMasterKeysSkSignatures
public SchnorrSignature[] getUpdatedMasterKeysSkSignatures()
-
getUpdatedMasterKeysMkSignatures
public SchnorrSignature[] getUpdatedMasterKeysMkSignatures()
-
setUpdatedSigningKeysSkSignatures
public void setUpdatedSigningKeysSkSignatures(SchnorrSignature[] updatedSigningKeysSkSignatures)
-
setUpdatedSigningKeysMkSignatures
public void setUpdatedSigningKeysMkSignatures(SchnorrSignature[] updatedSigningKeysMkSignatures)
-
setUpdatedMasterKeysSkSignatures
public void setUpdatedMasterKeysSkSignatures(SchnorrSignature[] updatedMasterKeysSkSignatures)
-
setUpdatedMasterKeysMkSignatures
public void setUpdatedMasterKeysMkSignatures(SchnorrSignature[] updatedMasterKeysMkSignatures)
-
setSigningKeys
public void setSigningKeys(SchnorrPublicKey[] signingKeys)
-
setMasterKeys
public void setMasterKeys(SchnorrPublicKey[] masterKeys)
-
setUpdatedSigningKeys
public void setUpdatedSigningKeys(SchnorrPublicKey[] updatedSigningKeys)
-
setUpdatedMasterKeys
public void setUpdatedMasterKeys(SchnorrPublicKey[] updatedMasterKeys)
-
close
public void close() throws Exception- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-
-