[ibe] add comment

dev
MITSUNARI Shigeo 7 years ago
parent 25285fcc1c
commit 80ff5db6b8
  1. 4
      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())

Loading…
Cancel
Save