aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMITSUNARI Shigeo <herumi@nifty.com>2016-08-21 18:35:16 +0800
committerMITSUNARI Shigeo <herumi@nifty.com>2016-08-21 18:35:16 +0800
commitfec0cc33f5074e76764f87eaf6b26c7ed8bca5a4 (patch)
tree14cb741c5abdcfd1bf4eb8c13af7d7998beab27f
parent0314102dd540d4e5f59ed34dfb1e74b7e39f1659 (diff)
downloaddexon-bls-fec0cc33f5074e76764f87eaf6b26c7ed8bca5a4.tar
dexon-bls-fec0cc33f5074e76764f87eaf6b26c7ed8bca5a4.tar.gz
dexon-bls-fec0cc33f5074e76764f87eaf6b26c7ed8bca5a4.tar.bz2
dexon-bls-fec0cc33f5074e76764f87eaf6b26c7ed8bca5a4.tar.lz
dexon-bls-fec0cc33f5074e76764f87eaf6b26c7ed8bca5a4.tar.xz
dexon-bls-fec0cc33f5074e76764f87eaf6b26c7ed8bca5a4.tar.zst
dexon-bls-fec0cc33f5074e76764f87eaf6b26c7ed8bca5a4.zip
fix format
-rw-r--r--readme.md13
1 files changed, 13 insertions, 0 deletions
diff --git a/readme.md b/readme.md
index 1fdc4fb..a4b28de 100644
--- a/readme.md
+++ b/readme.md
@@ -39,29 +39,37 @@ sQ in G2; public key
s H(m) in G1; signature of m
verify ; e(sQ, H(m)) = e(Q, s H(m))
```
+
+```
void bls::init();
```
+
Initialize this library. Call this once to use the other api.
```
void SecretKey::init();
```
+
Initialize the instance of SecretKey. `s` is a random number.
```
void SecretKey::getPublicKey(PublicKey& pub) const;
```
+
Get public key `sQ` for the secret key `s`.
```
void SecretKey::sign(Sign& sign, const std::string& m) const
```
+
Make sign `s H(m)` from message m.
```
bool Sign::verify(const PublicKey& pub, const std::string& m) const
```
+
Verify sign with pub and m and return true if it is valid.
+
```
e(sQ, H(m)) == e(Q, s H(m))
```
@@ -71,12 +79,14 @@ e(sQ, H(m)) == e(Q, s H(m))
```
void SecretKey::getMasterSecretKey(SecretKeyVec& msk, int k) const
```
+
Prepare k-out-of-n secret sharing for the secret key.
`msk[0]` is the original secret key `s` and `msk[i]` for i > 0 are random secret key.
```
void SecretKey::set(const SecretKeyVec& msk, int id)
```
+
Make secret key f(id) from msk and id where f(x) = msk[0] + msk[1] x + ... + msk[k-1] x^{k-1}.
You can make a public key `f(id)Q` from each secret key f(id) for id != 0 and sign a message.
@@ -84,6 +94,7 @@ You can make a public key `f(id)Q` from each secret key f(id) for id != 0 and si
```
void Sign::recover(const SignVec& signVec);
```
+
Collect k sign `f(id) H(m)` for a message m and recover the original signature `s H(m)` for the secret key `s`.
### PoP (Proof of Possesion)
@@ -91,11 +102,13 @@ Collect k sign `f(id) H(m)` for a message m and recover the original signature `
```
void SecretKey::getPop(Sign& pop, const PublicKey& pub) const
```
+
Sign pub.getStr() and make a pop `s H(sQ)`
```
bool Sign::verify(const PublicKey& pub) const
```
+
Verify a public key by pop.
# License