git ssb

0+

wanderer🌟 / bls-lib



Commit 825b7f5d6cf62e27901bb25d8aa1174175515a12

remove redundant example

Signed-off-by: wanderer <mjbecze@gmail.com>
wanderer committed on 10/7/2017, 10:02:09 PM
Parent: 505e85ffe559bfa6be28987b425bb6e6880096dc

Files changed

examples/diffieHellman.jschanged
examples/dh.jsdeleted
examples/diffieHellman.jsView
@@ -1,6 +1,7 @@
11 const bls = require('../')
22
3 +// Diffie–Hellman key exchange
34 bls.onModuleInit(() => {
45 bls.init()
56
67 const sk1 = bls.secretKey()
@@ -11,13 +12,15 @@
1112
1213 bls.getPublicKey(pk1, sk1)
1314 bls.getPublicKey(pk2, sk2)
1415
15- const out1 = bls.publicKey()
16- const out2 = bls.publicKey()
16 + const sharedSec1 = bls.publicKey()
17 + const sharedSec2 = bls.publicKey()
1718
18- bls.dhKeyExchange(out1, sk1, pk2)
19- bls.dhKeyExchange(out2, sk2, pk1)
19 + bls.dhKeyExchange(sharedSec1, sk1, pk2)
20 + bls.dhKeyExchange(sharedSec2, sk2, pk1)
2021
21- const r = bls.publicKeyIsEqual(out1, out2)
22 + const r = bls.publicKeyIsEqual(sharedSec1, sharedSec2)
2223 console.log(r)
24 +
25 + bls.freeArray([sk1, sk2, pk1, pk2, sharedSec2, sharedSec1])
2326 })
examples/dh.jsView
@@ -1,26 +1,0 @@
1-const bls = require('../')
2-
3-// Diffie–Hellman key exchange
4-bls.onModuleInit(() => {
5- bls.init()
6-
7- const sk1 = bls.secretKey()
8- const sk2 = bls.secretKey()
9-
10- const pk1 = bls.publicKey()
11- const pk2 = bls.publicKey()
12-
13- bls.getPublicKey(pk1, sk1)
14- bls.getPublicKey(pk2, sk2)
15-
16- const sharedSec1 = bls.publicKey()
17- const sharedSec2 = bls.publicKey()
18-
19- bls.dhKeyExchange(sharedSec1, sk1, pk2)
20- bls.dhKeyExchange(sharedSec2, sk2, pk1)
21-
22- const r = bls.publicKeyIsEqual(sharedSec1, sharedSec2)
23- console.log(r)
24-
25- bls.freeArray([sk1, sk2, pk1, pk2, sharedSec2, sharedSec1])
26-})

Built with git-ssb-web