Files: fc378c64787f6a082a4aec751ccf9fdffe72e076 / examples / signing.js
382 bytesRaw
1 | const bls = require('../') |
2 | |
3 | bls.onModuleInit(() => { |
4 | bls.init() |
5 | |
6 | const sec = bls.secretKey() |
7 | const pub = bls.publicKey() |
8 | const sig = bls.signature() |
9 | |
10 | bls.secretKeySetByCSPRNG(sec) |
11 | const msg = 'hello world' |
12 | bls.sign(sig, sec, msg) |
13 | |
14 | bls.getPublicKey(pub, sec) |
15 | |
16 | const v = bls.verify(sig, pub, msg) |
17 | console.log(v) |
18 | |
19 | bls.free(sec) |
20 | bls.free(sig) |
21 | bls.free(pub) |
22 | }) |
23 |
Built with git-ssb-web