· 7 years ago · Aug 31, 2018, 01:52 AM
1const cothority = require("./lib/");
2const misc = cothority.misc
3
4const kyber = require("../kyber/dist/bundle.node.min.js")
5const schnorr = kyber.sign.schnorr
6const ed = kyber.curve.edwards25519
7const group = new ed.Curve()
8const secretKey = group.scalar().pick()
9const publicKey = group.point().mul(secretKey, null)
10const message = new Uint8Array([1, 2, 3])
11
12const sig = schnorr.sign(group, secretKey, message)
13const ver = schnorr.verify(group, publicKey, message, sig)
14
15console.log(ver)