git ssb

0+

wanderer🌟 / bls-lib



Tree: dd9d879f2923aa9578ec24749c24fc658a74ff0b

Files: dd9d879f2923aa9578ec24749c24fc658a74ff0b / examples / addingKeys.js

475 bytesRaw
1const bls = require('../')
2
3bls.onModuleInit(() => {
4 bls.init()
5
6 const sk1 = bls.secretKey()
7 const sk2 = bls.secretKey()
8
9 const pk1 = bls.publicKey()
10 const pk2 = bls.publicKey()
11
12 bls.getPublicKey(pk1, sk1)
13 bls.getPublicKey(pk2, sk2)
14
15 bls.publicKeyAdd(pk1, pk2)
16
17 bls.secretKeyAdd(sk1, sk2)
18
19 const pk3 = bls.publicKey()
20 bls.getPublicKey(pk3, sk1)
21
22 const r = bls.publicKeyIsEqual(pk3, pk1)
23 console.log(r)
24
25 bls.freeArray([sk1, sk2, pk1, pk2, pk3])
26})
27

Built with git-ssb-web