diff options
author | MITSUNARI Shigeo <herumi@nifty.com> | 2017-11-28 10:55:40 +0800 |
---|---|---|
committer | MITSUNARI Shigeo <herumi@nifty.com> | 2017-11-28 10:55:40 +0800 |
commit | 80ff5db6b8cb45773cc4b6d183c850ef1b0957f4 (patch) | |
tree | 4a0131347d8fe5b2c1f9e8bb6aa8676d0e36d7c7 | |
parent | 25285fcc1c687004da4815d00ce617b617929d3b (diff) | |
download | tangerine-mcl-80ff5db6b8cb45773cc4b6d183c850ef1b0957f4.tar.gz tangerine-mcl-80ff5db6b8cb45773cc4b6d183c850ef1b0957f4.tar.zst tangerine-mcl-80ff5db6b8cb45773cc4b6d183c850ef1b0957f4.zip |
[ibe] add comment
-rw-r--r-- | docs/demo/ibe-demo.js | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/docs/demo/ibe-demo.js b/docs/demo/ibe-demo.js index 72405c5..e1b9d37 100644 --- a/docs/demo/ibe-demo.js +++ b/docs/demo/ibe-demo.js @@ -8,6 +8,7 @@ mcl.init() setText('status', 'ok') }) +// Enc(m) = [r P, m + h(e(r mpk, H(id)))] function IDenc(id, P, mpk, m) { const r = new mcl.Fr() r.setByCSPRNG() @@ -29,10 +30,13 @@ function onClickIBE() { const msk = new mcl.Fr() msk.setByCSPRNG() setText('msk', msk.toHexStr()) + // mpk = msk P const mpk = mcl.mul(P, msk) setText('mpk', mpk.toHexStr()) + // user KeyGen const id = getText('id') + // sk = msk H(id) const sk = mcl.mul(mcl.hashAndMapToG2(id), msk) setText('sk', sk.toHexStr()) |