@digitaldefiance/node-ecies-lib 4.17.2 → 4.17.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digitaldefiance/node-ecies-lib",
3
- "version": "4.17.2",
3
+ "version": "4.17.5",
4
4
  "description": "Digital Defiance Node ECIES Library",
5
5
  "homepage": "https://github.com/Digital-Defiance/node-ecies-lib",
6
6
  "repository": {
@@ -59,9 +59,9 @@
59
59
  "license": "MIT",
60
60
  "packageManager": "yarn@4.10.3",
61
61
  "dependencies": {
62
- "@digitaldefiance/ecies-lib": "4.17.2",
62
+ "@digitaldefiance/ecies-lib": "4.17.4",
63
63
  "@digitaldefiance/express-suite-test-utils": "1.1.0",
64
- "@digitaldefiance/i18n-lib": "4.3.2",
64
+ "@digitaldefiance/i18n-lib": "4.4.0",
65
65
  "@ethereumjs/wallet": "^2.0.4",
66
66
  "@noble/curves": "^1.4.2",
67
67
  "@noble/hashes": "^1.4.0",
@@ -2,28 +2,34 @@
2
2
  * Node.js ECIES i18n setup and configuration.
3
3
  *
4
4
  * This is the single source of truth for i18n in node-ecies-lib.
5
- * Uses I18nBuilder pattern for proper engine initialization and registers:
6
- * - Core component (for error messages)
7
- * - ECIES component (imported from ecies-lib - translations defined there)
5
+ * Uses createI18nSetup factory for proper engine initialization and registers:
6
+ * - Core component (automatic via factory)
7
+ * - ECIES component (imported from ecies-lib via createEciesComponentPackage)
8
8
  * - Node ECIES component (translations defined here)
9
9
  *
10
10
  * All components support translateStringKey for direct branded enum translation.
11
11
  */
12
12
  import { EciesComponentId } from '@digitaldefiance/ecies-lib';
13
- import { ComponentConfig, I18nEngine, type BrandedMasterStringsCollection, type CoreLanguageCode } from '@digitaldefiance/i18n-lib';
13
+ import { ComponentConfig, I18nEngine, type BrandedMasterStringsCollection, type CoreLanguageCode, type I18nComponentPackage } from '@digitaldefiance/i18n-lib';
14
14
  import { NodeEciesComponentId, NodeEciesStringKey } from './node-keys';
15
15
  import type { NodeEciesStringKeyValue } from './node-keys';
16
16
  export { NodeEciesComponentId, EciesComponentId };
17
17
  /**
18
18
  * Master strings collection for the Node ECIES component.
19
19
  * These are the translations specific to node-ecies-lib.
20
- * ECIES translations come from ecies-lib via createEciesComponentConfig().
20
+ * ECIES translations come from ecies-lib via createEciesComponentPackage().
21
21
  */
22
22
  export declare const NodeEciesComponentStrings: BrandedMasterStringsCollection<typeof NodeEciesStringKey, CoreLanguageCode>;
23
23
  /**
24
24
  * Create Node ECIES component configuration
25
25
  */
26
26
  export declare function createNodeEciesComponentConfig(): ComponentConfig;
27
+ /**
28
+ * Creates an I18nComponentPackage bundling the Node ECIES ComponentConfig
29
+ * with its branded string key enum. Use this with createI18nSetup's
30
+ * libraryComponents array.
31
+ */
32
+ export declare function createNodeEciesComponentPackage(): I18nComponentPackage;
27
33
  /**
28
34
  * Get or create the Node ECIES i18n engine.
29
35
  *
@@ -1 +1 @@
1
- {"version":3,"file":"node-ecies-i18n-setup.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-node-ecies-lib/src/i18n/node-ecies-i18n-setup.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAEL,gBAAgB,EAEjB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,eAAe,EAIf,UAAU,EAEV,KAAK,8BAA8B,EACnC,KAAK,gBAAgB,EACtB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACvE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAY3D,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,CAAC;AAElD;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,EAAE,8BAA8B,CACpE,OAAO,kBAAkB,EACzB,gBAAgB,CAUjB,CAAC;AAEF;;GAEG;AACH,wBAAgB,8BAA8B,IAAI,eAAe,CAMhE;AAoDD;;;;;GAKG;AACH,wBAAgB,sBAAsB,IAAI,UAAU,CAkCnD;AAED;;GAEG;AACH,wBAAgB,wBAAwB,IAAI,IAAI,CAG/C;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CACrC,SAAS,EAAE,uBAAuB,EAClC,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,EAC3C,QAAQ,CAAC,EAAE,MAAM,GAChB,MAAM,CAMR;AAED;;GAEG;AACH,wBAAgB,2BAA2B,CACzC,SAAS,EAAE,uBAAuB,EAClC,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,EAC3C,QAAQ,CAAC,EAAE,MAAM,GAChB,MAAM,CAMR"}
1
+ {"version":3,"file":"node-ecies-i18n-setup.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-node-ecies-lib/src/i18n/node-ecies-i18n-setup.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAEL,gBAAgB,EACjB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,eAAe,EAEf,UAAU,EAEV,KAAK,8BAA8B,EACnC,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EAC1B,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACvE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAY3D,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,CAAC;AAElD;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,EAAE,8BAA8B,CACpE,OAAO,kBAAkB,EACzB,gBAAgB,CAUjB,CAAC;AAEF;;GAEG;AACH,wBAAgB,8BAA8B,IAAI,eAAe,CAMhE;AAED;;;;GAIG;AACH,wBAAgB,+BAA+B,IAAI,oBAAoB,CAKtE;AAID;;;;;GAKG;AACH,wBAAgB,sBAAsB,IAAI,UAAU,CAenD;AAED;;GAEG;AACH,wBAAgB,wBAAwB,IAAI,IAAI,CAE/C;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CACrC,SAAS,EAAE,uBAAuB,EAClC,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,EAC3C,QAAQ,CAAC,EAAE,MAAM,GAChB,MAAM,CAMR;AAED;;GAEG;AACH,wBAAgB,2BAA2B,CACzC,SAAS,EAAE,uBAAuB,EAClC,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,EAC3C,QAAQ,CAAC,EAAE,MAAM,GAChB,MAAM,CAMR"}
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.NodeEciesComponentStrings = exports.EciesComponentId = exports.NodeEciesComponentId = void 0;
4
4
  exports.createNodeEciesComponentConfig = createNodeEciesComponentConfig;
5
+ exports.createNodeEciesComponentPackage = createNodeEciesComponentPackage;
5
6
  exports.getNodeEciesI18nEngine = getNodeEciesI18nEngine;
6
7
  exports.resetNodeEciesI18nEngine = resetNodeEciesI18nEngine;
7
8
  exports.getNodeEciesTranslation = getNodeEciesTranslation;
@@ -10,9 +11,9 @@ exports.safeGetNodeEciesTranslation = safeGetNodeEciesTranslation;
10
11
  * Node.js ECIES i18n setup and configuration.
11
12
  *
12
13
  * This is the single source of truth for i18n in node-ecies-lib.
13
- * Uses I18nBuilder pattern for proper engine initialization and registers:
14
- * - Core component (for error messages)
15
- * - ECIES component (imported from ecies-lib - translations defined there)
14
+ * Uses createI18nSetup factory for proper engine initialization and registers:
15
+ * - Core component (automatic via factory)
16
+ * - ECIES component (imported from ecies-lib via createEciesComponentPackage)
16
17
  * - Node ECIES component (translations defined here)
17
18
  *
18
19
  * All components support translateStringKey for direct branded enum translation.
@@ -26,7 +27,7 @@ const translations_1 = require("./translations");
26
27
  /**
27
28
  * Master strings collection for the Node ECIES component.
28
29
  * These are the translations specific to node-ecies-lib.
29
- * ECIES translations come from ecies-lib via createEciesComponentConfig().
30
+ * ECIES translations come from ecies-lib via createEciesComponentPackage().
30
31
  */
31
32
  exports.NodeEciesComponentStrings = {
32
33
  [i18n_lib_1.LanguageCodes.EN_US]: translations_1.englishTranslations,
@@ -48,51 +49,18 @@ function createNodeEciesComponentConfig() {
48
49
  aliases: ['NodeEciesStringKey'],
49
50
  };
50
51
  }
51
- let _nodeEciesI18nEngine = null;
52
- let _componentRegistered = false;
53
52
  /**
54
- * Register the engine with all required components using I18nBuilder
53
+ * Creates an I18nComponentPackage bundling the Node ECIES ComponentConfig
54
+ * with its branded string key enum. Use this with createI18nSetup's
55
+ * libraryComponents array.
55
56
  */
56
- function registerEngine() {
57
- const newEngine = i18n_lib_1.I18nBuilder.create()
58
- .withLanguages((0, i18n_lib_1.getCoreLanguageDefinitions)())
59
- .withDefaultLanguage(i18n_lib_1.LanguageCodes.EN_US)
60
- .withInstanceKey('default')
61
- .build();
62
- // Register Core i18n component (required for error messages)
63
- const coreReg = (0, i18n_lib_1.createCoreComponentRegistration)();
64
- newEngine.register({
65
- id: coreReg.component.id,
66
- strings: coreReg.strings,
67
- });
68
- // Register ECIES component from ecies-lib (translations are defined there)
69
- const eciesConfig = (0, ecies_lib_1.createEciesComponentConfig)();
70
- newEngine.register({
71
- ...eciesConfig,
72
- aliases: ['EciesStringKey'],
73
- });
74
- // Register Node ECIES component (translations defined in this lib)
75
- newEngine.register(createNodeEciesComponentConfig());
76
- // Register branded string key enums for translateStringKey support
77
- // Done after build to avoid issues with jest.resetModules() in tests
78
- try {
79
- if (!newEngine.hasStringKeyEnum(ecies_lib_1.EciesStringKey)) {
80
- newEngine.registerStringKeyEnum(ecies_lib_1.EciesStringKey);
81
- }
82
- }
83
- catch {
84
- // Silently ignore if enum registration fails (e.g., in test environments)
85
- }
86
- try {
87
- if (!newEngine.hasStringKeyEnum(node_keys_1.NodeEciesStringKey)) {
88
- newEngine.registerStringKeyEnum(node_keys_1.NodeEciesStringKey);
89
- }
90
- }
91
- catch {
92
- // Silently ignore if enum registration fails (e.g., in test environments)
93
- }
94
- return newEngine;
57
+ function createNodeEciesComponentPackage() {
58
+ return {
59
+ config: createNodeEciesComponentConfig(),
60
+ stringKeyEnum: node_keys_1.NodeEciesStringKey,
61
+ };
95
62
  }
63
+ let _nodeEciesI18nEngine = null;
96
64
  /**
97
65
  * Get or create the Node ECIES i18n engine.
98
66
  *
@@ -100,32 +68,17 @@ function registerEngine() {
100
68
  * allowing translateStringKey to work with both EciesStringKey and NodeEciesStringKey.
101
69
  */
102
70
  function getNodeEciesI18nEngine() {
103
- if (i18n_lib_1.I18nEngine.hasInstance('default')) {
104
- _nodeEciesI18nEngine = i18n_lib_1.I18nEngine.getInstance('default');
105
- // Ensure our components are registered on existing instance
106
- if (!_componentRegistered) {
107
- // Register ECIES component if not present (translations from ecies-lib)
108
- const eciesConfig = (0, ecies_lib_1.createEciesComponentConfig)();
109
- _nodeEciesI18nEngine.registerIfNotExists({
110
- ...eciesConfig,
111
- aliases: ['EciesStringKey'],
112
- });
113
- // Register Node ECIES component if not present
114
- _nodeEciesI18nEngine.registerIfNotExists(createNodeEciesComponentConfig());
115
- // Register branded string key enums for translateStringKey support
116
- if (!_nodeEciesI18nEngine.hasStringKeyEnum(ecies_lib_1.EciesStringKey)) {
117
- _nodeEciesI18nEngine.registerStringKeyEnum(ecies_lib_1.EciesStringKey);
118
- }
119
- if (!_nodeEciesI18nEngine.hasStringKeyEnum(node_keys_1.NodeEciesStringKey)) {
120
- _nodeEciesI18nEngine.registerStringKeyEnum(node_keys_1.NodeEciesStringKey);
121
- }
122
- _componentRegistered = true;
123
- }
124
- }
125
- else {
126
- _nodeEciesI18nEngine = registerEngine();
127
- _componentRegistered = true;
71
+ if (_nodeEciesI18nEngine && i18n_lib_1.I18nEngine.hasInstance('default')) {
72
+ return _nodeEciesI18nEngine;
128
73
  }
74
+ const result = (0, i18n_lib_1.createI18nSetup)({
75
+ componentId: node_keys_1.NodeEciesComponentId,
76
+ stringKeyEnum: node_keys_1.NodeEciesStringKey,
77
+ strings: exports.NodeEciesComponentStrings,
78
+ aliases: ['NodeEciesStringKey'],
79
+ libraryComponents: [(0, ecies_lib_1.createEciesComponentPackage)()],
80
+ });
81
+ _nodeEciesI18nEngine = result.engine;
129
82
  return _nodeEciesI18nEngine;
130
83
  }
131
84
  /**
@@ -133,7 +86,6 @@ function getNodeEciesI18nEngine() {
133
86
  */
134
87
  function resetNodeEciesI18nEngine() {
135
88
  _nodeEciesI18nEngine = null;
136
- _componentRegistered = false;
137
89
  }
138
90
  /**
139
91
  * Helper to translate Node ECIES strings.
@@ -1 +1 @@
1
- {"version":3,"file":"node-ecies-i18n-setup.js","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-node-ecies-lib/src/i18n/node-ecies-i18n-setup.ts"],"names":[],"mappings":";;;AAgEA,wEAMC;AA0DD,wDAkCC;AAKD,4DAGC;AAMD,0DAUC;AAKD,kEAUC;AAzMD;;;;;;;;;;GAUG;AACH,0DAIoC;AAyBL,iGA3B7B,4BAAgB,OA2B6B;AAxB/C,wDASmC;AAEnC,2CAAuE;AAa9D,qGAbA,gCAAoB,OAaA;AAX7B,iDASwB;AAIxB;;;;GAIG;AACU,QAAA,yBAAyB,GAGlC;IACF,CAAC,wBAAa,CAAC,KAAK,CAAC,EAAE,kCAAmB;IAC1C,CAAC,wBAAa,CAAC,KAAK,CAAC,EAAE,yCAA0B;IACjD,CAAC,wBAAa,CAAC,EAAE,CAAC,EAAE,iCAAkB;IACtC,CAAC,wBAAa,CAAC,EAAE,CAAC,EAAE,kCAAmB;IACvC,CAAC,wBAAa,CAAC,EAAE,CAAC,EAAE,iCAAkB;IACtC,CAAC,wBAAa,CAAC,KAAK,CAAC,EAAE,mCAAoB;IAC3C,CAAC,wBAAa,CAAC,EAAE,CAAC,EAAE,mCAAoB;IACxC,CAAC,wBAAa,CAA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AoB,GAAG,KAAK,CAAC;AAC/B,CAAC;AAED;;;GAGG;AACH,SAAgB,uBAAuB,CACrC,SAAkC,EAClC,SAA2C,EAC3C,QAAiB;IAEjB,OAAO,sBAAsB,EAAE,CAAC,kBAAkB,CAChD,SAAS,EACT,SAAS,EACT,QAAQ,CACT,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,SAAgB,2BAA2B,CACzC,SAAkC,EAClC,SAA2C,EAC3C,QAAiB;IAEjB,OAAO,sBAAsB,EAAE,CAAC,sBAAsB,CACpD,SAAS,EACT,SAAS,EACT,QAAQ,CACT,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"node-ecies-i18n-setup.js","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-node-ecies-lib/src/i18n/node-ecies-i18n-setup.ts"],"names":[],"mappings":";;;AA8DA,wEAMC;AAOD,0EAKC;AAUD,wDAeC;AAKD,4DAEC;AAMD,0DAUC;AAKD,kEAUC;AA/ID;;;;;;;;;;GAUG;AACH,0DAGoC;AAwBL,iGAzB7B,4BAAgB,OAyB6B;AAvB/C,wDAQmC;AAEnC,2CAAuE;AAa9D,qGAbA,gCAAoB,OAaA;AAX7B,iDASwB;AAIxB;;;;GAIG;AACU,QAAA,yBAAyB,GAGlC;IACF,CAAC,wBAAa,CAAC,KAAK,CAAC,EAAE,kCAAmB;IAC1C,CAAC,wBAAa,CAAC,KAAK,CAAC,EAAE,yCAA0B;IACjD,CAAC,wBAAa,CAAC,EAAE,CAAC,EAAE,iCAAkB;IACtC,CAAC,wBAAa,CAAC,EAAE,CAAC,EAAE,kCAAmB;IACvC,CAAC,wBAAa,CAAC,EAAE,CAAC,EAAE,iCAAkB;IACtC,CAAC,wBAAa,CAAC,KAAK,CAAC,EAAE,mCAAoB;IAC3C,CAAC,wBAAa,CAAC,EAAE,CAAC,EAAE,mCAAoB;IACxC,CAAC,wBAAa,CAAC,EAAE,CAAC,EAAE,oCAAqB;CAC1C,CAAC;AAEF;;GAEG;AACH,SAAg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 /**
2
+ * Re-export all threshold enumerations from ecies-lib
3
+ * This ensures enumeration parity between browser and Node.js implementations
4
+ */
5
+ export { CeremonyStatus, GuardianStatus, IntervalTriggerType, ThresholdAuditEventType, } from '@digitaldefiance/ecies-lib';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/digitaldefiance-node-ecies-lib/src/lib/voting/threshold/enumerations/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EACL,cAAc,EACd,cAAc,EACd,mBAAmB,EACnB,uBAAuB,GACxB,MAAM,4BAA4B,CAAC"}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ThresholdAuditEventType = exports.IntervalTriggerType = exports.GuardianStatus = exports.CeremonyStatus = void 0;
4
+ /**
5
+ * Re-export all threshold enumerations from ecies-lib
6
+ * This ensures enumeration parity between browser and Node.js implementations
7
+ */
8
+ var ecies_lib_1 = require("@digitaldefiance/ecies-lib");
9
+ Object.defineProperty(exports, "CeremonyStatus", { enumerable: true, get: function () { return ecies_lib_1.CeremonyStatus; } });
10
+ Object.defineProperty(exports, "GuardianStatus", { enumerable: true, get: function () { return ecies_lib_1.GuardianStatus; } });
11
+ Object.defineProperty(exports, "IntervalTriggerType", { enumerable: true, get: function () { return ecies_lib_1.IntervalTriggerType; } });
12
+ Object.defineProperty(exports, "ThresholdAuditEventType", { enumerable: true, get: function () { return ecies_lib_1.ThresholdAuditEventType; } });
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../packages/digitaldefiance-node-ecies-lib/src/lib/voting/threshold/enumerations/index.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,wDAKoC;AAJlC,2GAAA,cAAc,OAAA;AACd,2GAAA,cAAc,OAAA;AACd,gHAAA,mBAAmB,OAAA;AACnB,oHAAA,uBAAuB,OAAA"}
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Threshold Voting Module - Node.js Optimized
3
+ *
4
+ * Re-exports threshold voting components from ecies-lib and adds
5
+ * Node.js-specific extensions with Buffer support for improved performance.
6
+ *
7
+ * Key features:
8
+ * - Threshold Paillier cryptography (k-of-n Guardians required for decryption)
9
+ * - Real-time interval decryption during voting
10
+ * - Zero-knowledge proofs for all decryption operations
11
+ * - Integration with hierarchical aggregation (Precinct → County → State → National)
12
+ * - Backward compatible with single-authority polls
13
+ * - Node.js Buffer support for efficient serialization
14
+ *
15
+ * @example
16
+ * ```typescript
17
+ * import {
18
+ * ThresholdKeyGenerator,
19
+ * GuardianRegistry,
20
+ * CeremonyCoordinator,
21
+ * GuardianStatus,
22
+ * } from '@digitaldefiance/node-ecies-lib';
23
+ *
24
+ * // Generate threshold keys (5-of-9 configuration)
25
+ * const keyGen = new ThresholdKeyGenerator();
26
+ * const keyPair = await keyGen.generate({ totalShares: 9, threshold: 5 });
27
+ *
28
+ * // Register Guardians
29
+ * const registry = new GuardianRegistry();
30
+ * keyPair.keyShares.forEach((share, i) => {
31
+ * registry.register({
32
+ * id: guardianIds[i],
33
+ * name: `Guardian ${i + 1}`,
34
+ * shareIndex: share.index,
35
+ * verificationKey: share.verificationKey,
36
+ * status: GuardianStatus.Online,
37
+ * });
38
+ * });
39
+ *
40
+ * // Create threshold poll and conduct voting...
41
+ * ```
42
+ */
43
+ export * from './enumerations';
44
+ export type * from './interfaces';
45
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../packages/digitaldefiance-node-ecies-lib/src/lib/voting/threshold/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAGH,cAAc,gBAAgB,CAAC;AAG/B,mBAAmB,cAAc,CAAC"}
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ /**
3
+ * Threshold Voting Module - Node.js Optimized
4
+ *
5
+ * Re-exports threshold voting components from ecies-lib and adds
6
+ * Node.js-specific extensions with Buffer support for improved performance.
7
+ *
8
+ * Key features:
9
+ * - Threshold Paillier cryptography (k-of-n Guardians required for decryption)
10
+ * - Real-time interval decryption during voting
11
+ * - Zero-knowledge proofs for all decryption operations
12
+ * - Integration with hierarchical aggregation (Precinct → County → State → National)
13
+ * - Backward compatible with single-authority polls
14
+ * - Node.js Buffer support for efficient serialization
15
+ *
16
+ * @example
17
+ * ```typescript
18
+ * import {
19
+ * ThresholdKeyGenerator,
20
+ * GuardianRegistry,
21
+ * CeremonyCoordinator,
22
+ * GuardianStatus,
23
+ * } from '@digitaldefiance/node-ecies-lib';
24
+ *
25
+ * // Generate threshold keys (5-of-9 configuration)
26
+ * const keyGen = new ThresholdKeyGenerator();
27
+ * const keyPair = await keyGen.generate({ totalShares: 9, threshold: 5 });
28
+ *
29
+ * // Register Guardians
30
+ * const registry = new GuardianRegistry();
31
+ * keyPair.keyShares.forEach((share, i) => {
32
+ * registry.register({
33
+ * id: guardianIds[i],
34
+ * name: `Guardian ${i + 1}`,
35
+ * shareIndex: share.index,
36
+ * verificationKey: share.verificationKey,
37
+ * status: GuardianStatus.Online,
38
+ * });
39
+ * });
40
+ *
41
+ * // Create threshold poll and conduct voting...
42
+ * ```
43
+ */
44
+ Object.defineProperty(exports, "__esModule", { value: true });
45
+ const tslib_1 = require("tslib");
46
+ // Re-export enumerations from ecies-lib
47
+ tslib_1.__exportStar(require("./enumerations"), exports);
48
+ // Node.js-specific extensions will be added in Task 17
49
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/digitaldefiance-node-ecies-lib/src/lib/voting/threshold/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;;;AAEH,wCAAwC;AACxC,yDAA+B;AAK/B,uDAAuD"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Re-export all threshold interfaces from ecies-lib
3
+ * This ensures interface parity between browser and Node.js implementations
4
+ *
5
+ * Node.js-specific Buffer extensions will be added in future tasks.
6
+ */
7
+ export type { KeyShare, ThresholdKeyConfig, ThresholdKeyPair, ZKProof, PartialDecryption, CombinedZKProof, CombinedDecryption, Guardian, GuardianStatusChangeEvent, IntervalConfig, IntervalTriggerEvent, Ceremony, IntervalTally, TallySubscription, VerificationResult, ThresholdPollConfig, ThresholdAuditEntry, IThresholdKeyGenerator, IPartialDecryptionService, IDecryptionCombiner, IGuardianRegistry, IIntervalScheduler, ICeremonyCoordinator, IPublicTallyFeed, ITallyVerifier, IThresholdPoll, IThresholdPollFactory, IThresholdAggregator, } from '@digitaldefiance/ecies-lib';
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/digitaldefiance-node-ecies-lib/src/lib/voting/threshold/interfaces/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,YAAY,EAEV,QAAQ,EACR,kBAAkB,EAClB,gBAAgB,EAChB,OAAO,EACP,iBAAiB,EACjB,eAAe,EACf,kBAAkB,EAElB,QAAQ,EACR,yBAAyB,EAEzB,cAAc,EACd,oBAAoB,EAEpB,QAAQ,EAER,aAAa,EACb,iBAAiB,EACjB,kBAAkB,EAElB,mBAAmB,EAEnB,mBAAmB,EAEnB,sBAAsB,EACtB,yBAAyB,EACzB,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,oBAAoB,EACpB,gBAAgB,EAChB,cAAc,EACd,cAAc,EACd,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,4BAA4B,CAAC"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../packages/digitaldefiance-node-ecies-lib/src/lib/voting/threshold/interfaces/index.ts"],"names":[],"mappings":""}