@digitaldefiance/ecies-lib 4.17.2 → 4.17.4
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 +2 -2
- package/src/i18n-setup.d.ts +7 -1
- package/src/i18n-setup.d.ts.map +1 -1
- package/src/i18n-setup.js +12 -0
- package/src/i18n-setup.js.map +1 -1
- package/src/index.d.ts +1 -1
- package/src/index.d.ts.map +1 -1
- package/src/index.js +2 -1
- package/src/index.js.map +1 -1
- package/src/lib/voting/index.d.ts +1 -0
- package/src/lib/voting/index.d.ts.map +1 -1
- package/src/lib/voting/index.js +2 -0
- package/src/lib/voting/index.js.map +1 -1
- package/src/lib/voting/threshold/decryption-combiner.d.ts +141 -0
- package/src/lib/voting/threshold/decryption-combiner.d.ts.map +1 -0
- package/src/lib/voting/threshold/decryption-combiner.js +343 -0
- package/src/lib/voting/threshold/decryption-combiner.js.map +1 -0
- package/src/lib/voting/threshold/enumerations/ceremony-status.d.ts +19 -0
- package/src/lib/voting/threshold/enumerations/ceremony-status.d.ts.map +1 -0
- package/src/lib/voting/threshold/enumerations/ceremony-status.js +23 -0
- package/src/lib/voting/threshold/enumerations/ceremony-status.js.map +1 -0
- package/src/lib/voting/threshold/enumerations/guardian-status.d.ts +18 -0
- package/src/lib/voting/threshold/enumerations/guardian-status.d.ts.map +1 -0
- package/src/lib/voting/threshold/enumerations/guardian-status.js +22 -0
- package/src/lib/voting/threshold/enumerations/guardian-status.js.map +1 -0
- package/src/lib/voting/threshold/enumerations/index.d.ts +8 -0
- package/src/lib/voting/threshold/enumerations/index.d.ts.map +1 -0
- package/src/lib/voting/threshold/enumerations/index.js +11 -0
- package/src/lib/voting/threshold/enumerations/index.js.map +1 -0
- package/src/lib/voting/threshold/enumerations/interval-trigger-type.d.ts +15 -0
- package/src/lib/voting/threshold/enumerations/interval-trigger-type.d.ts.map +1 -0
- package/src/lib/voting/threshold/enumerations/interval-trigger-type.js +19 -0
- package/src/lib/voting/threshold/enumerations/interval-trigger-type.js.map +1 -0
- package/src/lib/voting/threshold/enumerations/threshold-audit-event-type.d.ts +29 -0
- package/src/lib/voting/threshold/enumerations/threshold-audit-event-type.d.ts.map +1 -0
- package/src/lib/voting/threshold/enumerations/threshold-audit-event-type.js +33 -0
- package/src/lib/voting/threshold/enumerations/threshold-audit-event-type.js.map +1 -0
- package/src/lib/voting/threshold/guardian-registry.d.ts +120 -0
- package/src/lib/voting/threshold/guardian-registry.d.ts.map +1 -0
- package/src/lib/voting/threshold/guardian-registry.js +227 -0
- package/src/lib/voting/threshold/guardian-registry.js.map +1 -0
- package/src/lib/voting/threshold/index.d.ts +49 -0
- package/src/lib/voting/threshold/index.d.ts.map +1 -0
- package/src/lib/voting/threshold/index.js +69 -0
- package/src/lib/voting/threshold/index.js.map +1 -0
- package/src/lib/voting/threshold/interfaces/ceremony-coordinator.d.ts +19 -0
- package/src/lib/voting/threshold/interfaces/ceremony-coordinator.d.ts.map +1 -0
- package/src/lib/voting/threshold/interfaces/ceremony-coordinator.js +3 -0
- package/src/lib/voting/threshold/interfaces/ceremony-coordinator.js.map +1 -0
- package/src/lib/voting/threshold/interfaces/ceremony.d.ts +33 -0
- package/src/lib/voting/threshold/interfaces/ceremony.d.ts.map +1 -0
- package/src/lib/voting/threshold/interfaces/ceremony.js +3 -0
- package/src/lib/voting/threshold/interfaces/ceremony.js.map +1 -0
- package/src/lib/voting/threshold/interfaces/combined-decryption.d.ts +20 -0
- package/src/lib/voting/threshold/interfaces/combined-decryption.d.ts.map +1 -0
- package/src/lib/voting/threshold/interfaces/combined-decryption.js +3 -0
- package/src/lib/voting/threshold/interfaces/combined-decryption.js.map +1 -0
- package/src/lib/voting/threshold/interfaces/combined-zk-proof.d.ts +16 -0
- package/src/lib/voting/threshold/interfaces/combined-zk-proof.d.ts.map +1 -0
- package/src/lib/voting/threshold/interfaces/combined-zk-proof.js +3 -0
- package/src/lib/voting/threshold/interfaces/combined-zk-proof.js.map +1 -0
- package/src/lib/voting/threshold/interfaces/decryption-combiner.d.ts +14 -0
- package/src/lib/voting/threshold/interfaces/decryption-combiner.d.ts.map +1 -0
- package/src/lib/voting/threshold/interfaces/decryption-combiner.js +3 -0
- package/src/lib/voting/threshold/interfaces/decryption-combiner.js.map +1 -0
- package/src/lib/voting/threshold/interfaces/guardian-registry.d.ts +28 -0
- package/src/lib/voting/threshold/interfaces/guardian-registry.d.ts.map +1 -0
- package/src/lib/voting/threshold/interfaces/guardian-registry.js +3 -0
- package/src/lib/voting/threshold/interfaces/guardian-registry.js.map +1 -0
- package/src/lib/voting/threshold/interfaces/guardian-status-change-event.d.ts +16 -0
- package/src/lib/voting/threshold/interfaces/guardian-status-change-event.d.ts.map +1 -0
- package/src/lib/voting/threshold/interfaces/guardian-status-change-event.js +3 -0
- package/src/lib/voting/threshold/interfaces/guardian-status-change-event.js.map +1 -0
- package/src/lib/voting/threshold/interfaces/guardian.d.ts +25 -0
- package/src/lib/voting/threshold/interfaces/guardian.d.ts.map +1 -0
- package/src/lib/voting/threshold/interfaces/guardian.js +3 -0
- package/src/lib/voting/threshold/interfaces/guardian.js.map +1 -0
- package/src/lib/voting/threshold/interfaces/index.d.ts +32 -0
- package/src/lib/voting/threshold/interfaces/index.d.ts.map +1 -0
- package/src/lib/voting/threshold/interfaces/index.js +6 -0
- package/src/lib/voting/threshold/interfaces/index.js.map +1 -0
- package/src/lib/voting/threshold/interfaces/interval-config.d.ts +17 -0
- package/src/lib/voting/threshold/interfaces/interval-config.d.ts.map +1 -0
- package/src/lib/voting/threshold/interfaces/interval-config.js +3 -0
- package/src/lib/voting/threshold/interfaces/interval-config.js.map +1 -0
- package/src/lib/voting/threshold/interfaces/interval-scheduler.d.ts +23 -0
- package/src/lib/voting/threshold/interfaces/interval-scheduler.d.ts.map +1 -0
- package/src/lib/voting/threshold/interfaces/interval-scheduler.js +3 -0
- package/src/lib/voting/threshold/interfaces/interval-scheduler.js.map +1 -0
- package/src/lib/voting/threshold/interfaces/interval-tally.d.ts +30 -0
- package/src/lib/voting/threshold/interfaces/interval-tally.d.ts.map +1 -0
- package/src/lib/voting/threshold/interfaces/interval-tally.js +3 -0
- package/src/lib/voting/threshold/interfaces/interval-tally.js.map +1 -0
- package/src/lib/voting/threshold/interfaces/interval-trigger-event.d.ts +20 -0
- package/src/lib/voting/threshold/interfaces/interval-trigger-event.d.ts.map +1 -0
- package/src/lib/voting/threshold/interfaces/interval-trigger-event.js +3 -0
- package/src/lib/voting/threshold/interfaces/interval-trigger-event.js.map +1 -0
- package/src/lib/voting/threshold/interfaces/key-share.d.ts +15 -0
- package/src/lib/voting/threshold/interfaces/key-share.d.ts.map +1 -0
- package/src/lib/voting/threshold/interfaces/key-share.js +3 -0
- package/src/lib/voting/threshold/interfaces/key-share.js.map +1 -0
- package/src/lib/voting/threshold/interfaces/partial-decryption-service.d.ts +17 -0
- package/src/lib/voting/threshold/interfaces/partial-decryption-service.d.ts.map +1 -0
- package/src/lib/voting/threshold/interfaces/partial-decryption-service.js +3 -0
- package/src/lib/voting/threshold/interfaces/partial-decryption-service.js.map +1 -0
- package/src/lib/voting/threshold/interfaces/partial-decryption.d.ts +20 -0
- package/src/lib/voting/threshold/interfaces/partial-decryption.d.ts.map +1 -0
- package/src/lib/voting/threshold/interfaces/partial-decryption.js +3 -0
- package/src/lib/voting/threshold/interfaces/partial-decryption.js.map +1 -0
- package/src/lib/voting/threshold/interfaces/public-tally-feed.d.ts +19 -0
- package/src/lib/voting/threshold/interfaces/public-tally-feed.d.ts.map +1 -0
- package/src/lib/voting/threshold/interfaces/public-tally-feed.js +3 -0
- package/src/lib/voting/threshold/interfaces/public-tally-feed.js.map +1 -0
- package/src/lib/voting/threshold/interfaces/tally-subscription.d.ts +16 -0
- package/src/lib/voting/threshold/interfaces/tally-subscription.d.ts.map +1 -0
- package/src/lib/voting/threshold/interfaces/tally-subscription.js +3 -0
- package/src/lib/voting/threshold/interfaces/tally-subscription.js.map +1 -0
- package/src/lib/voting/threshold/interfaces/tally-verifier.d.ts +12 -0
- package/src/lib/voting/threshold/interfaces/tally-verifier.d.ts.map +1 -0
- package/src/lib/voting/threshold/interfaces/tally-verifier.js +3 -0
- package/src/lib/voting/threshold/interfaces/tally-verifier.js.map +1 -0
- package/src/lib/voting/threshold/interfaces/threshold-aggregator.d.ts +15 -0
- package/src/lib/voting/threshold/interfaces/threshold-aggregator.d.ts.map +1 -0
- package/src/lib/voting/threshold/interfaces/threshold-aggregator.js +3 -0
- package/src/lib/voting/threshold/interfaces/threshold-aggregator.js.map +1 -0
- package/src/lib/voting/threshold/interfaces/threshold-audit-entry.d.ts +28 -0
- package/src/lib/voting/threshold/interfaces/threshold-audit-entry.d.ts.map +1 -0
- package/src/lib/voting/threshold/interfaces/threshold-audit-entry.js +3 -0
- package/src/lib/voting/threshold/interfaces/threshold-audit-entry.js.map +1 -0
- package/src/lib/voting/threshold/interfaces/threshold-key-config.d.ts +12 -0
- package/src/lib/voting/threshold/interfaces/threshold-key-config.d.ts.map +1 -0
- package/src/lib/voting/threshold/interfaces/threshold-key-config.js +3 -0
- package/src/lib/voting/threshold/interfaces/threshold-key-config.js.map +1 -0
- package/src/lib/voting/threshold/interfaces/threshold-key-generator.d.ts +12 -0
- package/src/lib/voting/threshold/interfaces/threshold-key-generator.d.ts.map +1 -0
- package/src/lib/voting/threshold/interfaces/threshold-key-generator.js +3 -0
- package/src/lib/voting/threshold/interfaces/threshold-key-generator.js.map +1 -0
- package/src/lib/voting/threshold/interfaces/threshold-key-pair.d.ts +30 -0
- package/src/lib/voting/threshold/interfaces/threshold-key-pair.d.ts.map +1 -0
- package/src/lib/voting/threshold/interfaces/threshold-key-pair.js +3 -0
- package/src/lib/voting/threshold/interfaces/threshold-key-pair.js.map +1 -0
- package/src/lib/voting/threshold/interfaces/threshold-poll-config.d.ts +19 -0
- package/src/lib/voting/threshold/interfaces/threshold-poll-config.d.ts.map +1 -0
- package/src/lib/voting/threshold/interfaces/threshold-poll-config.js +3 -0
- package/src/lib/voting/threshold/interfaces/threshold-poll-config.js.map +1 -0
- package/src/lib/voting/threshold/interfaces/threshold-poll-factory.d.ts +16 -0
- package/src/lib/voting/threshold/interfaces/threshold-poll-factory.d.ts.map +1 -0
- package/src/lib/voting/threshold/interfaces/threshold-poll-factory.js +3 -0
- package/src/lib/voting/threshold/interfaces/threshold-poll-factory.js.map +1 -0
- package/src/lib/voting/threshold/interfaces/threshold-poll.d.ts +25 -0
- package/src/lib/voting/threshold/interfaces/threshold-poll.d.ts.map +1 -0
- package/src/lib/voting/threshold/interfaces/threshold-poll.js +3 -0
- package/src/lib/voting/threshold/interfaces/threshold-poll.js.map +1 -0
- package/src/lib/voting/threshold/interfaces/verification-result.d.ts +17 -0
- package/src/lib/voting/threshold/interfaces/verification-result.d.ts.map +1 -0
- package/src/lib/voting/threshold/interfaces/verification-result.js +3 -0
- package/src/lib/voting/threshold/interfaces/verification-result.js.map +1 -0
- package/src/lib/voting/threshold/interfaces/zk-proof.d.ts +15 -0
- package/src/lib/voting/threshold/interfaces/zk-proof.d.ts.map +1 -0
- package/src/lib/voting/threshold/interfaces/zk-proof.js +3 -0
- package/src/lib/voting/threshold/interfaces/zk-proof.js.map +1 -0
- package/src/lib/voting/threshold/partial-decryption-service.d.ts +130 -0
- package/src/lib/voting/threshold/partial-decryption-service.d.ts.map +1 -0
- package/src/lib/voting/threshold/partial-decryption-service.js +288 -0
- package/src/lib/voting/threshold/partial-decryption-service.js.map +1 -0
- package/src/lib/voting/threshold/threshold-key-generator.d.ts +114 -0
- package/src/lib/voting/threshold/threshold-key-generator.d.ts.map +1 -0
- package/src/lib/voting/threshold/threshold-key-generator.js +275 -0
- package/src/lib/voting/threshold/threshold-key-generator.js.map +1 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Threshold Voting Module
|
|
3
|
+
*
|
|
4
|
+
* Implements Real-Time Threshold Voting for secure, distributed vote tallying.
|
|
5
|
+
* Based on Damgård et al.'s "Generalization of Paillier's Public-Key System
|
|
6
|
+
* with Applications to Electronic Voting."
|
|
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
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```typescript
|
|
17
|
+
* import {
|
|
18
|
+
* ThresholdKeyGenerator,
|
|
19
|
+
* GuardianRegistry,
|
|
20
|
+
* CeremonyCoordinator,
|
|
21
|
+
* GuardianStatus,
|
|
22
|
+
* } from './voting/threshold';
|
|
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
|
+
export { ThresholdKeyGenerator, InvalidThresholdConfigError, KeyGenerationFailedError, } from './threshold-key-generator';
|
|
46
|
+
export { PartialDecryptionService, InvalidPartialProofError, DeserializationError, } from './partial-decryption-service';
|
|
47
|
+
export { DecryptionCombiner, InsufficientPartialsError, InvalidPartialInCombineError, CombineFailedError, } from './decryption-combiner';
|
|
48
|
+
export { GuardianRegistry, GuardianAlreadyRegisteredError, GuardianNotFoundError, InvalidShareIndexError, RegistryFullError, } from './guardian-registry';
|
|
49
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../packages/digitaldefiance-ecies-lib/src/lib/voting/threshold/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAGH,cAAc,gBAAgB,CAAC;AAG/B,mBAAmB,cAAc,CAAC;AAGlC,OAAO,EACL,qBAAqB,EACrB,2BAA2B,EAC3B,wBAAwB,GACzB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EACL,wBAAwB,EACxB,wBAAwB,EACxB,oBAAoB,GACrB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EACL,kBAAkB,EAClB,yBAAyB,EACzB,4BAA4B,EAC5B,kBAAkB,GACnB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,gBAAgB,EAChB,8BAA8B,EAC9B,qBAAqB,EACrB,sBAAsB,EACtB,iBAAiB,GAClB,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Threshold Voting Module
|
|
4
|
+
*
|
|
5
|
+
* Implements Real-Time Threshold Voting for secure, distributed vote tallying.
|
|
6
|
+
* Based on Damgård et al.'s "Generalization of Paillier's Public-Key System
|
|
7
|
+
* with Applications to Electronic Voting."
|
|
8
|
+
*
|
|
9
|
+
* Key features:
|
|
10
|
+
* - Threshold Paillier cryptography (k-of-n Guardians required for decryption)
|
|
11
|
+
* - Real-time interval decryption during voting
|
|
12
|
+
* - Zero-knowledge proofs for all decryption operations
|
|
13
|
+
* - Integration with hierarchical aggregation (Precinct → County → State → National)
|
|
14
|
+
* - Backward compatible with single-authority polls
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```typescript
|
|
18
|
+
* import {
|
|
19
|
+
* ThresholdKeyGenerator,
|
|
20
|
+
* GuardianRegistry,
|
|
21
|
+
* CeremonyCoordinator,
|
|
22
|
+
* GuardianStatus,
|
|
23
|
+
* } from './voting/threshold';
|
|
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
|
+
exports.RegistryFullError = exports.InvalidShareIndexError = exports.GuardianNotFoundError = exports.GuardianAlreadyRegisteredError = exports.GuardianRegistry = exports.CombineFailedError = exports.InvalidPartialInCombineError = exports.InsufficientPartialsError = exports.DecryptionCombiner = exports.DeserializationError = exports.InvalidPartialProofError = exports.PartialDecryptionService = exports.KeyGenerationFailedError = exports.InvalidThresholdConfigError = exports.ThresholdKeyGenerator = void 0;
|
|
46
|
+
const tslib_1 = require("tslib");
|
|
47
|
+
// Re-export enumerations
|
|
48
|
+
tslib_1.__exportStar(require("./enumerations"), exports);
|
|
49
|
+
// Re-export classes
|
|
50
|
+
var threshold_key_generator_1 = require("./threshold-key-generator");
|
|
51
|
+
Object.defineProperty(exports, "ThresholdKeyGenerator", { enumerable: true, get: function () { return threshold_key_generator_1.ThresholdKeyGenerator; } });
|
|
52
|
+
Object.defineProperty(exports, "InvalidThresholdConfigError", { enumerable: true, get: function () { return threshold_key_generator_1.InvalidThresholdConfigError; } });
|
|
53
|
+
Object.defineProperty(exports, "KeyGenerationFailedError", { enumerable: true, get: function () { return threshold_key_generator_1.KeyGenerationFailedError; } });
|
|
54
|
+
var partial_decryption_service_1 = require("./partial-decryption-service");
|
|
55
|
+
Object.defineProperty(exports, "PartialDecryptionService", { enumerable: true, get: function () { return partial_decryption_service_1.PartialDecryptionService; } });
|
|
56
|
+
Object.defineProperty(exports, "InvalidPartialProofError", { enumerable: true, get: function () { return partial_decryption_service_1.InvalidPartialProofError; } });
|
|
57
|
+
Object.defineProperty(exports, "DeserializationError", { enumerable: true, get: function () { return partial_decryption_service_1.DeserializationError; } });
|
|
58
|
+
var decryption_combiner_1 = require("./decryption-combiner");
|
|
59
|
+
Object.defineProperty(exports, "DecryptionCombiner", { enumerable: true, get: function () { return decryption_combiner_1.DecryptionCombiner; } });
|
|
60
|
+
Object.defineProperty(exports, "InsufficientPartialsError", { enumerable: true, get: function () { return decryption_combiner_1.InsufficientPartialsError; } });
|
|
61
|
+
Object.defineProperty(exports, "InvalidPartialInCombineError", { enumerable: true, get: function () { return decryption_combiner_1.InvalidPartialInCombineError; } });
|
|
62
|
+
Object.defineProperty(exports, "CombineFailedError", { enumerable: true, get: function () { return decryption_combiner_1.CombineFailedError; } });
|
|
63
|
+
var guardian_registry_1 = require("./guardian-registry");
|
|
64
|
+
Object.defineProperty(exports, "GuardianRegistry", { enumerable: true, get: function () { return guardian_registry_1.GuardianRegistry; } });
|
|
65
|
+
Object.defineProperty(exports, "GuardianAlreadyRegisteredError", { enumerable: true, get: function () { return guardian_registry_1.GuardianAlreadyRegisteredError; } });
|
|
66
|
+
Object.defineProperty(exports, "GuardianNotFoundError", { enumerable: true, get: function () { return guardian_registry_1.GuardianNotFoundError; } });
|
|
67
|
+
Object.defineProperty(exports, "InvalidShareIndexError", { enumerable: true, get: function () { return guardian_registry_1.InvalidShareIndexError; } });
|
|
68
|
+
Object.defineProperty(exports, "RegistryFullError", { enumerable: true, get: function () { return guardian_registry_1.RegistryFullError; } });
|
|
69
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/digitaldefiance-ecies-lib/src/lib/voting/threshold/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;;;;AAEH,yBAAyB;AACzB,yDAA+B;AAK/B,oBAAoB;AACpB,qEAImC;AAHjC,gIAAA,qBAAqB,OAAA;AACrB,sIAAA,2BAA2B,OAAA;AAC3B,mIAAA,wBAAwB,OAAA;AAG1B,2EAIsC;AAHpC,sIAAA,wBAAwB,OAAA;AACxB,sIAAA,wBAAwB,OAAA;AACxB,kIAAA,oBAAoB,OAAA;AAGtB,6DAK+B;AAJ7B,yHAAA,kBAAkB,OAAA;AAClB,gIAAA,yBAAyB,OAAA;AACzB,mIAAA,4BAA4B,OAAA;AAC5B,yHAAA,kBAAkB,OAAA;AAGpB,yDAM6B;AAL3B,qHAAA,gBAAgB,OAAA;AAChB,mIAAA,8BAA8B,OAAA;AAC9B,0HAAA,qBAAqB,OAAA;AACrB,2HAAA,sBAAsB,OAAA;AACtB,sHAAA,iBAAiB,OAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { PlatformID } from '../../../../interfaces/platform-id';
|
|
2
|
+
import type { Ceremony } from './ceremony';
|
|
3
|
+
import type { PartialDecryption } from './partial-decryption';
|
|
4
|
+
/**
|
|
5
|
+
* Interface for coordinating decryption ceremonies.
|
|
6
|
+
*/
|
|
7
|
+
export interface ICeremonyCoordinator<TID extends PlatformID = Uint8Array> {
|
|
8
|
+
/** Start a new decryption ceremony */
|
|
9
|
+
startCeremony(pollId: TID, intervalNumber: number, encryptedTally: bigint[]): Ceremony<TID>;
|
|
10
|
+
/** Submit a partial decryption */
|
|
11
|
+
submitPartial(ceremonyId: string, partial: PartialDecryption): boolean;
|
|
12
|
+
/** Get ceremony by ID */
|
|
13
|
+
getCeremony(ceremonyId: string): Ceremony<TID> | undefined;
|
|
14
|
+
/** Get ceremonies for a poll */
|
|
15
|
+
getCeremoniesForPoll(pollId: TID): readonly Ceremony<TID>[];
|
|
16
|
+
/** Subscribe to ceremony completion events */
|
|
17
|
+
onCeremonyComplete(callback: (ceremony: Ceremony<TID>) => void): void;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=ceremony-coordinator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ceremony-coordinator.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/digitaldefiance-ecies-lib/src/lib/voting/threshold/interfaces/ceremony-coordinator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AACrE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAE9D;;GAEG;AACH,MAAM,WAAW,oBAAoB,CAAC,GAAG,SAAS,UAAU,GAAG,UAAU;IACvE,sCAAsC;IACtC,aAAa,CACX,MAAM,EAAE,GAAG,EACX,cAAc,EAAE,MAAM,EACtB,cAAc,EAAE,MAAM,EAAE,GACvB,QAAQ,CAAC,GAAG,CAAC,CAAC;IAEjB,kCAAkC;IAClC,aAAa,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC;IAEvE,yBAAyB;IACzB,WAAW,CAAC,UAAU,EAAE,MAAM,GAAG,QAAQ,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC;IAE3D,gCAAgC;IAChC,oBAAoB,CAAC,MAAM,EAAE,GAAG,GAAG,SAAS,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;IAE5D,8CAA8C;IAC9C,kBAAkB,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC,GAAG,CAAC,KAAK,IAAI,GAAG,IAAI,CAAC;CACvE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ceremony-coordinator.js","sourceRoot":"","sources":["../../../../../../../../packages/digitaldefiance-ecies-lib/src/lib/voting/threshold/interfaces/ceremony-coordinator.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { PlatformID } from '../../../../interfaces/platform-id';
|
|
2
|
+
import type { CeremonyStatus } from '../enumerations/ceremony-status';
|
|
3
|
+
import type { CombinedDecryption } from './combined-decryption';
|
|
4
|
+
import type { PartialDecryption } from './partial-decryption';
|
|
5
|
+
/**
|
|
6
|
+
* A threshold decryption ceremony.
|
|
7
|
+
*
|
|
8
|
+
* Coordinates the collection of partial decryptions from Guardians
|
|
9
|
+
* to reveal an aggregate tally.
|
|
10
|
+
*/
|
|
11
|
+
export interface Ceremony<TID extends PlatformID = Uint8Array> {
|
|
12
|
+
/** Unique ceremony identifier */
|
|
13
|
+
readonly id: string;
|
|
14
|
+
/** Associated poll ID */
|
|
15
|
+
readonly pollId: TID;
|
|
16
|
+
/** Interval number */
|
|
17
|
+
readonly intervalNumber: number;
|
|
18
|
+
/** Ceremony-specific nonce */
|
|
19
|
+
readonly nonce: Uint8Array;
|
|
20
|
+
/** Encrypted tally to decrypt */
|
|
21
|
+
readonly encryptedTally: bigint[];
|
|
22
|
+
/** Current status */
|
|
23
|
+
status: CeremonyStatus;
|
|
24
|
+
/** Collected partial decryptions (keyed by Guardian index) */
|
|
25
|
+
readonly partials: Map<number, PartialDecryption>;
|
|
26
|
+
/** Start timestamp */
|
|
27
|
+
readonly startedAt: number;
|
|
28
|
+
/** Completion timestamp */
|
|
29
|
+
completedAt?: number;
|
|
30
|
+
/** Result (if completed) */
|
|
31
|
+
result?: CombinedDecryption;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=ceremony.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ceremony.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/digitaldefiance-ecies-lib/src/lib/voting/threshold/interfaces/ceremony.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AACrE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAE9D;;;;;GAKG;AACH,MAAM,WAAW,QAAQ,CAAC,GAAG,SAAS,UAAU,GAAG,UAAU;IAC3D,iCAAiC;IACjC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,yBAAyB;IACzB,QAAQ,CAAC,MAAM,EAAE,GAAG,CAAC;IACrB,sBAAsB;IACtB,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,8BAA8B;IAC9B,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC;IAC3B,iCAAiC;IACjC,QAAQ,CAAC,cAAc,EAAE,MAAM,EAAE,CAAC;IAClC,qBAAqB;IACrB,MAAM,EAAE,cAAc,CAAC;IACvB,8DAA8D;IAC9D,QAAQ,CAAC,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;IAClD,sBAAsB;IACtB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,2BAA2B;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,4BAA4B;IAC5B,MAAM,CAAC,EAAE,kBAAkB,CAAC;CAC7B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ceremony.js","sourceRoot":"","sources":["../../../../../../../../packages/digitaldefiance-ecies-lib/src/lib/voting/threshold/interfaces/ceremony.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { CombinedZKProof } from './combined-zk-proof';
|
|
2
|
+
/**
|
|
3
|
+
* Result of combining k partial decryptions.
|
|
4
|
+
*
|
|
5
|
+
* Contains the decrypted plaintext tallies along with proof
|
|
6
|
+
* that the decryption was performed correctly.
|
|
7
|
+
*/
|
|
8
|
+
export interface CombinedDecryption {
|
|
9
|
+
/** The decrypted plaintext tallies */
|
|
10
|
+
readonly tallies: bigint[];
|
|
11
|
+
/** Combined proof of correct decryption */
|
|
12
|
+
readonly combinedProof: CombinedZKProof;
|
|
13
|
+
/** Indices of participating Guardians */
|
|
14
|
+
readonly participatingGuardians: readonly number[];
|
|
15
|
+
/** Ceremony identifier */
|
|
16
|
+
readonly ceremonyId: string;
|
|
17
|
+
/** Timestamp of combination */
|
|
18
|
+
readonly timestamp: number;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=combined-decryption.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"combined-decryption.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/digitaldefiance-ecies-lib/src/lib/voting/threshold/interfaces/combined-decryption.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE3D;;;;;GAKG;AACH,MAAM,WAAW,kBAAkB;IACjC,sCAAsC;IACtC,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,CAAC;IAC3B,2CAA2C;IAC3C,QAAQ,CAAC,aAAa,EAAE,eAAe,CAAC;IACxC,yCAAyC;IACzC,QAAQ,CAAC,sBAAsB,EAAE,SAAS,MAAM,EAAE,CAAC;IACnD,0BAA0B;IAC1B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,+BAA+B;IAC/B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"combined-decryption.js","sourceRoot":"","sources":["../../../../../../../../packages/digitaldefiance-ecies-lib/src/lib/voting/threshold/interfaces/combined-decryption.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ZKProof } from './zk-proof';
|
|
2
|
+
/**
|
|
3
|
+
* Combined zero-knowledge proof from multiple Guardians.
|
|
4
|
+
*
|
|
5
|
+
* Aggregates individual proofs to demonstrate that the combined
|
|
6
|
+
* decryption was performed correctly by authorized Guardians.
|
|
7
|
+
*/
|
|
8
|
+
export interface CombinedZKProof {
|
|
9
|
+
/** Individual proofs from each Guardian */
|
|
10
|
+
readonly partialProofs: readonly ZKProof[];
|
|
11
|
+
/** Aggregated verification data */
|
|
12
|
+
readonly aggregatedCommitment: bigint;
|
|
13
|
+
/** Hash of all inputs */
|
|
14
|
+
readonly inputHash: Uint8Array;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=combined-zk-proof.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"combined-zk-proof.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/digitaldefiance-ecies-lib/src/lib/voting/threshold/interfaces/combined-zk-proof.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE1C;;;;;GAKG;AACH,MAAM,WAAW,eAAe;IAC9B,2CAA2C;IAC3C,QAAQ,CAAC,aAAa,EAAE,SAAS,OAAO,EAAE,CAAC;IAC3C,mCAAmC;IACnC,QAAQ,CAAC,oBAAoB,EAAE,MAAM,CAAC;IACtC,yBAAyB;IACzB,QAAQ,CAAC,SAAS,EAAE,UAAU,CAAC;CAChC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"combined-zk-proof.js","sourceRoot":"","sources":["../../../../../../../../packages/digitaldefiance-ecies-lib/src/lib/voting/threshold/interfaces/combined-zk-proof.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { PublicKey } from 'paillier-bigint';
|
|
2
|
+
import type { CombinedDecryption } from './combined-decryption';
|
|
3
|
+
import type { PartialDecryption } from './partial-decryption';
|
|
4
|
+
import type { ThresholdKeyConfig } from './threshold-key-config';
|
|
5
|
+
/**
|
|
6
|
+
* Interface for combining partial decryptions.
|
|
7
|
+
*/
|
|
8
|
+
export interface IDecryptionCombiner {
|
|
9
|
+
/** Combine k partial decryptions into final plaintext */
|
|
10
|
+
combine(partials: readonly PartialDecryption[], encryptedTally: bigint[], publicKey: PublicKey, config: ThresholdKeyConfig): CombinedDecryption;
|
|
11
|
+
/** Verify a combined decryption */
|
|
12
|
+
verifyCombined(combined: CombinedDecryption, encryptedTally: bigint[], verificationKeys: readonly Uint8Array[], publicKey: PublicKey): boolean;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=decryption-combiner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decryption-combiner.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/digitaldefiance-ecies-lib/src/lib/voting/threshold/interfaces/decryption-combiner.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAEjE;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,yDAAyD;IACzD,OAAO,CACL,QAAQ,EAAE,SAAS,iBAAiB,EAAE,EACtC,cAAc,EAAE,MAAM,EAAE,EACxB,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,kBAAkB,GACzB,kBAAkB,CAAC;IAEtB,mCAAmC;IACnC,cAAc,CACZ,QAAQ,EAAE,kBAAkB,EAC5B,cAAc,EAAE,MAAM,EAAE,EACxB,gBAAgB,EAAE,SAAS,UAAU,EAAE,EACvC,SAAS,EAAE,SAAS,GACnB,OAAO,CAAC;CACZ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decryption-combiner.js","sourceRoot":"","sources":["../../../../../../../../packages/digitaldefiance-ecies-lib/src/lib/voting/threshold/interfaces/decryption-combiner.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { PlatformID } from '../../../../interfaces/platform-id';
|
|
2
|
+
import type { GuardianStatus } from '../enumerations/guardian-status';
|
|
3
|
+
import type { Guardian } from './guardian';
|
|
4
|
+
import type { GuardianStatusChangeEvent } from './guardian-status-change-event';
|
|
5
|
+
/**
|
|
6
|
+
* Interface for Guardian registration and management.
|
|
7
|
+
*/
|
|
8
|
+
export interface IGuardianRegistry<TID extends PlatformID = Uint8Array> {
|
|
9
|
+
/** Register a new Guardian */
|
|
10
|
+
register(guardian: Guardian<TID>): void;
|
|
11
|
+
/** Get Guardian by ID */
|
|
12
|
+
getGuardian(id: TID): Guardian<TID> | undefined;
|
|
13
|
+
/** Get Guardian by share index */
|
|
14
|
+
getGuardianByIndex(index: number): Guardian<TID> | undefined;
|
|
15
|
+
/** Get all registered Guardians */
|
|
16
|
+
getAllGuardians(): readonly Guardian<TID>[];
|
|
17
|
+
/** Get online Guardians */
|
|
18
|
+
getOnlineGuardians(): readonly Guardian<TID>[];
|
|
19
|
+
/** Update Guardian status */
|
|
20
|
+
updateStatus(id: TID, status: GuardianStatus): void;
|
|
21
|
+
/** Designate backup Guardian */
|
|
22
|
+
designateBackup(guardianId: TID, backupId: TID): void;
|
|
23
|
+
/** Subscribe to status change events */
|
|
24
|
+
onStatusChange(callback: (event: GuardianStatusChangeEvent<TID>) => void): void;
|
|
25
|
+
/** Get total registered count */
|
|
26
|
+
readonly count: number;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=guardian-registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"guardian-registry.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/digitaldefiance-ecies-lib/src/lib/voting/threshold/interfaces/guardian-registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AACrE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAEhF;;GAEG;AACH,MAAM,WAAW,iBAAiB,CAAC,GAAG,SAAS,UAAU,GAAG,UAAU;IACpE,8BAA8B;IAC9B,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;IAExC,yBAAyB;IACzB,WAAW,CAAC,EAAE,EAAE,GAAG,GAAG,QAAQ,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC;IAEhD,kCAAkC;IAClC,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,QAAQ,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC;IAE7D,mCAAmC;IACnC,eAAe,IAAI,SAAS,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;IAE5C,2BAA2B;IAC3B,kBAAkB,IAAI,SAAS,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;IAE/C,6BAA6B;IAC7B,YAAY,CAAC,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,cAAc,GAAG,IAAI,CAAC;IAEpD,gCAAgC;IAChC,eAAe,CAAC,UAAU,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,GAAG,IAAI,CAAC;IAEtD,wCAAwC;IACxC,cAAc,CACZ,QAAQ,EAAE,CAAC,KAAK,EAAE,yBAAyB,CAAC,GAAG,CAAC,KAAK,IAAI,GACxD,IAAI,CAAC;IAER,iCAAiC;IACjC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"guardian-registry.js","sourceRoot":"","sources":["../../../../../../../../packages/digitaldefiance-ecies-lib/src/lib/voting/threshold/interfaces/guardian-registry.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { PlatformID } from '../../../../interfaces/platform-id';
|
|
2
|
+
import type { GuardianStatus } from '../enumerations/guardian-status';
|
|
3
|
+
/**
|
|
4
|
+
* Event emitted when a Guardian's status changes.
|
|
5
|
+
*/
|
|
6
|
+
export interface GuardianStatusChangeEvent<TID extends PlatformID = Uint8Array> {
|
|
7
|
+
/** Guardian whose status changed */
|
|
8
|
+
readonly guardianId: TID;
|
|
9
|
+
/** Previous status */
|
|
10
|
+
readonly previousStatus: GuardianStatus;
|
|
11
|
+
/** New status */
|
|
12
|
+
readonly newStatus: GuardianStatus;
|
|
13
|
+
/** Timestamp of the change */
|
|
14
|
+
readonly timestamp: number;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=guardian-status-change-event.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"guardian-status-change-event.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/digitaldefiance-ecies-lib/src/lib/voting/threshold/interfaces/guardian-status-change-event.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AACrE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAEtE;;GAEG;AACH,MAAM,WAAW,yBAAyB,CACxC,GAAG,SAAS,UAAU,GAAG,UAAU;IAEnC,oCAAoC;IACpC,QAAQ,CAAC,UAAU,EAAE,GAAG,CAAC;IACzB,sBAAsB;IACtB,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAC;IACxC,iBAAiB;IACjB,QAAQ,CAAC,SAAS,EAAE,cAAc,CAAC;IACnC,8BAA8B;IAC9B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"guardian-status-change-event.js","sourceRoot":"","sources":["../../../../../../../../packages/digitaldefiance-ecies-lib/src/lib/voting/threshold/interfaces/guardian-status-change-event.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { PlatformID } from '../../../../interfaces/platform-id';
|
|
2
|
+
import type { GuardianStatus } from '../enumerations/guardian-status';
|
|
3
|
+
/**
|
|
4
|
+
* A Guardian who holds a key share for threshold decryption.
|
|
5
|
+
*
|
|
6
|
+
* Guardians are trusted key holders who participate in decryption
|
|
7
|
+
* ceremonies by providing their partial decryptions.
|
|
8
|
+
*/
|
|
9
|
+
export interface Guardian<TID extends PlatformID = Uint8Array> {
|
|
10
|
+
/** Unique Guardian identifier */
|
|
11
|
+
readonly id: TID;
|
|
12
|
+
/** Human-readable name */
|
|
13
|
+
readonly name: string;
|
|
14
|
+
/** Guardian's share index (1 to n) */
|
|
15
|
+
readonly shareIndex: number;
|
|
16
|
+
/** Public verification key */
|
|
17
|
+
readonly verificationKey: Uint8Array;
|
|
18
|
+
/** Contact endpoint for ceremony notifications */
|
|
19
|
+
readonly contactEndpoint?: string;
|
|
20
|
+
/** Current availability status */
|
|
21
|
+
status: GuardianStatus;
|
|
22
|
+
/** Backup Guardian ID (if designated) */
|
|
23
|
+
readonly backupGuardianId?: TID;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=guardian.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"guardian.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/digitaldefiance-ecies-lib/src/lib/voting/threshold/interfaces/guardian.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AACrE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAEtE;;;;;GAKG;AACH,MAAM,WAAW,QAAQ,CAAC,GAAG,SAAS,UAAU,GAAG,UAAU;IAC3D,iCAAiC;IACjC,QAAQ,CAAC,EAAE,EAAE,GAAG,CAAC;IACjB,0BAA0B;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,sCAAsC;IACtC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,8BAA8B;IAC9B,QAAQ,CAAC,eAAe,EAAE,UAAU,CAAC;IACrC,kDAAkD;IAClD,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAClC,kCAAkC;IAClC,MAAM,EAAE,cAAc,CAAC;IACvB,yCAAyC;IACzC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,GAAG,CAAC;CACjC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"guardian.js","sourceRoot":"","sources":["../../../../../../../../packages/digitaldefiance-ecies-lib/src/lib/voting/threshold/interfaces/guardian.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Threshold voting interfaces export module.
|
|
3
|
+
*/
|
|
4
|
+
export type * from './key-share';
|
|
5
|
+
export type * from './threshold-key-config';
|
|
6
|
+
export type * from './threshold-key-pair';
|
|
7
|
+
export type * from './zk-proof';
|
|
8
|
+
export type * from './partial-decryption';
|
|
9
|
+
export type * from './combined-zk-proof';
|
|
10
|
+
export type * from './combined-decryption';
|
|
11
|
+
export type * from './guardian';
|
|
12
|
+
export type * from './guardian-status-change-event';
|
|
13
|
+
export type * from './interval-config';
|
|
14
|
+
export type * from './interval-trigger-event';
|
|
15
|
+
export type * from './ceremony';
|
|
16
|
+
export type * from './interval-tally';
|
|
17
|
+
export type * from './tally-subscription';
|
|
18
|
+
export type * from './verification-result';
|
|
19
|
+
export type * from './threshold-poll-config';
|
|
20
|
+
export type * from './threshold-audit-entry';
|
|
21
|
+
export type * from './threshold-key-generator';
|
|
22
|
+
export type * from './partial-decryption-service';
|
|
23
|
+
export type * from './decryption-combiner';
|
|
24
|
+
export type * from './guardian-registry';
|
|
25
|
+
export type * from './interval-scheduler';
|
|
26
|
+
export type * from './ceremony-coordinator';
|
|
27
|
+
export type * from './public-tally-feed';
|
|
28
|
+
export type * from './tally-verifier';
|
|
29
|
+
export type * from './threshold-poll';
|
|
30
|
+
export type * from './threshold-poll-factory';
|
|
31
|
+
export type * from './threshold-aggregator';
|
|
32
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/digitaldefiance-ecies-lib/src/lib/voting/threshold/interfaces/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,mBAAmB,aAAa,CAAC;AACjC,mBAAmB,wBAAwB,CAAC;AAC5C,mBAAmB,sBAAsB,CAAC;AAC1C,mBAAmB,YAAY,CAAC;AAChC,mBAAmB,sBAAsB,CAAC;AAC1C,mBAAmB,qBAAqB,CAAC;AACzC,mBAAmB,uBAAuB,CAAC;AAG3C,mBAAmB,YAAY,CAAC;AAChC,mBAAmB,gCAAgC,CAAC;AAGpD,mBAAmB,mBAAmB,CAAC;AACvC,mBAAmB,0BAA0B,CAAC;AAG9C,mBAAmB,YAAY,CAAC;AAGhC,mBAAmB,kBAAkB,CAAC;AACtC,mBAAmB,sBAAsB,CAAC;AAC1C,mBAAmB,uBAAuB,CAAC;AAG3C,mBAAmB,yBAAyB,CAAC;AAG7C,mBAAmB,yBAAyB,CAAC;AAG7C,mBAAmB,2BAA2B,CAAC;AAC/C,mBAAmB,8BAA8B,CAAC;AAClD,mBAAmB,uBAAuB,CAAC;AAC3C,mBAAmB,qBAAqB,CAAC;AACzC,mBAAmB,sBAAsB,CAAC;AAC1C,mBAAmB,wBAAwB,CAAC;AAC5C,mBAAmB,qBAAqB,CAAC;AACzC,mBAAmB,kBAAkB,CAAC;AACtC,mBAAmB,kBAAkB,CAAC;AACtC,mBAAmB,0BAA0B,CAAC;AAC9C,mBAAmB,wBAAwB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../packages/digitaldefiance-ecies-lib/src/lib/voting/threshold/interfaces/index.ts"],"names":[],"mappings":";AAAA;;GAEG"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { IntervalTriggerType } from '../enumerations/interval-trigger-type';
|
|
2
|
+
/**
|
|
3
|
+
* Configuration for interval decryption scheduling.
|
|
4
|
+
*/
|
|
5
|
+
export interface IntervalConfig {
|
|
6
|
+
/** Type of interval trigger */
|
|
7
|
+
readonly triggerType: IntervalTriggerType;
|
|
8
|
+
/** Time interval in milliseconds (for time-based/hybrid) */
|
|
9
|
+
readonly timeIntervalMs?: number;
|
|
10
|
+
/** Vote count interval (for vote-count-based/hybrid) */
|
|
11
|
+
readonly voteCountInterval?: number;
|
|
12
|
+
/** Minimum interval between ceremonies (rate limiting) */
|
|
13
|
+
readonly minimumIntervalMs: number;
|
|
14
|
+
/** Timeout for ceremony completion */
|
|
15
|
+
readonly ceremonyTimeoutMs: number;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=interval-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interval-config.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/digitaldefiance-ecies-lib/src/lib/voting/threshold/interfaces/interval-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAEjF;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,+BAA+B;IAC/B,QAAQ,CAAC,WAAW,EAAE,mBAAmB,CAAC;IAC1C,4DAA4D;IAC5D,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACjC,wDAAwD;IACxD,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IACpC,0DAA0D;IAC1D,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;IACnC,sCAAsC;IACtC,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;CACpC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interval-config.js","sourceRoot":"","sources":["../../../../../../../../packages/digitaldefiance-ecies-lib/src/lib/voting/threshold/interfaces/interval-config.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { PlatformID } from '../../../../interfaces/platform-id';
|
|
2
|
+
import type { IntervalConfig } from './interval-config';
|
|
3
|
+
import type { IntervalTriggerEvent } from './interval-trigger-event';
|
|
4
|
+
/**
|
|
5
|
+
* Interface for interval decryption scheduling.
|
|
6
|
+
*/
|
|
7
|
+
export interface IIntervalScheduler<TID extends PlatformID = Uint8Array> {
|
|
8
|
+
/** Configure interval scheduling for a poll */
|
|
9
|
+
configure(pollId: TID, config: IntervalConfig): void;
|
|
10
|
+
/** Start scheduling for a poll */
|
|
11
|
+
start(pollId: TID): void;
|
|
12
|
+
/** Stop scheduling for a poll */
|
|
13
|
+
stop(pollId: TID): void;
|
|
14
|
+
/** Notify of new vote (for vote-count triggers) */
|
|
15
|
+
notifyVote(pollId: TID): void;
|
|
16
|
+
/** Trigger final ceremony on poll close */
|
|
17
|
+
triggerFinal(pollId: TID): void;
|
|
18
|
+
/** Subscribe to interval trigger events */
|
|
19
|
+
onTrigger(callback: (event: IntervalTriggerEvent<TID>) => void): void;
|
|
20
|
+
/** Get current interval number for a poll */
|
|
21
|
+
getCurrentInterval(pollId: TID): number;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=interval-scheduler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interval-scheduler.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/digitaldefiance-ecies-lib/src/lib/voting/threshold/interfaces/interval-scheduler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AACrE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAErE;;GAEG;AACH,MAAM,WAAW,kBAAkB,CAAC,GAAG,SAAS,UAAU,GAAG,UAAU;IACrE,+CAA+C;IAC/C,SAAS,CAAC,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,cAAc,GAAG,IAAI,CAAC;IAErD,kCAAkC;IAClC,KAAK,CAAC,MAAM,EAAE,GAAG,GAAG,IAAI,CAAC;IAEzB,iCAAiC;IACjC,IAAI,CAAC,MAAM,EAAE,GAAG,GAAG,IAAI,CAAC;IAExB,mDAAmD;IACnD,UAAU,CAAC,MAAM,EAAE,GAAG,GAAG,IAAI,CAAC;IAE9B,2CAA2C;IAC3C,YAAY,CAAC,MAAM,EAAE,GAAG,GAAG,IAAI,CAAC;IAEhC,2CAA2C;IAC3C,SAAS,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,oBAAoB,CAAC,GAAG,CAAC,KAAK,IAAI,GAAG,IAAI,CAAC;IAEtE,6CAA6C;IAC7C,kBAAkB,CAAC,MAAM,EAAE,GAAG,GAAG,MAAM,CAAC;CACzC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interval-scheduler.js","sourceRoot":"","sources":["../../../../../../../../packages/digitaldefiance-ecies-lib/src/lib/voting/threshold/interfaces/interval-scheduler.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { PlatformID } from '../../../../interfaces/platform-id';
|
|
2
|
+
import type { CombinedZKProof } from './combined-zk-proof';
|
|
3
|
+
/**
|
|
4
|
+
* A published interval tally with cryptographic proof.
|
|
5
|
+
*
|
|
6
|
+
* Published to the public tally feed for real-time election results.
|
|
7
|
+
*/
|
|
8
|
+
export interface IntervalTally<TID extends PlatformID = Uint8Array> {
|
|
9
|
+
/** Associated poll ID */
|
|
10
|
+
readonly pollId: TID;
|
|
11
|
+
/** Interval number (0 = initial, -1 = final) */
|
|
12
|
+
readonly intervalNumber: number;
|
|
13
|
+
/** Decrypted tallies per choice */
|
|
14
|
+
readonly tallies: readonly bigint[];
|
|
15
|
+
/** Choice names */
|
|
16
|
+
readonly choices: readonly string[];
|
|
17
|
+
/** Total votes in this interval */
|
|
18
|
+
readonly voteCount: number;
|
|
19
|
+
/** Cumulative vote count */
|
|
20
|
+
readonly cumulativeVoteCount: number;
|
|
21
|
+
/** Combined ZK proof */
|
|
22
|
+
readonly proof: CombinedZKProof;
|
|
23
|
+
/** Participating Guardian indices */
|
|
24
|
+
readonly participatingGuardians: readonly number[];
|
|
25
|
+
/** Timestamp of decryption */
|
|
26
|
+
readonly timestamp: number;
|
|
27
|
+
/** Whether this is the final tally */
|
|
28
|
+
readonly isFinal: boolean;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=interval-tally.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interval-tally.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/digitaldefiance-ecies-lib/src/lib/voting/threshold/interfaces/interval-tally.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AACrE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE3D;;;;GAIG;AACH,MAAM,WAAW,aAAa,CAAC,GAAG,SAAS,UAAU,GAAG,UAAU;IAChE,yBAAyB;IACzB,QAAQ,CAAC,MAAM,EAAE,GAAG,CAAC;IACrB,gDAAgD;IAChD,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,mCAAmC;IACnC,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,mBAAmB;IACnB,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,mCAAmC;IACnC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,4BAA4B;IAC5B,QAAQ,CAAC,mBAAmB,EAAE,MAAM,CAAC;IACrC,wBAAwB;IACxB,QAAQ,CAAC,KAAK,EAAE,eAAe,CAAC;IAChC,qCAAqC;IACrC,QAAQ,CAAC,sBAAsB,EAAE,SAAS,MAAM,EAAE,CAAC;IACnD,8BAA8B;IAC9B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,sCAAsC;IACtC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;CAC3B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interval-tally.js","sourceRoot":"","sources":["../../../../../../../../packages/digitaldefiance-ecies-lib/src/lib/voting/threshold/interfaces/interval-tally.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { PlatformID } from '../../../../interfaces/platform-id';
|
|
2
|
+
import type { IntervalTriggerType } from '../enumerations/interval-trigger-type';
|
|
3
|
+
/**
|
|
4
|
+
* Event emitted when an interval trigger fires.
|
|
5
|
+
*/
|
|
6
|
+
export interface IntervalTriggerEvent<TID extends PlatformID = Uint8Array> {
|
|
7
|
+
/** Poll ID */
|
|
8
|
+
readonly pollId: TID;
|
|
9
|
+
/** Interval number (sequential) */
|
|
10
|
+
readonly intervalNumber: number;
|
|
11
|
+
/** Type of trigger that fired */
|
|
12
|
+
readonly triggerType: IntervalTriggerType;
|
|
13
|
+
/** Reason for the trigger */
|
|
14
|
+
readonly triggerReason: 'time' | 'vote-count' | 'poll-close';
|
|
15
|
+
/** Current vote count at trigger time */
|
|
16
|
+
readonly currentVoteCount: number;
|
|
17
|
+
/** Timestamp of the trigger */
|
|
18
|
+
readonly timestamp: number;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=interval-trigger-event.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interval-trigger-event.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/digitaldefiance-ecies-lib/src/lib/voting/threshold/interfaces/interval-trigger-event.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AACrE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAEjF;;GAEG;AACH,MAAM,WAAW,oBAAoB,CAAC,GAAG,SAAS,UAAU,GAAG,UAAU;IACvE,cAAc;IACd,QAAQ,CAAC,MAAM,EAAE,GAAG,CAAC;IACrB,mCAAmC;IACnC,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,iCAAiC;IACjC,QAAQ,CAAC,WAAW,EAAE,mBAAmB,CAAC;IAC1C,6BAA6B;IAC7B,QAAQ,CAAC,aAAa,EAAE,MAAM,GAAG,YAAY,GAAG,YAAY,CAAC;IAC7D,yCAAyC;IACzC,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,+BAA+B;IAC/B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B"}
|