aboutsummaryrefslogtreecommitdiffstats
path: root/sample/bls_smpl.cpp
diff options
context:
space:
mode:
authorMITSUNARI Shigeo <herumi@nifty.com>2016-08-21 14:46:11 +0800
committerMITSUNARI Shigeo <herumi@nifty.com>2016-08-21 14:46:11 +0800
commit7a42782e361af6ea7b7e199c7aef4214071c441e (patch)
tree9e3b8a5ea479350f2e27e6b53816bb1c8cad01a8 /sample/bls_smpl.cpp
parent76d28310b055dd596f4cd67fc7de49624948a85f (diff)
downloaddexon-bls-7a42782e361af6ea7b7e199c7aef4214071c441e.tar
dexon-bls-7a42782e361af6ea7b7e199c7aef4214071c441e.tar.gz
dexon-bls-7a42782e361af6ea7b7e199c7aef4214071c441e.tar.bz2
dexon-bls-7a42782e361af6ea7b7e199c7aef4214071c441e.tar.lz
dexon-bls-7a42782e361af6ea7b7e199c7aef4214071c441e.tar.xz
dexon-bls-7a42782e361af6ea7b7e199c7aef4214071c441e.tar.zst
dexon-bls-7a42782e361af6ea7b7e199c7aef4214071c441e.zip
sample ok
Diffstat (limited to 'sample/bls_smpl.cpp')
-rw-r--r--sample/bls_smpl.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/sample/bls_smpl.cpp b/sample/bls_smpl.cpp
index 8db2e72..c4215cc 100644
--- a/sample/bls_smpl.cpp
+++ b/sample/bls_smpl.cpp
@@ -80,8 +80,12 @@ int share(int n, int k)
printf("%d-out-of-%d threshold sharing\n", k, n);
bls::PrivateKey prv;
load(prv, prvFile);
- std::vector<bls::PrivateKey> prvVec;
- prv.share(prvVec, n, k);
+ bls::PrivateKeyVec msk;
+ prv.getMasterPrivateKey(msk, k);
+ std::vector<bls::PrivateKey> prvVec(n);
+ for (int i = 0; i < n; i++) {
+ prvVec[i].set(msk, i + 1);
+ }
for (int i = 0; i < n; i++) {
int id = prvVec[i].getId();
save(prvFile, prvVec[i], id);