private Share[] getKeyShares(
DepSkySDataUnit reg, byte[] secretkey) throws Exception {
PVSSEngine engine = PVSSEngine.getInstance(N, T, NUM_BITS);
PublicInfo info = engine.getPublicInfo();
reg.setPVSSinfo(info);
BigInteger[] secretKeys = engine.generateSecretKeys();
BigInteger[] publicKeys = new BigInteger[N];
for (int i = 0; i < N; i++) {
publicKeys[i] = engine.generatePublicKey(secretKeys[i]);
}
PublishedShares publishedShares = engine.generalPublishShares(
secretkey, publicKeys, 1);//generate shares
Share[] shares = new Share[N];
for (int i = 0; i < N; i++) {
shares[i] = publishedShares.getShare(i, secretKeys[i], info, publicKeys);
}