git ssb

0+

wanderer🌟 / bls-lib



Commit 402b1e3e1a62fb7d66e18edddf8959874d853d03

rebuild docs

Signed-off-by: wanderer <mjbecze@gmail.com>
wanderer committed on 10/7/2017, 6:01:13 AM
Parent: 410c677aaa8a9f8c0a2a117b9d72c7df060bd4bb

Files changed

docs/index.mdchanged
docs/index.mdView
@@ -10,27 +10,31 @@
1010 - [secretKey](#secretkey)
1111 - [publicKey](#publickey)
1212 - [signature](#signature)
1313 - [free](#free)
14 +- [freeArray](#freearray)
1415 - [idSetInt](#idsetint)
1516 - [sign](#sign)
1617 - [verify](#verify)
17-- [publicKeySerialize](#publickeyserialize)
18-- [secretKeySerialize](#secretkeyserialize)
19-- [signatureSerialize](#signatureserialize)
18 +- [publicKeyExport](#publickeyexport)
19 +- [secretKeyExport](#secretkeyexport)
20 +- [signatureExport](#signatureexport)
2021 - [hashToSecretKey](#hashtosecretkey)
2122 - [secretKeyDeserialize](#secretkeydeserialize)
23 +- [secretKeyImport](#secretkeyimport)
2224 - [publicKeyDeserialize](#publickeydeserialize)
25 +- [publicKeyImport](#publickeyimport)
2326 - [signatureDeserialize](#signaturedeserialize)
27 +- [signatureImport](#signatureimport)
2428 - [secretKeyRecover](#secretkeyrecover)
2529 - [publicKeyRecover](#publickeyrecover)
2630 - [signatureRecover](#signaturerecover)
2731 - [secretKeyShare](#secretkeyshare)
2832 - [publicKeyShare](#publickeyshare)
2933
3034 ## onModuleInit
3135
32-[index.js:13-20](https://github.com/wanderer/bls-lib/blob/29702674041ace08d16a5600105230669f208404/index.js#L13-L20 "Source code on GitHub")
36 +[index.js:13-20](https://github.com/wanderer/bls-lib/blob/0e97e39f3b15ac41e2d87017b73dcad5b6950276/index.js#L13-L20 "Source code on GitHub")
3337
3438 takes a callback that is called once the module is setup
3539
3640 **Parameters**
@@ -38,27 +42,27 @@
3842 - `cb`
3943
4044 ## MCLBN_CURVE_FP254BNB
4145
42-[index.js:25-25](https://github.com/wanderer/bls-lib/blob/29702674041ace08d16a5600105230669f208404/index.js#L25-L25 "Source code on GitHub")
46 +[index.js:25-25](https://github.com/wanderer/bls-lib/blob/0e97e39f3b15ac41e2d87017b73dcad5b6950276/index.js#L25-L25 "Source code on GitHub")
4347
4448 the FP254BNB curve
4549
4650 ## MCLBN_CURVE_FP382_1
4751
48-[index.js:30-30](https://github.com/wanderer/bls-lib/blob/29702674041ace08d16a5600105230669f208404/index.js#L30-L30 "Source code on GitHub")
52 +[index.js:30-30](https://github.com/wanderer/bls-lib/blob/0e97e39f3b15ac41e2d87017b73dcad5b6950276/index.js#L30-L30 "Source code on GitHub")
4953
5054 the FP382_1 curve
5155
5256 ## MCLBN_CURVE_FP382_2
5357
54-[index.js:35-35](https://github.com/wanderer/bls-lib/blob/29702674041ace08d16a5600105230669f208404/index.js#L35-L35 "Source code on GitHub")
58 +[index.js:35-35](https://github.com/wanderer/bls-lib/blob/0e97e39f3b15ac41e2d87017b73dcad5b6950276/index.js#L35-L35 "Source code on GitHub")
5559
5660 the FP382_2 curve
5761
5862 ## init
5963
60-[index.js:52-54](https://github.com/wanderer/bls-lib/blob/29702674041ace08d16a5600105230669f208404/index.js#L52-L54 "Source code on GitHub")
64 +[index.js:52-54](https://github.com/wanderer/bls-lib/blob/0e97e39f3b15ac41e2d87017b73dcad5b6950276/index.js#L52-L54 "Source code on GitHub")
6165
6266 intailizes the libary to use a given curve
6367
6468 **Parameters**
@@ -66,43 +70,53 @@
6670 - `curve` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** the curves that can be used are MCLBN_CURVE_FP254BNB, MCLBN_CURVE_FP382_1 or MCLBN_CURVE_FP382_2 (optional, default `exports.MCLBN_CURVE_FP254BNB`)
6771
6872 ## secretKey
6973
70-[index.js:60-62](https://github.com/wanderer/bls-lib/blob/29702674041ace08d16a5600105230669f208404/index.js#L60-L62 "Source code on GitHub")
74 +[index.js:60-62](https://github.com/wanderer/bls-lib/blob/0e97e39f3b15ac41e2d87017b73dcad5b6950276/index.js#L60-L62 "Source code on GitHub")
7175
7276 allocates a secret key
7377
7478 Returns **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** the pointer to the key
7579
7680 ## publicKey
7781
78-[index.js:68-70](https://github.com/wanderer/bls-lib/blob/29702674041ace08d16a5600105230669f208404/index.js#L68-L70 "Source code on GitHub")
82 +[index.js:68-70](https://github.com/wanderer/bls-lib/blob/0e97e39f3b15ac41e2d87017b73dcad5b6950276/index.js#L68-L70 "Source code on GitHub")
7983
8084 allocates a secret key
8185
8286 Returns **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** the pointer to the key
8387
8488 ## signature
8589
86-[index.js:76-78](https://github.com/wanderer/bls-lib/blob/29702674041ace08d16a5600105230669f208404/index.js#L76-L78 "Source code on GitHub")
90 +[index.js:76-78](https://github.com/wanderer/bls-lib/blob/0e97e39f3b15ac41e2d87017b73dcad5b6950276/index.js#L76-L78 "Source code on GitHub")
8791
8892 allocates a signature
8993
9094 Returns **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** the pointer to the signture
9195
9296 ## free
9397
94-[index.js:83-85](https://github.com/wanderer/bls-lib/blob/29702674041ace08d16a5600105230669f208404/index.js#L83-L85 "Source code on GitHub")
98 +[index.js:83-85](https://github.com/wanderer/bls-lib/blob/0e97e39f3b15ac41e2d87017b73dcad5b6950276/index.js#L83-L85 "Source code on GitHub")
9599
96100 frees a pointer
97101
98102 **Parameters**
99103
100104 - `x`
101105
106 +## freeArray
107 +
108 +[index.js:90-92](https://github.com/wanderer/bls-lib/blob/0e97e39f3b15ac41e2d87017b73dcad5b6950276/index.js#L90-L92 "Source code on GitHub")
109 +
110 +frees an array of pointers
111 +
112 +**Parameters**
113 +
114 +- `a`
115 +
102116 ## idSetInt
103117
104-[index.js:92-97](https://github.com/wanderer/bls-lib/blob/29702674041ace08d16a5600105230669f208404/index.js#L92-L97 "Source code on GitHub")
118 +[index.js:99-104](https://github.com/wanderer/bls-lib/blob/0e97e39f3b15ac41e2d87017b73dcad5b6950276/index.js#L99-L104 "Source code on GitHub")
105119
106120 creates an ID to use in with threshold groups
107121
108122 **Parameters**
@@ -111,9 +125,9 @@
111125 - `n` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** a int repsenting the ID. n cannot be zero.
112126
113127 ## sign
114128
115-[index.js:105-105](https://github.com/wanderer/bls-lib/blob/29702674041ace08d16a5600105230669f208404/index.js#L105-L105 "Source code on GitHub")
129 +[index.js:112-112](https://github.com/wanderer/bls-lib/blob/0e97e39f3b15ac41e2d87017b73dcad5b6950276/index.js#L112-L112 "Source code on GitHub")
116130
117131 signs a message
118132
119133 **Parameters**
@@ -123,9 +137,9 @@
123137 - `msg` **([TypedArray](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray) \| [String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String))** the message to sign
124138
125139 ## verify
126140
127-[index.js:113-113](https://github.com/wanderer/bls-lib/blob/29702674041ace08d16a5600105230669f208404/index.js#L113-L113 "Source code on GitHub")
141 +[index.js:120-120](https://github.com/wanderer/bls-lib/blob/0e97e39f3b15ac41e2d87017b73dcad5b6950276/index.js#L120-L120 "Source code on GitHub")
128142
129143 verifies a signature
130144
131145 **Parameters**
@@ -133,11 +147,11 @@
133147 - `sig` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** a pointer to the a signature
134148 - `pk` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** a pointer to the secret key
135149 - `msg` **([TypedArray](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray) \| [String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String))** the message that was signed
136150
137-## publicKeySerialize
151 +## publicKeyExport
138152
139-[index.js:120-120](https://github.com/wanderer/bls-lib/blob/29702674041ace08d16a5600105230669f208404/index.js#L120-L120 "Source code on GitHub")
153 +[index.js:127-127](https://github.com/wanderer/bls-lib/blob/0e97e39f3b15ac41e2d87017b73dcad5b6950276/index.js#L127-L127 "Source code on GitHub")
140154
141155 given a pointer to a public key this returns 64 byte Int8Array containing the key
142156
143157 **Parameters**
@@ -145,11 +159,11 @@
145159 - `pk` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** a pointer to the secret key
146160
147161 Returns **[TypedArray](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray)**
148162
149-## secretKeySerialize
163 +## secretKeyExport
150164
151-[index.js:127-127](https://github.com/wanderer/bls-lib/blob/29702674041ace08d16a5600105230669f208404/index.js#L127-L127 "Source code on GitHub")
165 +[index.js:134-134](https://github.com/wanderer/bls-lib/blob/0e97e39f3b15ac41e2d87017b73dcad5b6950276/index.js#L134-L134 "Source code on GitHub")
152166
153167 given a pointer to a secret key this returns 32 byte Int8Array containing the key
154168
155169 **Parameters**
@@ -157,11 +171,11 @@
157171 - `pk` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** a pointer to the secret key
158172
159173 Returns **[TypedArray](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray)**
160174
161-## signatureSerialize
175 +## signatureExport
162176
163-[index.js:134-134](https://github.com/wanderer/bls-lib/blob/29702674041ace08d16a5600105230669f208404/index.js#L134-L134 "Source code on GitHub")
177 +[index.js:141-141](https://github.com/wanderer/bls-lib/blob/0e97e39f3b15ac41e2d87017b73dcad5b6950276/index.js#L141-L141 "Source code on GitHub")
164178
165179 given a pointer to a signature this returns 32 byte Int8Array containing the signature
166180
167181 **Parameters**
@@ -171,9 +185,9 @@
171185 Returns **[TypedArray](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray)**
172186
173187 ## hashToSecretKey
174188
175-[index.js:141-141](https://github.com/wanderer/bls-lib/blob/29702674041ace08d16a5600105230669f208404/index.js#L141-L141 "Source code on GitHub")
189 +[index.js:148-148](https://github.com/wanderer/bls-lib/blob/0e97e39f3b15ac41e2d87017b73dcad5b6950276/index.js#L148-L148 "Source code on GitHub")
176190
177191 generates a secret key given a seed phrase.
178192
179193 **Parameters**
@@ -182,42 +196,82 @@
182196 - `seed` **([String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) \| [TypedArray](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray))** the seed phrase
183197
184198 ## secretKeyDeserialize
185199
186-[index.js:148-148](https://github.com/wanderer/bls-lib/blob/29702674041ace08d16a5600105230669f208404/index.js#L148-L148 "Source code on GitHub")
200 +[index.js:155-155](https://github.com/wanderer/bls-lib/blob/0e97e39f3b15ac41e2d87017b73dcad5b6950276/index.js#L155-L155 "Source code on GitHub")
187201
188202 write a secretKey to memory
189203
190204 **Parameters**
191205
192206 - `sk` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** a pointer to a secret key
193207 - `array` **[TypedArray](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray)** the secret key as a 32 byte TypedArray
194208
209 +## secretKeyImport
210 +
211 +[index.js:163-167](https://github.com/wanderer/bls-lib/blob/0e97e39f3b15ac41e2d87017b73dcad5b6950276/index.js#L163-L167 "Source code on GitHub")
212 +
213 +write a secretKey to memory and returns a pointer to it
214 +
215 +**Parameters**
216 +
217 +- `buf`
218 +- `sk` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** a pointer to a secret key
219 +- `array` **[TypedArray](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray)** the secret key as a 32 byte TypedArray
220 +
221 +Returns **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)**
222 +
195223 ## publicKeyDeserialize
196224
197-[index.js:155-155](https://github.com/wanderer/bls-lib/blob/29702674041ace08d16a5600105230669f208404/index.js#L155-L155 "Source code on GitHub")
225 +[index.js:174-174](https://github.com/wanderer/bls-lib/blob/0e97e39f3b15ac41e2d87017b73dcad5b6950276/index.js#L174-L174 "Source code on GitHub")
198226
199227 write a publicKey to memory
200228
201229 **Parameters**
202230
203-- `sk` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** a pointer to a secret key
231 +- `sk` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** a pointer to a public key
204232 - `array` **[TypedArray](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray)** the secret key as a 64 byte TypedArray
205233
234 +## publicKeyImport
235 +
236 +[index.js:181-185](https://github.com/wanderer/bls-lib/blob/0e97e39f3b15ac41e2d87017b73dcad5b6950276/index.js#L181-L185 "Source code on GitHub")
237 +
238 +write a publicKey to memory and returns a pointer to it
239 +
240 +**Parameters**
241 +
242 +- `buf`
243 +- `array` **[TypedArray](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray)** the secret key as a 64 byte TypedArray
244 +
245 +Returns **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)**
246 +
206247 ## signatureDeserialize
207248
208-[index.js:162-162](https://github.com/wanderer/bls-lib/blob/29702674041ace08d16a5600105230669f208404/index.js#L162-L162 "Source code on GitHub")
249 +[index.js:192-192](https://github.com/wanderer/bls-lib/blob/0e97e39f3b15ac41e2d87017b73dcad5b6950276/index.js#L192-L192 "Source code on GitHub")
209250
210251 write a signature to memory
211252
212253 **Parameters**
213254
214255 - `sig` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** a pointer to a signature
215256 - `array` **[TypedArray](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray)** the signature as a 32 byte TypedArray
216257
258 +## signatureImport
259 +
260 +[index.js:199-203](https://github.com/wanderer/bls-lib/blob/0e97e39f3b15ac41e2d87017b73dcad5b6950276/index.js#L199-L203 "Source code on GitHub")
261 +
262 +write a signature to memory and returns a pointer to it
263 +
264 +**Parameters**
265 +
266 +- `buf`
267 +- `array` **[TypedArray](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray)** the signature as a 32 byte TypedArray
268 +
269 +Returns **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)**
270 +
217271 ## secretKeyRecover
218272
219-[index.js:170-170](https://github.com/wanderer/bls-lib/blob/29702674041ace08d16a5600105230669f208404/index.js#L170-L170 "Source code on GitHub")
273 +[index.js:211-211](https://github.com/wanderer/bls-lib/blob/0e97e39f3b15ac41e2d87017b73dcad5b6950276/index.js#L211-L211 "Source code on GitHub")
220274
221275 Recovers a secret key for a group given the groups secret keys shares and the groups ids
222276
223277 **Parameters**
@@ -227,9 +281,9 @@
227281 - `idArrah` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)&lt;numbers>** an array of pointers to ids in the groups. The length of the array should be the threshold number for the group
228282
229283 ## publicKeyRecover
230284
231-[index.js:178-178](https://github.com/wanderer/bls-lib/blob/29702674041ace08d16a5600105230669f208404/index.js#L178-L178 "Source code on GitHub")
285 +[index.js:219-219](https://github.com/wanderer/bls-lib/blob/0e97e39f3b15ac41e2d87017b73dcad5b6950276/index.js#L219-L219 "Source code on GitHub")
232286
233287 Recovers a public key for a group given the groups public keys shares and the groups ids
234288
235289 **Parameters**
@@ -239,9 +293,9 @@
239293 - `idArrah` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)&lt;numbers>** an array of pointers to ids in the groups. The length of the array should be the threshold number for the group
240294
241295 ## signatureRecover
242296
243-[index.js:186-186](https://github.com/wanderer/bls-lib/blob/29702674041ace08d16a5600105230669f208404/index.js#L186-L186 "Source code on GitHub")
297 +[index.js:227-227](https://github.com/wanderer/bls-lib/blob/0e97e39f3b15ac41e2d87017b73dcad5b6950276/index.js#L227-L227 "Source code on GitHub")
244298
245299 Recovers a signature for a group given the groups public keys shares and the groups ids
246300
247301 **Parameters**
@@ -251,9 +305,9 @@
251305 - `idArrah` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)&lt;numbers>** an array of pointers to ids in the groups. The length of the array should be the threshold number for the group
252306
253307 ## secretKeyShare
254308
255-[index.js:194-194](https://github.com/wanderer/bls-lib/blob/29702674041ace08d16a5600105230669f208404/index.js#L194-L194 "Source code on GitHub")
309 +[index.js:235-235](https://github.com/wanderer/bls-lib/blob/0e97e39f3b15ac41e2d87017b73dcad5b6950276/index.js#L235-L235 "Source code on GitHub")
256310
257311 Creates a secket key share for a group member given the groups members id (which is a the secret key) and array of master secret keys
258312
259313 **Parameters**
@@ -263,9 +317,9 @@
263317 - `id` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** the id of the member
264318
265319 ## publicKeyShare
266320
267-[index.js:202-202](https://github.com/wanderer/bls-lib/blob/29702674041ace08d16a5600105230669f208404/index.js#L202-L202 "Source code on GitHub")
321 +[index.js:243-243](https://github.com/wanderer/bls-lib/blob/0e97e39f3b15ac41e2d87017b73dcad5b6950276/index.js#L243-L243 "Source code on GitHub")
268322
269323 Creates a public key share for a group member given the groups members id (which is a the secret key) and array of master public keys
270324
271325 **Parameters**

Built with git-ssb-web