git ssb

0+

wanderer🌟 / bls-lib



Commit 9b289e702feb8e028fc80ea5bf81b5040f1e5f8c

fix various typos

Norton Wang committed on 2/2/2018, 9:38:43 PM
Parent: 3c007f5ed0e57b38cc7df4239d9631d617eef1cc

Files changed

README.mdchanged
docs/index.mdchanged
index.jschanged
package.jsonchanged
README.mdView
@@ -2,9 +2,9 @@
22 [![Build Status](https://img.shields.io/travis/dfinity/js-bls-lib.svg?branch=master&style=flat-square)](https://travis-ci.org/dfinity/js-bls-lib)
33 [![Coverage Status](https://img.shields.io/coveralls/dfinity/js-bls-lib.svg?style=flat-square)](https://coveralls.io/r/dfinity/js-bls-lib)
44
55
6-[![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard)
6 +[![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard)
77
88 # Synopsis
99
1010 This libary provides primitives for creating and verifying [BLS threshold signatures](https://en.wikipedia.org/wiki/Boneh–Lynn–Shacham) in Webassembly with a JS API. All the hard work is done by [herumi/bls](https://github.com/herumi/bls). This wraps the bls C++ code which is compiled to Webassembly for easier use.
@@ -44,19 +44,19 @@
4444
4545 # API
4646 [./docs/](./docs/index.md)
4747
48-# Dependants
49-* [verifible secret sharing](https://github.com/wanderer/vss)
50-* [distributed key generation](https://github.com/wanderer/dkg)
48 +# Dependents
49 +* [verifiable secret sharing](https://github.com/dfinity/vss)
50 +* [distributed key generation](https://github.com/dfinity/dkg)
5151
5252 # Building
5353
54-First install the dependancies [emscripten](https://github.com/kripken/emscripten) and [ninja](ninja-build.org)
54 +First install the dependencies [emscripten](https://github.com/kripken/emscripten) and [ninja](ninja-build.org)
5555
5656 ```
57- git clone --recursive https://github.com/wanderer/bls-lib.git
58- cd bls-lib/build
57 + git clone --recursive https://github.com/dfinity/js-bls-lib.git
58 + cd js-bls-lib/build
5959 ninja
6060 ```
6161
6262 ## License
docs/index.mdView
@@ -40,391 +40,391 @@
4040 - [dhKeyExchange](#dhkeyexchange)
4141
4242 ## onModuleInit
4343
44-[index.js:14-21](https://github.com/dfinity/bls-lib/blob/2b6104bd4d6a111c264a5b60ec590f39c84b3da0/index.js#L14-L21 "Source code on GitHub")
44 +[index.js:14-21](https://github.com/dfinity/js-bls-lib/blob/3c007f5ed0e57b38cc7df4239d9631d617eef1cc/index.js#L14-L21 "Source code on GitHub")
4545
46-takes a callback that is called once the module is setup
46 +Takes a callback that is called once the module is setup
4747
4848 **Parameters**
4949
5050 - `cb`
5151
5252 ## MCLBN_CURVE_FP254BNB
5353
54-[index.js:26-26](https://github.com/dfinity/bls-lib/blob/2b6104bd4d6a111c264a5b60ec590f39c84b3da0/index.js#L26-L26 "Source code on GitHub")
54 +[index.js:26-26](https://github.com/dfinity/js-bls-lib/blob/3c007f5ed0e57b38cc7df4239d9631d617eef1cc/index.js#L26-L26 "Source code on GitHub")
5555
56-the FP254BNB curve
56 +The FP254BNB curve
5757
5858 ## MCLBN_CURVE_FP382_1
5959
60-[index.js:31-31](https://github.com/dfinity/bls-lib/blob/2b6104bd4d6a111c264a5b60ec590f39c84b3da0/index.js#L31-L31 "Source code on GitHub")
60 +[index.js:31-31](https://github.com/dfinity/js-bls-lib/blob/3c007f5ed0e57b38cc7df4239d9631d617eef1cc/index.js#L31-L31 "Source code on GitHub")
6161
62-the FP382_1 curve
62 +The FP382_1 curve
6363
6464 ## MCLBN_CURVE_FP382_2
6565
66-[index.js:36-36](https://github.com/dfinity/bls-lib/blob/2b6104bd4d6a111c264a5b60ec590f39c84b3da0/index.js#L36-L36 "Source code on GitHub")
66 +[index.js:36-36](https://github.com/dfinity/js-bls-lib/blob/3c007f5ed0e57b38cc7df4239d9631d617eef1cc/index.js#L36-L36 "Source code on GitHub")
6767
68-the FP382_2 curve
68 +The FP382_2 curve
6969
7070 ## init
7171
72-[index.js:49-51](https://github.com/dfinity/bls-lib/blob/2b6104bd4d6a111c264a5b60ec590f39c84b3da0/index.js#L49-L51 "Source code on GitHub")
72 +[index.js:49-51](https://github.com/dfinity/js-bls-lib/blob/3c007f5ed0e57b38cc7df4239d9631d617eef1cc/index.js#L49-L51 "Source code on GitHub")
7373
74-intailizes the libary to use a given curve
74 +Initializes the library to use a given curve
7575
7676 **Parameters**
7777
78-- `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`)
78 +- `curve` **[number](https://developer.mozilla.org/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`)
7979
8080 ## secretKey
8181
82-[index.js:57-59](https://github.com/dfinity/bls-lib/blob/2b6104bd4d6a111c264a5b60ec590f39c84b3da0/index.js#L57-L59 "Source code on GitHub")
82 +[index.js:57-59](https://github.com/dfinity/js-bls-lib/blob/3c007f5ed0e57b38cc7df4239d9631d617eef1cc/index.js#L57-L59 "Source code on GitHub")
8383
84-allocates a secret key
84 +Allocates a secret key
8585
86-Returns **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** the pointer to the key
86 +Returns **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** the pointer to the key
8787
8888 ## publicKey
8989
90-[index.js:65-67](https://github.com/dfinity/bls-lib/blob/2b6104bd4d6a111c264a5b60ec590f39c84b3da0/index.js#L65-L67 "Source code on GitHub")
90 +[index.js:65-67](https://github.com/dfinity/js-bls-lib/blob/3c007f5ed0e57b38cc7df4239d9631d617eef1cc/index.js#L65-L67 "Source code on GitHub")
9191
92-allocates a secret key
92 +Allocates a secret key
9393
94-Returns **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** the pointer to the key
94 +Returns **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** the pointer to the key
9595
9696 ## signature
9797
98-[index.js:73-75](https://github.com/dfinity/bls-lib/blob/2b6104bd4d6a111c264a5b60ec590f39c84b3da0/index.js#L73-L75 "Source code on GitHub")
98 +[index.js:73-75](https://github.com/dfinity/js-bls-lib/blob/3c007f5ed0e57b38cc7df4239d9631d617eef1cc/index.js#L73-L75 "Source code on GitHub")
9999
100-allocates a signature
100 +Allocates a signature
101101
102-Returns **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** the pointer to the signture
102 +Returns **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** the pointer to the signature
103103
104104 ## free
105105
106-[index.js:80-82](https://github.com/dfinity/bls-lib/blob/2b6104bd4d6a111c264a5b60ec590f39c84b3da0/index.js#L80-L82 "Source code on GitHub")
106 +[index.js:80-82](https://github.com/dfinity/js-bls-lib/blob/3c007f5ed0e57b38cc7df4239d9631d617eef1cc/index.js#L80-L82 "Source code on GitHub")
107107
108-frees a pointer
108 +Frees a pointer
109109
110110 **Parameters**
111111
112112 - `x`
113113
114114 ## freeArray
115115
116-[index.js:87-89](https://github.com/dfinity/bls-lib/blob/2b6104bd4d6a111c264a5b60ec590f39c84b3da0/index.js#L87-L89 "Source code on GitHub")
116 +[index.js:87-89](https://github.com/dfinity/js-bls-lib/blob/3c007f5ed0e57b38cc7df4239d9631d617eef1cc/index.js#L87-L89 "Source code on GitHub")
117117
118-frees an array of pointers
118 +Frees an array of pointers
119119
120120 **Parameters**
121121
122122 - `a`
123123
124124 ## idSetInt
125125
126-[index.js:96-101](https://github.com/dfinity/bls-lib/blob/2b6104bd4d6a111c264a5b60ec590f39c84b3da0/index.js#L96-L101 "Source code on GitHub")
126 +[index.js:96-101](https://github.com/dfinity/js-bls-lib/blob/3c007f5ed0e57b38cc7df4239d9631d617eef1cc/index.js#L96-L101 "Source code on GitHub")
127127
128-creates an ID from an int to use in with threshold groups
128 +Creates an ID from an int to use with threshold groups
129129
130130 **Parameters**
131131
132-- `sk` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** a pointer to the secret key, secret key stuct is used to hold the id
133-- `n` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** a int repsenting the ID. n cannot be zero.
132 +- `sk` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** a pointer to the secret key, secret key struct is used to hold the id
133 +- `n` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** a int representing the ID. n cannot be zero.
134134
135135 ## idImportFromInt
136136
137-[index.js:108-112](https://github.com/dfinity/bls-lib/blob/2b6104bd4d6a111c264a5b60ec590f39c84b3da0/index.js#L108-L112 "Source code on GitHub")
137 +[index.js:108-112](https://github.com/dfinity/js-bls-lib/blob/3c007f5ed0e57b38cc7df4239d9631d617eef1cc/index.js#L108-L112 "Source code on GitHub")
138138
139-creates an ID from an int and returns a pointer to it
139 +Creates an ID from an int and returns a pointer to it
140140
141141 **Parameters**
142142
143-- `n` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** a int repsenting the ID. n cannot be zero.
143 +- `n` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** a int representing the ID. n cannot be zero.
144144
145-Returns **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)**
145 +Returns **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)**
146146
147147 ## idImport
148148
149-[index.js:119-127](https://github.com/dfinity/bls-lib/blob/2b6104bd4d6a111c264a5b60ec590f39c84b3da0/index.js#L119-L127 "Source code on GitHub")
149 +[index.js:119-127](https://github.com/dfinity/js-bls-lib/blob/3c007f5ed0e57b38cc7df4239d9631d617eef1cc/index.js#L119-L127 "Source code on GitHub")
150150
151-creates an ID from an int and returns a pointer to it
151 +Creates an ID from an int and returns a pointer to it
152152
153153 **Parameters**
154154
155-- `n` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** a int repsenting the ID. n cannot be zero.
155 +- `n` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** a int representing the ID. n cannot be zero.
156156
157-Returns **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)**
157 +Returns **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)**
158158
159159 ## sign
160160
161-[index.js:135-135](https://github.com/dfinity/bls-lib/blob/2b6104bd4d6a111c264a5b60ec590f39c84b3da0/index.js#L135-L135 "Source code on GitHub")
161 +[index.js:135-135](https://github.com/dfinity/js-bls-lib/blob/3c007f5ed0e57b38cc7df4239d9631d617eef1cc/index.js#L135-L135 "Source code on GitHub")
162162
163-signs a message
163 +Signs a message
164164
165165 **Parameters**
166166
167-- `sig` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** a pointer to the a signature
168-- `sk` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** a pointer to the secret key
169-- `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
167 +- `sig` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** a pointer to the a signature
168 +- `sk` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** a pointer to the secret key
169 +- `msg` **([TypedArray](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray) \| [String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String))** the message to sign
170170
171171 ## verify
172172
173-[index.js:144-144](https://github.com/dfinity/bls-lib/blob/2b6104bd4d6a111c264a5b60ec590f39c84b3da0/index.js#L144-L144 "Source code on GitHub")
173 +[index.js:144-144](https://github.com/dfinity/js-bls-lib/blob/3c007f5ed0e57b38cc7df4239d9631d617eef1cc/index.js#L144-L144 "Source code on GitHub")
174174
175-verifies a signature
175 +Verifies a signature
176176
177177 **Parameters**
178178
179-- `sig` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** a pointer to the a signature
180-- `pk` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** a pointer to the secret key
181-- `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
179 +- `sig` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** a pointer to the a signature
180 +- `pk` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** a pointer to the secret key
181 +- `msg` **([TypedArray](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray) \| [String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String))** the message that was signed
182182
183-Returns **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)**
183 +Returns **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)**
184184
185185 ## publicKeyExport
186186
187-[index.js:151-151](https://github.com/dfinity/bls-lib/blob/2b6104bd4d6a111c264a5b60ec590f39c84b3da0/index.js#L151-L151 "Source code on GitHub")
187 +[index.js:151-151](https://github.com/dfinity/js-bls-lib/blob/3c007f5ed0e57b38cc7df4239d9631d617eef1cc/index.js#L151-L151 "Source code on GitHub")
188188
189-given a pointer to a public key this returns 64 byte Int8Array containing the key
189 +Given a pointer to a public key, this returns a 64 byte Int8Array containing the key
190190
191191 **Parameters**
192192
193-- `pk` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** a pointer to the secret key
193 +- `pk` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** a pointer to the secret key
194194
195-Returns **[TypedArray](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray)**
195 +Returns **[TypedArray](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray)**
196196
197197 ## secretKeyExport
198198
199-[index.js:158-158](https://github.com/dfinity/bls-lib/blob/2b6104bd4d6a111c264a5b60ec590f39c84b3da0/index.js#L158-L158 "Source code on GitHub")
199 +[index.js:158-158](https://github.com/dfinity/js-bls-lib/blob/3c007f5ed0e57b38cc7df4239d9631d617eef1cc/index.js#L158-L158 "Source code on GitHub")
200200
201-given a pointer to a secret key this returns 32 byte Int8Array containing the key
201 +Given a pointer to a secret key, this returns a 32 byte Int8Array containing the key
202202
203203 **Parameters**
204204
205-- `pk` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** a pointer to the secret key
205 +- `pk` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** a pointer to the secret key
206206
207-Returns **[TypedArray](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray)**
207 +Returns **[TypedArray](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray)**
208208
209209 ## signatureExport
210210
211-[index.js:165-165](https://github.com/dfinity/bls-lib/blob/2b6104bd4d6a111c264a5b60ec590f39c84b3da0/index.js#L165-L165 "Source code on GitHub")
211 +[index.js:165-165](https://github.com/dfinity/js-bls-lib/blob/3c007f5ed0e57b38cc7df4239d9631d617eef1cc/index.js#L165-L165 "Source code on GitHub")
212212
213-given a pointer to a signature this returns 32 byte Int8Array containing the signature
213 +Given a pointer to a signature, this returns a 32 byte Int8Array containing the signature
214214
215215 **Parameters**
216216
217-- `pk` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** a pointer to the secret key
217 +- `pk` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** a pointer to the secret key
218218
219-Returns **[TypedArray](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray)**
219 +Returns **[TypedArray](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray)**
220220
221221 ## hashToSecretKey
222222
223-[index.js:172-172](https://github.com/dfinity/bls-lib/blob/2b6104bd4d6a111c264a5b60ec590f39c84b3da0/index.js#L172-L172 "Source code on GitHub")
223 +[index.js:172-172](https://github.com/dfinity/js-bls-lib/blob/3c007f5ed0e57b38cc7df4239d9631d617eef1cc/index.js#L172-L172 "Source code on GitHub")
224224
225-generates a secret key given a seed phrase.
225 +Generates a secret key given a seed phrase
226226
227227 **Parameters**
228228
229-- `sk` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** a pointer to a secret key
230-- `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
229 +- `sk` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** a pointer to a secret key
230 +- `seed` **([String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) \| [TypedArray](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray))** the seed phrase
231231
232232 ## secretKeyDeserialize
233233
234-[index.js:179-179](https://github.com/dfinity/bls-lib/blob/2b6104bd4d6a111c264a5b60ec590f39c84b3da0/index.js#L179-L179 "Source code on GitHub")
234 +[index.js:179-179](https://github.com/dfinity/js-bls-lib/blob/3c007f5ed0e57b38cc7df4239d9631d617eef1cc/index.js#L179-L179 "Source code on GitHub")
235235
236-write a secretKey to memory
236 +Writes a secretKey to memory
237237
238238 **Parameters**
239239
240-- `sk` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** a pointer to a secret key
241-- `array` **[TypedArray](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray)** the secret key as a 32 byte TypedArray
240 +- `sk` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** a pointer to a secret key
241 +- `array` **[TypedArray](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray)** the secret key as a 32 byte TypedArray
242242
243243 ## secretKeyImport
244244
245-[index.js:187-191](https://github.com/dfinity/bls-lib/blob/2b6104bd4d6a111c264a5b60ec590f39c84b3da0/index.js#L187-L191 "Source code on GitHub")
245 +[index.js:187-191](https://github.com/dfinity/js-bls-lib/blob/3c007f5ed0e57b38cc7df4239d9631d617eef1cc/index.js#L187-L191 "Source code on GitHub")
246246
247-write a secretKey to memory and returns a pointer to it
247 +Writes a secretKey to memory and returns a pointer to it
248248
249249 **Parameters**
250250
251251 - `buf`
252-- `sk` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** a pointer to a secret key
253-- `array` **[TypedArray](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray)** the secret key as a 32 byte TypedArray
252 +- `sk` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** a pointer to a secret key
253 +- `array` **[TypedArray](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray)** the secret key as a 32 byte TypedArray
254254
255-Returns **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)**
255 +Returns **[Number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)**
256256
257257 ## publicKeyDeserialize
258258
259-[index.js:198-198](https://github.com/dfinity/bls-lib/blob/2b6104bd4d6a111c264a5b60ec590f39c84b3da0/index.js#L198-L198 "Source code on GitHub")
259 +[index.js:198-198](https://github.com/dfinity/js-bls-lib/blob/3c007f5ed0e57b38cc7df4239d9631d617eef1cc/index.js#L198-L198 "Source code on GitHub")
260260
261-write a publicKey to memory
261 +Writes a publicKey to memory
262262
263263 **Parameters**
264264
265-- `sk` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** a pointer to a public key
266-- `array` **[TypedArray](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray)** the secret key as a 64 byte TypedArray
265 +- `sk` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** a pointer to a public key
266 +- `array` **[TypedArray](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray)** the secret key as a 64 byte TypedArray
267267
268268 ## publicKeyImport
269269
270-[index.js:205-209](https://github.com/dfinity/bls-lib/blob/2b6104bd4d6a111c264a5b60ec590f39c84b3da0/index.js#L205-L209 "Source code on GitHub")
270 +[index.js:205-209](https://github.com/dfinity/js-bls-lib/blob/3c007f5ed0e57b38cc7df4239d9631d617eef1cc/index.js#L205-L209 "Source code on GitHub")
271271
272-write a publicKey to memory and returns a pointer to it
272 +Writes a publicKey to memory and returns a pointer to it
273273
274274 **Parameters**
275275
276276 - `buf`
277-- `array` **[TypedArray](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray)** the secret key as a 64 byte TypedArray
277 +- `array` **[TypedArray](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray)** the secret key as a 64 byte TypedArray
278278
279-Returns **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)**
279 +Returns **[Number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)**
280280
281281 ## signatureDeserialize
282282
283-[index.js:216-216](https://github.com/dfinity/bls-lib/blob/2b6104bd4d6a111c264a5b60ec590f39c84b3da0/index.js#L216-L216 "Source code on GitHub")
283 +[index.js:216-216](https://github.com/dfinity/js-bls-lib/blob/3c007f5ed0e57b38cc7df4239d9631d617eef1cc/index.js#L216-L216 "Source code on GitHub")
284284
285-write a signature to memory
285 +Writes a signature to memory
286286
287287 **Parameters**
288288
289-- `sig` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** a pointer to a signature
290-- `array` **[TypedArray](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray)** the signature as a 32 byte TypedArray
289 +- `sig` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** a pointer to a signature
290 +- `array` **[TypedArray](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray)** the signature as a 32 byte TypedArray
291291
292292 ## signatureImport
293293
294-[index.js:223-227](https://github.com/dfinity/bls-lib/blob/2b6104bd4d6a111c264a5b60ec590f39c84b3da0/index.js#L223-L227 "Source code on GitHub")
294 +[index.js:223-227](https://github.com/dfinity/js-bls-lib/blob/3c007f5ed0e57b38cc7df4239d9631d617eef1cc/index.js#L223-L227 "Source code on GitHub")
295295
296-write a signature to memory and returns a pointer to it
296 +Writes a signature to memory and returns a pointer to it
297297
298298 **Parameters**
299299
300300 - `buf`
301-- `array` **[TypedArray](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray)** the signature as a 32 byte TypedArray
301 +- `array` **[TypedArray](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray)** the signature as a 32 byte TypedArray
302302
303-Returns **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)**
303 +Returns **[Number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)**
304304
305305 ## secretKeySetByCSPRNG
306306
307-[index.js:233-233](https://github.com/dfinity/bls-lib/blob/2b6104bd4d6a111c264a5b60ec590f39c84b3da0/index.js#L233-L233 "Source code on GitHub")
307 +[index.js:233-233](https://github.com/dfinity/js-bls-lib/blob/3c007f5ed0e57b38cc7df4239d9631d617eef1cc/index.js#L233-L233 "Source code on GitHub")
308308
309-Initialize a secret key by a Cryptographically Secure Pseudo Random Number Generator
309 +Initializes a secret key by a Cryptographically Secure Pseudo Random Number Generator
310310
311311 **Parameters**
312312
313-- `array` **[TypedArray](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray)** the secret key as a TypedArray
313 +- `array` **[TypedArray](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray)** the secret key as a TypedArray
314314
315315 ## getPublicKey
316316
317-[index.js:240-240](https://github.com/dfinity/bls-lib/blob/2b6104bd4d6a111c264a5b60ec590f39c84b3da0/index.js#L240-L240 "Source code on GitHub")
317 +[index.js:240-240](https://github.com/dfinity/js-bls-lib/blob/3c007f5ed0e57b38cc7df4239d9631d617eef1cc/index.js#L240-L240 "Source code on GitHub")
318318
319-Create a public key from the secret key
319 +Creates a public key from the secret key
320320
321321 **Parameters**
322322
323-- `array` **[TypedArray](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray)** the public key as a TypedArray
324-- `array` **[TypedArray](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray)** the secret key as a TypedArray
323 +- `array` **[TypedArray](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray)** the public key as a TypedArray
324 +- `array` **[TypedArray](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray)** the secret key as a TypedArray
325325
326326 ## secretKeyRecover
327327
328-[index.js:248-248](https://github.com/dfinity/bls-lib/blob/2b6104bd4d6a111c264a5b60ec590f39c84b3da0/index.js#L248-L248 "Source code on GitHub")
328 +[index.js:248-248](https://github.com/dfinity/js-bls-lib/blob/3c007f5ed0e57b38cc7df4239d9631d617eef1cc/index.js#L248-L248 "Source code on GitHub")
329329
330330 Recovers a secret key for a group given the groups secret keys shares and the groups ids
331331
332332 **Parameters**
333333
334-- `sk` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** a pointer to a secret key that will be generated
335-- `sksArray` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)>** an array of pointers to the groups secret key shares. The length of the array should be the threshold number for the group
336-- `idArrah` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<numbers>** an array of pointers to ids in the groups. The length of the array should be the threshold number for the group
334 +- `sk` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** a pointer to a secret key that will be generated
335 +- `sksArray` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)>** an array of pointers to the groups secret key shares. The length of the array should be the threshold number for the group
336 +- `idArrah` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<numbers>** an array of pointers to ids in the groups. The length of the array should be the threshold number for the group
337337
338338 ## publicKeyRecover
339339
340-[index.js:256-256](https://github.com/dfinity/bls-lib/blob/2b6104bd4d6a111c264a5b60ec590f39c84b3da0/index.js#L256-L256 "Source code on GitHub")
340 +[index.js:256-256](https://github.com/dfinity/js-bls-lib/blob/3c007f5ed0e57b38cc7df4239d9631d617eef1cc/index.js#L256-L256 "Source code on GitHub")
341341
342342 Recovers a public key for a group given the groups public keys shares and the groups ids
343343
344344 **Parameters**
345345
346-- `pk` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** a pointer to a public key that will be generated
347-- `pksArray` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)>** an array of pointers to the groups public key shares. The length of the array should be the threshold number for the group
348-- `idArrah` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<numbers>** an array of pointers to ids in the groups. The length of the array should be the threshold number for the group
346 +- `pk` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** a pointer to a public key that will be generated
347 +- `pksArray` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)>** an array of pointers to the groups public key shares. The length of the array should be the threshold number for the group
348 +- `idArrah` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<numbers>** an array of pointers to ids in the groups. The length of the array should be the threshold number for the group
349349
350350 ## signatureRecover
351351
352-[index.js:264-264](https://github.com/dfinity/bls-lib/blob/2b6104bd4d6a111c264a5b60ec590f39c84b3da0/index.js#L264-L264 "Source code on GitHub")
352 +[index.js:264-264](https://github.com/dfinity/js-bls-lib/blob/3c007f5ed0e57b38cc7df4239d9631d617eef1cc/index.js#L264-L264 "Source code on GitHub")
353353
354354 Recovers a signature for a group given the groups public keys shares and the groups ids
355355
356356 **Parameters**
357357
358-- `sig` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** a pointer to the signature that will be generated
359-- `sigArray` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)>** an array of pointers to signature shares. The length of the array should be the threshold number for the group
360-- `idArrah` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<numbers>** an array of pointers to ids in the groups. The length of the array should be the threshold number for the group
358 +- `sig` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** a pointer to the signature that will be generated
359 +- `sigArray` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)>** an array of pointers to signature shares. The length of the array should be the threshold number for the group
360 +- `idArrah` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<numbers>** an array of pointers to ids in the groups. The length of the array should be the threshold number for the group
361361
362362 ## secretKeyShare
363363
364-[index.js:272-272](https://github.com/dfinity/bls-lib/blob/2b6104bd4d6a111c264a5b60ec590f39c84b3da0/index.js#L272-L272 "Source code on GitHub")
364 +[index.js:272-272](https://github.com/dfinity/js-bls-lib/blob/3c007f5ed0e57b38cc7df4239d9631d617eef1cc/index.js#L272-L272 "Source code on GitHub")
365365
366-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
366 +Creates a secret key share for a group member given the groups members id (which is the secret key) and array of master secret keys
367367
368368 **Parameters**
369369
370-- `skshare` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** a pointer to a secret key that will be generated
371-- `msk` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)>** an array of master secret keys. The number of keys is the threshould of the group.
372-- `id` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** the id of the member
370 +- `skshare` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** a pointer to a secret key that will be generated
371 +- `msk` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)>** an array of master secret keys. The number of keys is the threshold of the group.
372 +- `id` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** the id of the member
373373
374374 ## publicKeyShare
375375
376-[index.js:280-280](https://github.com/dfinity/bls-lib/blob/2b6104bd4d6a111c264a5b60ec590f39c84b3da0/index.js#L280-L280 "Source code on GitHub")
376 +[index.js:280-280](https://github.com/dfinity/js-bls-lib/blob/3c007f5ed0e57b38cc7df4239d9631d617eef1cc/index.js#L280-L280 "Source code on GitHub")
377377
378378 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
379379
380380 **Parameters**
381381
382-- `pkshare` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** a pointer to a secret key that will be generated
383-- `mpk` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)>** an array of master public keys. The number of keys is the threshould of the group.
384-- `id` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** the id of the member
382 +- `pkshare` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** a pointer to a secret key that will be generated
383 +- `mpk` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)>** an array of master public keys. The number of keys is the threshold of the group.
384 +- `id` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** the id of the member
385385
386386 ## publicKeyAdd
387387
388-[index.js:287-287](https://github.com/dfinity/bls-lib/blob/2b6104bd4d6a111c264a5b60ec590f39c84b3da0/index.js#L287-L287 "Source code on GitHub")
388 +[index.js:287-287](https://github.com/dfinity/js-bls-lib/blob/3c007f5ed0e57b38cc7df4239d9631d617eef1cc/index.js#L287-L287 "Source code on GitHub")
389389
390-Take two publicKeys and adds them together. pubkey1 = pubkey1 + pubkey2
390 +Takes two publicKeys and adds them together. pubkey1 = pubkey1 + pubkey2
391391
392392 **Parameters**
393393
394-- `pubkey1` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** a pointer to a public key
395-- `pubkey2` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** a pointer to a public key
394 +- `pubkey1` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** a pointer to a public key
395 +- `pubkey2` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** a pointer to a public key
396396
397397 ## secretKeyAdd
398398
399-[index.js:294-294](https://github.com/dfinity/bls-lib/blob/2b6104bd4d6a111c264a5b60ec590f39c84b3da0/index.js#L294-L294 "Source code on GitHub")
399 +[index.js:294-294](https://github.com/dfinity/js-bls-lib/blob/3c007f5ed0e57b38cc7df4239d9631d617eef1cc/index.js#L294-L294 "Source code on GitHub")
400400
401-Take two secretKeys and adds them together. seckey1 = seckey1 + seckey2
401 +Takes two secretKeys and adds them together. seckey1 = seckey1 + seckey2
402402
403403 **Parameters**
404404
405-- `seckey1` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** a pointer to a secret key
406-- `seckey2` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** a pointer to a secret key
405 +- `seckey1` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** a pointer to a secret key
406 +- `seckey2` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** a pointer to a secret key
407407
408408 ## publicKeyIsEqual
409409
410-[index.js:302-302](https://github.com/dfinity/bls-lib/blob/2b6104bd4d6a111c264a5b60ec590f39c84b3da0/index.js#L302-L302 "Source code on GitHub")
410 +[index.js:302-302](https://github.com/dfinity/js-bls-lib/blob/3c007f5ed0e57b38cc7df4239d9631d617eef1cc/index.js#L302-L302 "Source code on GitHub")
411411
412-Take two publicKeys and tests thier equality
412 +Takes two publicKeys and tests their equality
413413
414414 **Parameters**
415415
416-- `pubkey1` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** a pointer to a public key
417-- `pubkey2` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** a pointer to a public key
416 +- `pubkey1` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** a pointer to a public key
417 +- `pubkey2` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** a pointer to a public key
418418 return {Boolean}
419419
420420 ## dhKeyExchange
421421
422-[index.js:310-310](https://github.com/dfinity/bls-lib/blob/2b6104bd4d6a111c264a5b60ec590f39c84b3da0/index.js#L310-L310 "Source code on GitHub")
422 +[index.js:310-310](https://github.com/dfinity/js-bls-lib/blob/3c007f5ed0e57b38cc7df4239d9631d617eef1cc/index.js#L310-L310 "Source code on GitHub")
423423
424424 Does Diffie–Hellman key exchange
425425
426426 **Parameters**
427427
428-- `sharedSecretKey` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** a pointer to a secretKey that will be populated with the shared secret
429-- `secretKey` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** a pointer to a secret key
430-- `pubkey` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** a pointer to a public key
428 +- `sharedSecretKey` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** a pointer to a secretKey that will be populated with the shared secret
429 +- `secretKey` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** a pointer to a secret key
430 +- `pubkey` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** a pointer to a public key
index.jsView
@@ -7,10 +7,10 @@
77
88 exports.mod = mod
99
1010 /**
11- * takes a callback that is called once the module is setup
12- * @params {Function} cb - the callback tobe called once the module is intailized
11 + * Takes a callback that is called once the module is setup
12 + * @params {Function} cb - the callback to be called once the module is initialized
1313 */
1414 exports.onModuleInit = function (cb) {
1515 if (init) {
1616 cb()
@@ -20,19 +20,19 @@
2020 }
2121 }
2222
2323 /**
24- * the FP254BNB curve
24 + * The FP254BNB curve
2525 */
2626 exports.MCLBN_CURVE_FP254BNB = 0
2727
2828 /**
29- * the FP382_1 curve
29 + * The FP382_1 curve
3030 */
3131 exports.MCLBN_CURVE_FP382_1 = 1
3232
3333 /**
34- * the FP382_2 curve
34 + * The FP382_2 curve
3535 */
3636 exports.MCLBN_CURVE_FP382_2 = 2
3737
3838 const MCLBN_FP_UNIT_SIZE = 6
@@ -42,57 +42,57 @@
4242 const G2_SIZE = FR_SIZE * 3 * 2
4343
4444 mod.onRuntimeInitialized = function () {
4545 /**
46- * intailizes the libary to use a given curve
46 + * Initializes the library to use a given curve
4747 * @param {number} curve - the curves that can be used are MCLBN_CURVE_FP254BNB, MCLBN_CURVE_FP382_1 or MCLBN_CURVE_FP382_2
4848 */
4949 exports.init = function (curve = exports.MCLBN_CURVE_FP254BNB) {
5050 return mod._blsInit(curve, MCLBN_FP_UNIT_SIZE)
5151 }
5252
5353 /**
54- * allocates a secret key
54 + * Allocates a secret key
5555 * @returns {number} the pointer to the key
5656 */
5757 exports.secretKey = function () {
5858 return mod._malloc(FR_SIZE)
5959 }
6060
6161 /**
62- * allocates a secret key
62 + * Allocates a secret key
6363 * @returns {number} the pointer to the key
6464 */
6565 exports.publicKey = function () {
6666 return mod._malloc(G2_SIZE)
6767 }
6868
6969 /**
70- * allocates a signature
71- * @returns {number} the pointer to the signture
70 + * Allocates a signature
71 + * @returns {number} the pointer to the signature
7272 */
7373 exports.signature = function () {
7474 return mod._malloc(G1_SIZE)
7575 }
7676
7777 /**
78- * frees a pointer
78 + * Frees a pointer
7979 */
8080 exports.free = function (x) {
8181 mod._free(x)
8282 }
8383
8484 /**
85- * frees an array of pointers
85 + * Frees an array of pointers
8686 */
8787 exports.freeArray = function (a) {
8888 a.forEach(el => mod._free(el))
8989 }
9090
9191 /**
92- * creates an ID from an int to use in with threshold groups
93- * @param {number} sk - a pointer to the secret key, secret key stuct is used to hold the id
94- * @param {number} n - a int repsenting the ID. n cannot be zero.
92 + * Creates an ID from an int to use with threshold groups
93 + * @param {number} sk - a pointer to the secret key, secret key struct is used to hold the id
94 + * @param {number} n - a int representing the ID. n cannot be zero.
9595 */
9696 exports.idSetInt = function (sk, n) {
9797 if (n === 0) {
9898 throw new Error('id cannot be zero')
@@ -100,10 +100,10 @@
100100 mod._blsIdSetInt(sk, n)
101101 }
102102
103103 /**
104- * creates an ID from an int and returns a pointer to it
105- * @param {number} n - a int repsenting the ID. n cannot be zero.
104 + * Creates an ID from an int and returns a pointer to it
105 + * @param {number} n - a int representing the ID. n cannot be zero.
106106 * @return {number}
107107 */
108108 exports.idImportFromInt = function (n) {
109109 const sk = exports.secretKey()
@@ -111,10 +111,10 @@
111111 return sk
112112 }
113113
114114 /**
115- * creates an ID from an int and returns a pointer to it
116- * @param {number} n - a int repsenting the ID. n cannot be zero.
115 + * Creates an ID from an int and returns a pointer to it
116 + * @param {number} n - a int representing the ID. n cannot be zero.
117117 * @return {number}
118118 */
119119 exports.idImport = function (n) {
120120 if (Number.isInteger(n)) {
@@ -126,61 +126,61 @@
126126 }
127127 }
128128
129129 /**
130- * signs a message
130 + * Signs a message
131131 * @param {number} sig - a pointer to the a signature
132132 * @param {number} sk - a pointer to the secret key
133133 * @param {TypedArray|String} msg - the message to sign
134134 */
135135 exports.sign = wrapInput(mod._blsSign)
136136
137137 /**
138- * verifies a signature
138 + * Verifies a signature
139139 * @param {number} sig - a pointer to the a signature
140140 * @param {number} pk - a pointer to the secret key
141141 * @param {TypedArray|String} msg - the message that was signed
142142 * @returns {Boolean}
143143 */
144144 exports.verify = returnBool(wrapInput(mod._blsVerify))
145145
146146 /**
147- * given a pointer to a public key this returns 64 byte Int8Array containing the key
147 + * Given a pointer to a public key, this returns a 64 byte Int8Array containing the key
148148 * @param {number} pk - a pointer to the secret key
149149 * @return {TypedArray}
150150 */
151151 exports.publicKeyExport = wrapOutput(mod._blsPublicKeySerialize, 64)
152152
153153 /**
154- * given a pointer to a secret key this returns 32 byte Int8Array containing the key
154 + * Given a pointer to a secret key, this returns a 32 byte Int8Array containing the key
155155 * @param {number} pk - a pointer to the secret key
156156 * @return {TypedArray}
157157 */
158158 exports.secretKeyExport = wrapOutput(mod._blsSecretKeySerialize, 32)
159159
160160 /**
161- * given a pointer to a signature this returns 32 byte Int8Array containing the signature
161 + * Given a pointer to a signature, this returns a 32 byte Int8Array containing the signature
162162 * @param {number} pk - a pointer to the secret key
163163 * @return {TypedArray}
164164 */
165165 exports.signatureExport = wrapOutput(mod._blsSignatureSerialize, 32)
166166
167167 /**
168- * generates a secret key given a seed phrase.
168 + * Generates a secret key given a seed phrase
169169 * @param {number} sk - a pointer to a secret key
170170 * @param {String|TypedArray} seed - the seed phrase
171171 */
172172 exports.hashToSecretKey = wrapInput(mod._blsHashToSecretKey)
173173
174174 /**
175- * write a secretKey to memory
175 + * Writes a secretKey to memory
176176 * @param {number} sk - a pointer to a secret key
177177 * @param {TypedArray} array - the secret key as a 32 byte TypedArray
178178 */
179179 exports.secretKeyDeserialize = wrapDeserialize(mod._blsSecretKeyDeserialize)
180180
181181 /**
182- * write a secretKey to memory and returns a pointer to it
182 + * Writes a secretKey to memory and returns a pointer to it
183183 * @param {number} sk - a pointer to a secret key
184184 * @param {TypedArray} array - the secret key as a 32 byte TypedArray
185185 * @return {Number}
186186 */
@@ -190,16 +190,16 @@
190190 return sk
191191 }
192192
193193 /**
194- * write a publicKey to memory
194 + * Writes a publicKey to memory
195195 * @param {number} sk - a pointer to a public key
196196 * @param {TypedArray} array - the secret key as a 64 byte TypedArray
197197 */
198198 exports.publicKeyDeserialize = wrapDeserialize(mod._blsPublicKeyDeserialize)
199199
200200 /**
201- * write a publicKey to memory and returns a pointer to it
201 + * Writes a publicKey to memory and returns a pointer to it
202202 * @param {TypedArray} array - the secret key as a 64 byte TypedArray
203203 * @return {Number}
204204 */
205205 exports.publicKeyImport = function (buf) {
@@ -208,16 +208,16 @@
208208 return pk
209209 }
210210
211211 /**
212- * write a signature to memory
212 + * Writes a signature to memory
213213 * @param {number} sig - a pointer to a signature
214214 * @param {TypedArray} array - the signature as a 32 byte TypedArray
215215 */
216216 exports.signatureDeserialize = wrapDeserialize(mod._blsSignatureDeserialize)
217217
218218 /**
219- * write a signature to memory and returns a pointer to it
219 + * Writes a signature to memory and returns a pointer to it
220220 * @param {TypedArray} array - the signature as a 32 byte TypedArray
221221 * @return {Number}
222222 */
223223 exports.signatureImport = function (buf) {
@@ -226,15 +226,15 @@
226226 return sig
227227 }
228228
229229 /**
230- * Initialize a secret key by a Cryptographically Secure Pseudo Random Number Generator
230 + * Initializes a secret key by a Cryptographically Secure Pseudo Random Number Generator
231231 * @param {TypedArray} array - the secret key as a TypedArray
232232 */
233233 exports.secretKeySetByCSPRNG = mod._blsSecretKeySetByCSPRNG
234234
235235 /**
236- * Create a public key from the secret key
236 + * Creates a public key from the secret key
237237 * @param {TypedArray} array - the public key as a TypedArray
238238 * @param {TypedArray} array - the secret key as a TypedArray
239239 */
240240 exports.getPublicKey = mod._blsGetPublicKey
@@ -263,39 +263,39 @@
263263 */
264264 exports.signatureRecover = wrapRecover(mod._blsSignatureRecover, G1_SIZE, ID_SIZE)
265265
266266 /**
267- * 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
267 + * Creates a secret key share for a group member given the groups members id (which is the secret key) and array of master secret keys
268268 * @param {number} skshare - a pointer to a secret key that will be generated
269- * @param {Array<number>} msk - an array of master secret keys. The number of keys is the threshould of the group.
269 + * @param {Array<number>} msk - an array of master secret keys. The number of keys is the threshold of the group.
270270 * @param {number} id - the id of the member
271271 */
272272 exports.secretKeyShare = wrapKeyShare(mod._blsSecretKeyShare, FR_SIZE)
273273
274274 /**
275275 * 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
276276 * @param {number} pkshare - a pointer to a secret key that will be generated
277- * @param {Array<number>} mpk - an array of master public keys. The number of keys is the threshould of the group.
277 + * @param {Array<number>} mpk - an array of master public keys. The number of keys is the threshold of the group.
278278 * @param {number} id - the id of the member
279279 */
280280 exports.publicKeyShare = wrapKeyShare(mod._blsPublicKeyShare, G2_SIZE)
281281
282282 /**
283- * Take two publicKeys and adds them together. pubkey1 = pubkey1 + pubkey2
283 + * Takes two publicKeys and adds them together. pubkey1 = pubkey1 + pubkey2
284284 * @param {number} pubkey1 - a pointer to a public key
285285 * @param {number} pubkey2 - a pointer to a public key
286286 */
287287 exports.publicKeyAdd = mod._blsPublicKeyAdd
288288
289289 /**
290- * Take two secretKeys and adds them together. seckey1 = seckey1 + seckey2
290 + * Takes two secretKeys and adds them together. seckey1 = seckey1 + seckey2
291291 * @param {number} seckey1 - a pointer to a secret key
292292 * @param {number} seckey2 - a pointer to a secret key
293293 */
294294 exports.secretKeyAdd = mod._blsSecretKeyAdd
295295
296296 /**
297- * Take two publicKeys and tests thier equality
297 + * Takes two publicKeys and tests their equality
298298 * @param {number} pubkey1 - a pointer to a public key
299299 * @param {number} pubkey2 - a pointer to a public key
300300 * return {Boolean}
301301 */
package.jsonView
@@ -1,8 +1,8 @@
11 {
22 "name": "bls-lib",
33 "version": "0.3.1",
4- "description": "this libary provides primitives for creating and verify BLS threshold signatures",
4 + "description": "this library provides primitives for creating and verifying BLS threshold signatures",
55 "main": "index.js",
66 "scripts": {
77 "coveralls": "npm run coverage && nyc report --reporter=text-lcov | coveralls",
88 "coverage": "nyc npm test",

Built with git-ssb-web