threshold-elgamal 0.1.4 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,16 +1,32 @@
1
1
  # Threshold ElGamal
2
2
 
3
- This project is a collection of functions implementing the ElGamal encryption algorithm in TypeScript. Its core includes ElGamal functions for key generation, encryption, and decryption. It is extended with support for threshold encryption.
3
+ This project is a collection of functions implementing the ElGamal encryption algorithm in TypeScript on top of native JavaScript BigInteger. Its core includes ElGamal functions for key generation, encryption, and decryption. It is extended with support for threshold encryption.
4
4
 
5
5
  **WIP: Early version. Thresholds when set below the number of scheme participants don't behave as expected.**
6
6
  However, it works correctly with `threshold == participantsCount`, which is its main use case for myself for now.
7
7
 
8
8
  It was written as clearly as possible, modularized, and with long, explicit variable names. It includes out-of-the-box VS Code configuration, including recommended extensions for working with the library and/or contributing.
9
9
 
10
+ **This is not a cryptographically audited library, make sure you know what you are doing before using it.**
11
+
10
12
  ## Contributing
11
13
 
12
14
  The JavaScript/TypeScript ecosystem seems to be lacking in modern, functional ElGamal libraries that work out of the box with reasonable default (this library isn't at that point yet). All PRs are welcome.
13
15
 
16
+ ## Libraries/tools used
17
+
18
+ - TypeScript
19
+ - Vitest
20
+ - ESLint + Prettier
21
+ - Typedoc
22
+
23
+ ## Production dependencies
24
+
25
+ - [bigint-mod-arith](https://www.npmjs.com/package/bigint-mod-arith)
26
+ - [random-bigint](https://www.npmjs.com/package/random-bigint)
27
+
28
+ It has no other production dependencies apart from these two. They could be inlined easily, if needed.
29
+
14
30
  ## TODO
15
31
 
16
32
  - Hashing messages
package/docs/README.md CHANGED
@@ -9,6 +9,8 @@ However, it works correctly with `threshold == participantsCount`, which is its
9
9
 
10
10
  It was written as clearly as possible, modularized, and with long, explicit variable names. It includes out-of-the-box VS Code configuration, including recommended extensions for working with the library and/or contributing.
11
11
 
12
+ **This is not a cryptographically audited library, make sure you know what you are doing before using it.**
13
+
12
14
  ## Contributing
13
15
 
14
16
  The JavaScript/TypeScript ecosystem seems to be lacking in modern, functional ElGamal libraries that work out of the box with reasonable default (this library isn't at that point yet). All PRs are welcome.
@@ -19,12 +21,6 @@ The JavaScript/TypeScript ecosystem seems to be lacking in modern, functional El
19
21
  - Support for additive property of exponents, not just native ElGamal multiplication
20
22
  - consider using {} function params for better readability and consistency in param naming
21
23
 
22
- ## Setup
23
-
24
- Ensure you have Node.js installed on your system and then install the required dependencies by running:
25
-
26
- `npm install`
27
-
28
24
  ## Installation
29
25
 
30
26
  To use it in your project, install it first:
package/docs/modules.md CHANGED
@@ -40,7 +40,7 @@
40
40
 
41
41
  #### Defined in
42
42
 
43
- [types.ts:1](https://github.com/Tenemo/threshold-elgamal/blob/fc2a22a1ff8f83d6af5a428644410ebc8517f4e1/src/types.ts#L1)
43
+ [types.ts:1](https://github.com/Tenemo/threshold-elgamal/blob/f6ba8047991dc1d17f4657347da25ca86acd3283/src/types.ts#L1)
44
44
 
45
45
  ___
46
46
 
@@ -57,7 +57,7 @@ ___
57
57
 
58
58
  #### Defined in
59
59
 
60
- [types.ts:13](https://github.com/Tenemo/threshold-elgamal/blob/fc2a22a1ff8f83d6af5a428644410ebc8517f4e1/src/types.ts#L13)
60
+ [types.ts:13](https://github.com/Tenemo/threshold-elgamal/blob/f6ba8047991dc1d17f4657347da25ca86acd3283/src/types.ts#L13)
61
61
 
62
62
  ___
63
63
 
@@ -76,7 +76,7 @@ ___
76
76
 
77
77
  #### Defined in
78
78
 
79
- [types.ts:6](https://github.com/Tenemo/threshold-elgamal/blob/fc2a22a1ff8f83d6af5a428644410ebc8517f4e1/src/types.ts#L6)
79
+ [types.ts:6](https://github.com/Tenemo/threshold-elgamal/blob/f6ba8047991dc1d17f4657347da25ca86acd3283/src/types.ts#L6)
80
80
 
81
81
  ___
82
82
 
@@ -93,7 +93,7 @@ ___
93
93
 
94
94
  #### Defined in
95
95
 
96
- [types.ts:18](https://github.com/Tenemo/threshold-elgamal/blob/fc2a22a1ff8f83d6af5a428644410ebc8517f4e1/src/types.ts#L18)
96
+ [types.ts:18](https://github.com/Tenemo/threshold-elgamal/blob/f6ba8047991dc1d17f4657347da25ca86acd3283/src/types.ts#L18)
97
97
 
98
98
  ## Functions
99
99
 
@@ -118,7 +118,7 @@ The combined decryption factor.
118
118
 
119
119
  #### Defined in
120
120
 
121
- [thresholdElgamal.ts:129](https://github.com/Tenemo/threshold-elgamal/blob/fc2a22a1ff8f83d6af5a428644410ebc8517f4e1/src/thresholdElgamal.ts#L129)
121
+ [thresholdElgamal.ts:129](https://github.com/Tenemo/threshold-elgamal/blob/f6ba8047991dc1d17f4657347da25ca86acd3283/src/thresholdElgamal.ts#L129)
122
122
 
123
123
  ___
124
124
 
@@ -143,7 +143,7 @@ The combined public key.
143
143
 
144
144
  #### Defined in
145
145
 
146
- [thresholdElgamal.ts:103](https://github.com/Tenemo/threshold-elgamal/blob/fc2a22a1ff8f83d6af5a428644410ebc8517f4e1/src/thresholdElgamal.ts#L103)
146
+ [thresholdElgamal.ts:103](https://github.com/Tenemo/threshold-elgamal/blob/f6ba8047991dc1d17f4657347da25ca86acd3283/src/thresholdElgamal.ts#L103)
147
147
 
148
148
  ___
149
149
 
@@ -169,7 +169,7 @@ The result of the partial decryption.
169
169
 
170
170
  #### Defined in
171
171
 
172
- [thresholdElgamal.ts:116](https://github.com/Tenemo/threshold-elgamal/blob/fc2a22a1ff8f83d6af5a428644410ebc8517f4e1/src/thresholdElgamal.ts#L116)
172
+ [thresholdElgamal.ts:116](https://github.com/Tenemo/threshold-elgamal/blob/f6ba8047991dc1d17f4657347da25ca86acd3283/src/thresholdElgamal.ts#L116)
173
173
 
174
174
  ___
175
175
 
@@ -195,7 +195,7 @@ The decrypted secret as an integer.
195
195
 
196
196
  #### Defined in
197
197
 
198
- [elgamal.ts:77](https://github.com/Tenemo/threshold-elgamal/blob/fc2a22a1ff8f83d6af5a428644410ebc8517f4e1/src/elgamal.ts#L77)
198
+ [elgamal.ts:77](https://github.com/Tenemo/threshold-elgamal/blob/f6ba8047991dc1d17f4657347da25ca86acd3283/src/elgamal.ts#L77)
199
199
 
200
200
  ___
201
201
 
@@ -222,7 +222,7 @@ The encrypted secret, consisting of two BigIntegers (c1 and c2).
222
222
 
223
223
  #### Defined in
224
224
 
225
- [elgamal.ts:51](https://github.com/Tenemo/threshold-elgamal/blob/fc2a22a1ff8f83d6af5a428644410ebc8517f4e1/src/elgamal.ts#L51)
225
+ [elgamal.ts:51](https://github.com/Tenemo/threshold-elgamal/blob/f6ba8047991dc1d17f4657347da25ca86acd3283/src/elgamal.ts#L51)
226
226
 
227
227
  ___
228
228
 
@@ -248,7 +248,7 @@ An array of key shares, each containing a private and public key share.
248
248
 
249
249
  #### Defined in
250
250
 
251
- [thresholdElgamal.ts:83](https://github.com/Tenemo/threshold-elgamal/blob/fc2a22a1ff8f83d6af5a428644410ebc8517f4e1/src/thresholdElgamal.ts#L83)
251
+ [thresholdElgamal.ts:83](https://github.com/Tenemo/threshold-elgamal/blob/f6ba8047991dc1d17f4657347da25ca86acd3283/src/thresholdElgamal.ts#L83)
252
252
 
253
253
  ___
254
254
 
@@ -273,7 +273,7 @@ The generated parameters including the prime, generator, publicKey, and privateK
273
273
 
274
274
  #### Defined in
275
275
 
276
- [elgamal.ts:14](https://github.com/Tenemo/threshold-elgamal/blob/fc2a22a1ff8f83d6af5a428644410ebc8517f4e1/src/elgamal.ts#L14)
276
+ [elgamal.ts:14](https://github.com/Tenemo/threshold-elgamal/blob/f6ba8047991dc1d17f4657347da25ca86acd3283/src/elgamal.ts#L14)
277
277
 
278
278
  ___
279
279
 
@@ -299,7 +299,7 @@ The key share containing a private and public key share for the participant.
299
299
 
300
300
  #### Defined in
301
301
 
302
- [thresholdElgamal.ts:56](https://github.com/Tenemo/threshold-elgamal/blob/fc2a22a1ff8f83d6af5a428644410ebc8517f4e1/src/thresholdElgamal.ts#L56)
302
+ [thresholdElgamal.ts:56](https://github.com/Tenemo/threshold-elgamal/blob/f6ba8047991dc1d17f4657347da25ca86acd3283/src/thresholdElgamal.ts#L56)
303
303
 
304
304
  ___
305
305
 
@@ -324,7 +324,7 @@ A random bigint within the specified range.
324
324
 
325
325
  #### Defined in
326
326
 
327
- [utils.ts:11](https://github.com/Tenemo/threshold-elgamal/blob/fc2a22a1ff8f83d6af5a428644410ebc8517f4e1/src/utils.ts#L11)
327
+ [utils.ts:11](https://github.com/Tenemo/threshold-elgamal/blob/f6ba8047991dc1d17f4657347da25ca86acd3283/src/utils.ts#L11)
328
328
 
329
329
  ___
330
330
 
@@ -350,7 +350,7 @@ The result of the multiplication, as a new encrypted message.
350
350
 
351
351
  #### Defined in
352
352
 
353
- [utils.ts:33](https://github.com/Tenemo/threshold-elgamal/blob/fc2a22a1ff8f83d6af5a428644410ebc8517f4e1/src/utils.ts#L33)
353
+ [utils.ts:33](https://github.com/Tenemo/threshold-elgamal/blob/f6ba8047991dc1d17f4657347da25ca86acd3283/src/utils.ts#L33)
354
354
 
355
355
  ___
356
356
 
@@ -378,4 +378,4 @@ The decrypted secret, assuming it was small enough to be directly encrypted.
378
378
 
379
379
  #### Defined in
380
380
 
381
- [thresholdElgamal.ts:148](https://github.com/Tenemo/threshold-elgamal/blob/fc2a22a1ff8f83d6af5a428644410ebc8517f4e1/src/thresholdElgamal.ts#L148)
381
+ [thresholdElgamal.ts:148](https://github.com/Tenemo/threshold-elgamal/blob/f6ba8047991dc1d17f4657347da25ca86acd3283/src/thresholdElgamal.ts#L148)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "threshold-elgamal",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "author": "Piotr Piech <piotr@piech.dev>",
5
5
  "license": "MIT",
6
6
  "description": "threshold-elgamal",