@digitaldefiance/ecies-lib 4.8.7 → 4.9.1
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 +8 -8
- package/src/builders/member-builder.d.ts +1 -2
- package/src/builders/member-builder.d.ts.map +1 -1
- package/src/builders/member-builder.js.map +1 -1
- package/src/constants.d.ts +1 -1
- package/src/constants.d.ts.map +1 -1
- package/src/constants.js +2 -0
- package/src/constants.js.map +1 -1
- package/src/interfaces/constants.d.ts +1 -1
- package/src/interfaces/constants.d.ts.map +1 -1
- package/src/interfaces/ecies-consts.d.ts +1 -0
- package/src/interfaces/ecies-consts.d.ts.map +1 -1
- package/src/interfaces/index.d.ts +2 -4
- package/src/interfaces/index.d.ts.map +1 -1
- package/src/interfaces/index.js +2 -5
- package/src/interfaces/index.js.map +1 -1
- package/src/interfaces/isolated-private-key-async.d.ts +13 -0
- package/src/interfaces/isolated-private-key-async.d.ts.map +1 -0
- package/src/interfaces/isolated-private-key-async.js +3 -0
- package/src/interfaces/isolated-private-key-async.js.map +1 -0
- package/src/interfaces/isolated-public-key-async.d.ts +17 -0
- package/src/interfaces/isolated-public-key-async.d.ts.map +1 -0
- package/src/interfaces/isolated-public-key-async.js +3 -0
- package/src/interfaces/isolated-public-key-async.js.map +1 -0
- package/src/interfaces/platform-buffer.d.ts +5 -5
- package/src/interfaces/platform-buffer.d.ts.map +1 -1
- package/src/interfaces/voting-service.d.ts +0 -111
- package/src/interfaces/voting-service.d.ts.map +1 -1
- package/src/interfaces/voting-service.js +0 -7
- package/src/interfaces/voting-service.js.map +1 -1
- package/src/lib/id-providers/index.d.ts +1 -0
- package/src/lib/id-providers/index.d.ts.map +1 -1
- package/src/lib/id-providers/index.js +3 -1
- package/src/lib/id-providers/index.js.map +1 -1
- package/src/lib/id-providers/uint8array-provider.d.ts +54 -0
- package/src/lib/id-providers/uint8array-provider.d.ts.map +1 -0
- package/src/lib/id-providers/uint8array-provider.js +97 -0
- package/src/lib/id-providers/uint8array-provider.js.map +1 -0
- package/src/lib/voting/audit.d.ts +4 -38
- package/src/lib/voting/audit.d.ts.map +1 -1
- package/src/lib/voting/audit.js +8 -10
- package/src/lib/voting/audit.js.map +1 -1
- package/src/lib/voting/bulletin-board.d.ts +4 -56
- package/src/lib/voting/bulletin-board.d.ts.map +1 -1
- package/src/lib/voting/bulletin-board.js.map +1 -1
- package/src/lib/voting/encoder.d.ts +2 -1
- package/src/lib/voting/encoder.d.ts.map +1 -1
- package/src/lib/voting/encoder.js +9 -9
- package/src/lib/voting/encoder.js.map +1 -1
- package/src/lib/voting/enumerations/audit-event-type.d.ts +6 -0
- package/src/lib/voting/enumerations/audit-event-type.d.ts.map +1 -0
- package/src/lib/voting/enumerations/audit-event-type.js +10 -0
- package/src/lib/voting/enumerations/audit-event-type.js.map +1 -0
- package/src/lib/voting/enumerations/event-type.d.ts +9 -0
- package/src/lib/voting/enumerations/event-type.d.ts.map +1 -0
- package/src/lib/voting/enumerations/event-type.js +13 -0
- package/src/lib/voting/enumerations/event-type.js.map +1 -0
- package/src/lib/voting/enumerations/index.d.ts +6 -0
- package/src/lib/voting/enumerations/index.d.ts.map +1 -0
- package/src/lib/voting/enumerations/index.js +9 -0
- package/src/lib/voting/enumerations/index.js.map +1 -0
- package/src/lib/voting/enumerations/jurisdictional-level.d.ts +7 -0
- package/src/lib/voting/enumerations/jurisdictional-level.d.ts.map +1 -0
- package/src/lib/voting/enumerations/jurisdictional-level.js +11 -0
- package/src/lib/voting/enumerations/jurisdictional-level.js.map +1 -0
- package/src/lib/voting/enumerations/security-level.d.ts +6 -0
- package/src/lib/voting/enumerations/security-level.d.ts.map +1 -0
- package/src/lib/voting/enumerations/security-level.js +10 -0
- package/src/lib/voting/enumerations/security-level.js.map +1 -0
- package/src/lib/voting/enumerations/voting-method.d.ts +41 -0
- package/src/lib/voting/enumerations/voting-method.d.ts.map +1 -0
- package/src/lib/voting/{types.js → enumerations/voting-method.js} +1 -1
- package/src/lib/voting/enumerations/voting-method.js.map +1 -0
- package/src/lib/voting/event-logger.d.ts +14 -65
- package/src/lib/voting/event-logger.d.ts.map +1 -1
- package/src/lib/voting/event-logger.js +32 -19
- package/src/lib/voting/event-logger.js.map +1 -1
- package/src/lib/voting/factory.d.ts +2 -2
- package/src/lib/voting/factory.d.ts.map +1 -1
- package/src/lib/voting/factory.js +6 -6
- package/src/lib/voting/factory.js.map +1 -1
- package/src/lib/voting/hierarchical-aggregator.d.ts +72 -0
- package/src/lib/voting/hierarchical-aggregator.d.ts.map +1 -0
- package/src/lib/voting/hierarchical-aggregator.js +234 -0
- package/src/lib/voting/hierarchical-aggregator.js.map +1 -0
- package/src/lib/voting/index.d.ts +8 -5
- package/src/lib/voting/index.d.ts.map +1 -1
- package/src/lib/voting/index.js +12 -7
- package/src/lib/voting/index.js.map +1 -1
- package/src/lib/voting/interfaces/aggregated-tally.d.ts +11 -0
- package/src/lib/voting/interfaces/aggregated-tally.d.ts.map +1 -0
- package/src/{interfaces/member-with-mnemonic.js → lib/voting/interfaces/aggregated-tally.js} +1 -1
- package/src/lib/voting/interfaces/aggregated-tally.js.map +1 -0
- package/src/lib/voting/interfaces/audit-entry.d.ts +25 -0
- package/src/lib/voting/interfaces/audit-entry.d.ts.map +1 -0
- package/src/lib/voting/interfaces/audit-entry.js +3 -0
- package/src/lib/voting/interfaces/audit-entry.js.map +1 -0
- package/src/lib/voting/interfaces/audit-log.d.ts +13 -0
- package/src/lib/voting/interfaces/audit-log.d.ts.map +1 -0
- package/src/lib/voting/interfaces/audit-log.js +3 -0
- package/src/lib/voting/interfaces/audit-log.js.map +1 -0
- package/src/lib/voting/interfaces/bulletin-board-entry.d.ts +20 -0
- package/src/lib/voting/interfaces/bulletin-board-entry.d.ts.map +1 -0
- package/src/lib/voting/interfaces/bulletin-board-entry.js +3 -0
- package/src/lib/voting/interfaces/bulletin-board-entry.js.map +1 -0
- package/src/lib/voting/interfaces/bulletin-board.d.ts +24 -0
- package/src/lib/voting/interfaces/bulletin-board.d.ts.map +1 -0
- package/src/lib/voting/interfaces/bulletin-board.js +3 -0
- package/src/lib/voting/interfaces/bulletin-board.js.map +1 -0
- package/src/lib/voting/interfaces/checkpoint-manager-extended.d.ts +14 -0
- package/src/lib/voting/interfaces/checkpoint-manager-extended.d.ts.map +1 -0
- package/src/lib/voting/interfaces/checkpoint-manager-extended.js +3 -0
- package/src/lib/voting/interfaces/checkpoint-manager-extended.js.map +1 -0
- package/src/lib/voting/interfaces/checkpoint-manager.d.ts +8 -0
- package/src/lib/voting/interfaces/checkpoint-manager.d.ts.map +1 -0
- package/src/lib/voting/interfaces/checkpoint-manager.js +3 -0
- package/src/lib/voting/interfaces/checkpoint-manager.js.map +1 -0
- package/src/lib/voting/interfaces/checkpoint-metadata.d.ts +9 -0
- package/src/lib/voting/interfaces/checkpoint-metadata.d.ts.map +1 -0
- package/src/lib/voting/interfaces/checkpoint-metadata.js +3 -0
- package/src/lib/voting/interfaces/checkpoint-metadata.js.map +1 -0
- package/src/lib/voting/interfaces/ecies-service-with-voting.d.ts +55 -0
- package/src/lib/voting/interfaces/ecies-service-with-voting.d.ts.map +1 -0
- package/src/lib/voting/interfaces/ecies-service-with-voting.js +3 -0
- package/src/lib/voting/interfaces/ecies-service-with-voting.js.map +1 -0
- package/src/lib/voting/interfaces/encrypted-vote.d.ts +23 -0
- package/src/lib/voting/interfaces/encrypted-vote.d.ts.map +1 -0
- package/src/lib/voting/interfaces/encrypted-vote.js +3 -0
- package/src/lib/voting/interfaces/encrypted-vote.js.map +1 -0
- package/src/lib/voting/interfaces/event-log-entry.d.ts +24 -0
- package/src/lib/voting/interfaces/event-log-entry.d.ts.map +1 -0
- package/src/lib/voting/interfaces/event-log-entry.js +3 -0
- package/src/lib/voting/interfaces/event-log-entry.js.map +1 -0
- package/src/lib/voting/interfaces/event-logger.d.ts +25 -0
- package/src/lib/voting/interfaces/event-logger.d.ts.map +1 -0
- package/src/lib/voting/interfaces/event-logger.js +3 -0
- package/src/lib/voting/interfaces/event-logger.js.map +1 -0
- package/src/lib/voting/interfaces/index.d.ts +31 -0
- package/src/lib/voting/interfaces/index.d.ts.map +1 -0
- package/src/lib/voting/interfaces/index.js +5 -0
- package/src/lib/voting/interfaces/index.js.map +1 -0
- package/src/lib/voting/interfaces/jurisdiction-config.d.ts +9 -0
- package/src/lib/voting/interfaces/jurisdiction-config.d.ts.map +1 -0
- package/src/lib/voting/interfaces/jurisdiction-config.js +3 -0
- package/src/lib/voting/interfaces/jurisdiction-config.js.map +1 -0
- package/src/lib/voting/interfaces/plaintext-vote.d.ts +18 -0
- package/src/lib/voting/interfaces/plaintext-vote.d.ts.map +1 -0
- package/src/lib/voting/interfaces/plaintext-vote.js +3 -0
- package/src/lib/voting/interfaces/plaintext-vote.js.map +1 -0
- package/src/lib/voting/interfaces/poll-configuration.d.ts +10 -0
- package/src/lib/voting/interfaces/poll-configuration.d.ts.map +1 -0
- package/src/lib/voting/interfaces/poll-configuration.js +3 -0
- package/src/lib/voting/interfaces/poll-configuration.js.map +1 -0
- package/src/lib/voting/interfaces/poll-results.d.ts +25 -0
- package/src/lib/voting/interfaces/poll-results.d.ts.map +1 -0
- package/src/lib/voting/interfaces/poll-results.js +3 -0
- package/src/lib/voting/interfaces/poll-results.js.map +1 -0
- package/src/lib/voting/interfaces/poll-tallier.d.ts +18 -0
- package/src/lib/voting/interfaces/poll-tallier.d.ts.map +1 -0
- package/src/lib/voting/interfaces/poll-tallier.js +3 -0
- package/src/lib/voting/interfaces/poll-tallier.js.map +1 -0
- package/src/lib/voting/interfaces/poll.d.ts +41 -0
- package/src/lib/voting/interfaces/poll.d.ts.map +1 -0
- package/src/lib/voting/interfaces/poll.js +3 -0
- package/src/lib/voting/interfaces/poll.js.map +1 -0
- package/src/lib/voting/interfaces/round-result.d.ts +15 -0
- package/src/lib/voting/interfaces/round-result.d.ts.map +1 -0
- package/src/lib/voting/interfaces/round-result.js +3 -0
- package/src/lib/voting/interfaces/round-result.js.map +1 -0
- package/src/lib/voting/interfaces/state-snapshot.d.ts +9 -0
- package/src/lib/voting/interfaces/state-snapshot.d.ts.map +1 -0
- package/src/lib/voting/interfaces/state-snapshot.js +3 -0
- package/src/lib/voting/interfaces/state-snapshot.js.map +1 -0
- package/src/lib/voting/interfaces/supermajority-config.d.ts +11 -0
- package/src/lib/voting/interfaces/supermajority-config.d.ts.map +1 -0
- package/src/lib/voting/interfaces/supermajority-config.js +3 -0
- package/src/lib/voting/interfaces/supermajority-config.js.map +1 -0
- package/src/lib/voting/interfaces/tally-proof.d.ts +18 -0
- package/src/lib/voting/interfaces/tally-proof.d.ts.map +1 -0
- package/src/lib/voting/interfaces/tally-proof.js +3 -0
- package/src/lib/voting/interfaces/tally-proof.js.map +1 -0
- package/src/lib/voting/interfaces/vote-encoder.d.ts +59 -0
- package/src/lib/voting/interfaces/vote-encoder.d.ts.map +1 -0
- package/src/lib/voting/interfaces/vote-encoder.js +3 -0
- package/src/lib/voting/interfaces/vote-encoder.js.map +1 -0
- package/src/lib/voting/interfaces/vote-logger-extended.d.ts +15 -0
- package/src/lib/voting/interfaces/vote-logger-extended.d.ts.map +1 -0
- package/src/lib/voting/interfaces/vote-logger-extended.js +3 -0
- package/src/lib/voting/interfaces/vote-logger-extended.js.map +1 -0
- package/src/lib/voting/interfaces/vote-logger.d.ts +11 -0
- package/src/lib/voting/interfaces/vote-logger.d.ts.map +1 -0
- package/src/lib/voting/interfaces/vote-logger.js +3 -0
- package/src/lib/voting/interfaces/vote-logger.js.map +1 -0
- package/src/lib/voting/interfaces/voting-consts.d.ts.map +1 -0
- package/src/lib/voting/interfaces/voting-consts.js.map +1 -0
- package/src/lib/voting/interfaces/voting-key-derivation-options.d.ts +26 -0
- package/src/lib/voting/interfaces/voting-key-derivation-options.d.ts.map +1 -0
- package/src/lib/voting/interfaces/voting-key-derivation-options.js +3 -0
- package/src/lib/voting/interfaces/voting-key-derivation-options.js.map +1 -0
- package/src/lib/voting/interfaces/voting-poll-results.d.ts +20 -0
- package/src/lib/voting/interfaces/voting-poll-results.d.ts.map +1 -0
- package/src/lib/voting/interfaces/voting-poll-results.js +3 -0
- package/src/lib/voting/interfaces/voting-poll-results.js.map +1 -0
- package/src/lib/voting/interfaces/voting-receipt.d.ts +18 -0
- package/src/lib/voting/interfaces/voting-receipt.d.ts.map +1 -0
- package/src/lib/voting/interfaces/voting-receipt.js +3 -0
- package/src/lib/voting/interfaces/voting-receipt.js.map +1 -0
- package/src/lib/voting/interfaces/voting-security-validator.d.ts +37 -0
- package/src/lib/voting/interfaces/voting-security-validator.d.ts.map +1 -0
- package/src/lib/voting/interfaces/voting-security-validator.js +3 -0
- package/src/lib/voting/interfaces/voting-security-validator.js.map +1 -0
- package/src/lib/voting/persistent-state.d.ts +21 -0
- package/src/lib/voting/persistent-state.d.ts.map +1 -0
- package/src/lib/voting/persistent-state.js +32 -0
- package/src/lib/voting/persistent-state.js.map +1 -0
- package/src/lib/voting/poll-core.d.ts +3 -3
- package/src/lib/voting/poll-core.d.ts.map +1 -1
- package/src/lib/voting/poll-core.js +6 -7
- package/src/lib/voting/poll-core.js.map +1 -1
- package/src/lib/voting/security.d.ts +2 -6
- package/src/lib/voting/security.d.ts.map +1 -1
- package/src/lib/voting/security.js +25 -28
- package/src/lib/voting/security.js.map +1 -1
- package/src/lib/voting/tallier.d.ts +5 -5
- package/src/lib/voting/tallier.d.ts.map +1 -1
- package/src/lib/voting/tallier.js +26 -26
- package/src/lib/voting/tallier.js.map +1 -1
- package/src/lib/voting/test-voter-pool.d.ts +16 -0
- package/src/lib/voting/test-voter-pool.d.ts.map +1 -0
- package/src/lib/voting/test-voter-pool.js +65 -0
- package/src/lib/voting/test-voter-pool.js.map +1 -0
- package/src/member.d.ts +8 -1
- package/src/member.d.ts.map +1 -1
- package/src/member.js +6 -6
- package/src/member.js.map +1 -1
- package/src/services/ecies/interfaces/decryption-result.d.ts +5 -0
- package/src/services/ecies/interfaces/decryption-result.d.ts.map +1 -0
- package/src/services/ecies/interfaces/decryption-result.js +3 -0
- package/src/services/ecies/interfaces/decryption-result.js.map +1 -0
- package/src/services/ecies/interfaces/encryption-result.d.ts +7 -0
- package/src/services/ecies/interfaces/encryption-result.d.ts.map +1 -0
- package/src/services/ecies/interfaces/encryption-result.js +3 -0
- package/src/services/ecies/interfaces/encryption-result.js.map +1 -0
- package/src/services/ecies/interfaces/index.d.ts +9 -0
- package/src/services/ecies/interfaces/index.d.ts.map +1 -0
- package/src/services/ecies/interfaces/index.js +3 -0
- package/src/services/ecies/interfaces/index.js.map +1 -0
- package/src/services/ecies/interfaces/multi-encrypted-message.d.ts +11 -0
- package/src/services/ecies/interfaces/multi-encrypted-message.d.ts.map +1 -0
- package/src/services/ecies/interfaces/multi-encrypted-message.js +3 -0
- package/src/services/ecies/interfaces/multi-encrypted-message.js.map +1 -0
- package/src/services/ecies/interfaces/multi-encrypted-parsed-header.d.ts +10 -0
- package/src/services/ecies/interfaces/multi-encrypted-parsed-header.d.ts.map +1 -0
- package/src/services/ecies/interfaces/multi-encrypted-parsed-header.js +3 -0
- package/src/services/ecies/interfaces/multi-encrypted-parsed-header.js.map +1 -0
- package/src/services/ecies/interfaces/multi-recipient.d.ts +6 -0
- package/src/services/ecies/interfaces/multi-recipient.d.ts.map +1 -0
- package/src/services/ecies/interfaces/multi-recipient.js +3 -0
- package/src/services/ecies/interfaces/multi-recipient.js.map +1 -0
- package/src/services/ecies/interfaces/simple-keypair.d.ts +5 -0
- package/src/services/ecies/interfaces/simple-keypair.d.ts.map +1 -0
- package/src/services/ecies/interfaces/simple-keypair.js +3 -0
- package/src/services/ecies/interfaces/simple-keypair.js.map +1 -0
- package/src/services/ecies/interfaces/single-encrypted-parsed-header.d.ts +11 -0
- package/src/services/ecies/interfaces/single-encrypted-parsed-header.d.ts.map +1 -0
- package/src/services/ecies/interfaces/single-encrypted-parsed-header.js +3 -0
- package/src/services/ecies/interfaces/single-encrypted-parsed-header.js.map +1 -0
- package/src/services/ecies/interfaces/wallet-seed.d.ts +6 -0
- package/src/services/ecies/interfaces/wallet-seed.d.ts.map +1 -0
- package/src/services/ecies/interfaces/wallet-seed.js +3 -0
- package/src/services/ecies/interfaces/wallet-seed.js.map +1 -0
- package/src/services/ecies/multi-recipient.d.ts.map +1 -1
- package/src/services/ecies/multi-recipient.js +14 -5
- package/src/services/ecies/multi-recipient.js.map +1 -1
- package/src/interfaces/member-with-mnemonic.d.ts +0 -8
- package/src/interfaces/member-with-mnemonic.d.ts.map +0 -1
- package/src/interfaces/member-with-mnemonic.js.map +0 -1
- package/src/interfaces/voting-consts.d.ts.map +0 -1
- package/src/interfaces/voting-consts.js.map +0 -1
- package/src/interfaces/voting-poll.d.ts +0 -455
- package/src/interfaces/voting-poll.d.ts.map +0 -1
- package/src/interfaces/voting-poll.js +0 -54
- package/src/interfaces/voting-poll.js.map +0 -1
- package/src/lib/voting/poll.d.ts +0 -125
- package/src/lib/voting/poll.d.ts.map +0 -1
- package/src/lib/voting/poll.js +0 -323
- package/src/lib/voting/poll.js.map +0 -1
- package/src/lib/voting/types.d.ts +0 -146
- package/src/lib/voting/types.d.ts.map +0 -1
- package/src/lib/voting/types.js.map +0 -1
- package/src/services/ecies/interfaces.d.ts +0 -55
- package/src/services/ecies/interfaces.d.ts.map +0 -1
- package/src/services/ecies/interfaces.js +0 -6
- package/src/services/ecies/interfaces.js.map +0 -1
- /package/src/{interfaces → lib/voting/interfaces}/voting-consts.d.ts +0 -0
- /package/src/{interfaces → lib/voting/interfaces}/voting-consts.js +0 -0
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { KeyPair, PrivateKey, PublicKey } from 'paillier-bigint';
|
|
2
|
+
import type { PlatformBuffer } from '../../../interfaces/platform-buffer.js';
|
|
3
|
+
import { IVotingKeyDerivationOptions } from './voting-key-derivation-options.js';
|
|
4
|
+
/**
|
|
5
|
+
* Integrated ECIES service with voting support.
|
|
6
|
+
* Provides access to voting key derivation and serialization.
|
|
7
|
+
*/
|
|
8
|
+
export interface IECIESServiceWithVoting {
|
|
9
|
+
/** Voting service accessor */
|
|
10
|
+
readonly voting: {
|
|
11
|
+
/**
|
|
12
|
+
* Derive Paillier voting keys from ECDH key pair.
|
|
13
|
+
* @param ecdhPrivateKey - ECDH private key
|
|
14
|
+
* @param ecdhPublicKey - ECDH public key
|
|
15
|
+
* @param options - Derivation options
|
|
16
|
+
* @returns Paillier key pair
|
|
17
|
+
*/
|
|
18
|
+
deriveVotingKeysFromECDH(ecdhPrivateKey: PlatformBuffer, ecdhPublicKey: PlatformBuffer, options?: IVotingKeyDerivationOptions): Promise<KeyPair>;
|
|
19
|
+
/**
|
|
20
|
+
* Generate deterministic key pair from seed.
|
|
21
|
+
* WARNING: For testing only!
|
|
22
|
+
* @param seed - Random seed (min 32 bytes)
|
|
23
|
+
* @param bitLength - Key bit length
|
|
24
|
+
* @param iterations - Prime test iterations
|
|
25
|
+
* @returns Paillier key pair
|
|
26
|
+
*/
|
|
27
|
+
generateDeterministicKeyPair(seed: PlatformBuffer, bitLength?: number, iterations?: number): Promise<KeyPair>;
|
|
28
|
+
/**
|
|
29
|
+
* Serialize public key to buffer.
|
|
30
|
+
* @param publicKey - Public key
|
|
31
|
+
* @returns Serialized buffer
|
|
32
|
+
*/
|
|
33
|
+
votingPublicKeyToBuffer(publicKey: PublicKey): PlatformBuffer | Promise<PlatformBuffer>;
|
|
34
|
+
/**
|
|
35
|
+
* Deserialize public key from buffer.
|
|
36
|
+
* @param buffer - Serialized buffer
|
|
37
|
+
* @returns Public key
|
|
38
|
+
*/
|
|
39
|
+
bufferToVotingPublicKey(buffer: PlatformBuffer): Promise<PublicKey>;
|
|
40
|
+
/**
|
|
41
|
+
* Serialize private key to buffer.
|
|
42
|
+
* @param privateKey - Private key
|
|
43
|
+
* @returns Serialized buffer
|
|
44
|
+
*/
|
|
45
|
+
votingPrivateKeyToBuffer(privateKey: PrivateKey): PlatformBuffer;
|
|
46
|
+
/**
|
|
47
|
+
* Deserialize private key from buffer.
|
|
48
|
+
* @param buffer - Serialized buffer
|
|
49
|
+
* @param publicKey - Corresponding public key
|
|
50
|
+
* @returns Private key
|
|
51
|
+
*/
|
|
52
|
+
bufferToVotingPrivateKey(buffer: PlatformBuffer, publicKey: PublicKey): Promise<PrivateKey>;
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=ecies-service-with-voting.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ecies-service-with-voting.d.ts","sourceRoot":"","sources":["../../../../../../../packages/digitaldefiance-ecies-lib/src/lib/voting/interfaces/ecies-service-with-voting.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AAC7E,OAAO,EAAE,2BAA2B,EAAE,MAAM,oCAAoC,CAAC;AAEjF;;;GAGG;AACH,MAAM,WAAW,uBAAuB;IACtC,8BAA8B;IAC9B,QAAQ,CAAC,MAAM,EAAE;QACf;;;;;;WAMG;QACH,wBAAwB,CACtB,cAAc,EAAE,cAAc,EAC9B,aAAa,EAAE,cAAc,EAC7B,OAAO,CAAC,EAAE,2BAA2B,GACpC,OAAO,CAAC,OAAO,CAAC,CAAC;QAEpB;;;;;;;WAOG;QACH,4BAA4B,CAC1B,IAAI,EAAE,cAAc,EACpB,SAAS,CAAC,EAAE,MAAM,EAClB,UAAU,CAAC,EAAE,MAAM,GAClB,OAAO,CAAC,OAAO,CAAC,CAAC;QAEpB;;;;WAIG;QACH,uBAAuB,CACrB,SAAS,EAAE,SAAS,GACnB,cAAc,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;QAC5C;;;;WAIG;QACH,uBAAuB,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;QACpE;;;;WAIG;QACH,wBAAwB,CAAC,UAAU,EAAE,UAAU,GAAG,cAAc,CAAC;QACjE;;;;;WAKG;QACH,wBAAwB,CACtB,MAAM,EAAE,cAAc,EACtB,SAAS,EAAE,SAAS,GACnB,OAAO,CAAC,UAAU,CAAC,CAAC;KACxB,CAAC;CACH"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ecies-service-with-voting.js","sourceRoot":"","sources":["../../../../../../../packages/digitaldefiance-ecies-lib/src/lib/voting/interfaces/ecies-service-with-voting.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { PlatformID } from '../../../interfaces';
|
|
2
|
+
import { PlaintextVote } from './plaintext-vote';
|
|
3
|
+
/**
|
|
4
|
+
* Encrypted vote data using Paillier homomorphic encryption.
|
|
5
|
+
* Structure varies by voting method.
|
|
6
|
+
*/
|
|
7
|
+
export interface EncryptedVote<TID extends PlatformID = Uint8Array> {
|
|
8
|
+
/** Single choice index (for Plurality, Weighted, etc.) */
|
|
9
|
+
choiceIndex?: number;
|
|
10
|
+
/** Multiple choice indices (for Approval voting) */
|
|
11
|
+
choices?: number[];
|
|
12
|
+
/** Ranked choice indices in preference order (for RCV, Borda) */
|
|
13
|
+
rankings?: number[];
|
|
14
|
+
/** Vote weight (for Weighted voting) */
|
|
15
|
+
weight?: bigint;
|
|
16
|
+
/** Score value 0-10 (for Score voting) */
|
|
17
|
+
score?: number;
|
|
18
|
+
/** Array of encrypted vote values (one per choice) */
|
|
19
|
+
encrypted: bigint[];
|
|
20
|
+
/** Plaintext vote data (only for insecure methods) */
|
|
21
|
+
plaintext?: PlaintextVote<TID>;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=encrypted-vote.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"encrypted-vote.d.ts","sourceRoot":"","sources":["../../../../../../../packages/digitaldefiance-ecies-lib/src/lib/voting/interfaces/encrypted-vote.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD;;;GAGG;AACH,MAAM,WAAW,aAAa,CAAC,GAAG,SAAS,UAAU,GAAG,UAAU;IAChE,0DAA0D;IAC1D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,oDAAoD;IACpD,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,iEAAiE;IACjE,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,wCAAwC;IACxC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,0CAA0C;IAC1C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,sDAAsD;IACtD,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,sDAAsD;IACtD,SAAS,CAAC,EAAE,aAAa,CAAC,GAAG,CAAC,CAAC;CAChC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"encrypted-vote.js","sourceRoot":"","sources":["../../../../../../../packages/digitaldefiance-ecies-lib/src/lib/voting/interfaces/encrypted-vote.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { PlatformID } from '../../../interfaces';
|
|
2
|
+
import { EventType } from '../enumerations/event-type';
|
|
3
|
+
import { PollConfiguration } from './poll-configuration';
|
|
4
|
+
export interface EventLogEntry<TID extends PlatformID = Uint8Array> {
|
|
5
|
+
/** Sequence number (monotonically increasing) */
|
|
6
|
+
readonly sequence: number;
|
|
7
|
+
/** Event type */
|
|
8
|
+
readonly eventType: EventType;
|
|
9
|
+
/** Microsecond-precision timestamp */
|
|
10
|
+
readonly timestamp: number;
|
|
11
|
+
/** Poll identifier */
|
|
12
|
+
readonly pollId: TID;
|
|
13
|
+
/** Creator/authority ID (for creation/closure events) */
|
|
14
|
+
readonly creatorId?: TID;
|
|
15
|
+
/** Anonymized voter token (for vote events) */
|
|
16
|
+
readonly voterToken?: Uint8Array;
|
|
17
|
+
/** Poll configuration (for creation events) */
|
|
18
|
+
readonly configuration?: PollConfiguration;
|
|
19
|
+
/** Final tally hash (for closure events) */
|
|
20
|
+
readonly tallyHash?: Uint8Array;
|
|
21
|
+
/** Additional metadata */
|
|
22
|
+
readonly metadata?: Record<string, unknown>;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=event-log-entry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-log-entry.d.ts","sourceRoot":"","sources":["../../../../../../../packages/digitaldefiance-ecies-lib/src/lib/voting/interfaces/event-log-entry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,MAAM,WAAW,aAAa,CAAC,GAAG,SAAS,UAAU,GAAG,UAAU;IAChE,iDAAiD;IACjD,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,iBAAiB;IACjB,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;IAC9B,sCAAsC;IACtC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,sBAAsB;IACtB,QAAQ,CAAC,MAAM,EAAE,GAAG,CAAC;IACrB,yDAAyD;IACzD,QAAQ,CAAC,SAAS,CAAC,EAAE,GAAG,CAAC;IACzB,+CAA+C;IAC/C,QAAQ,CAAC,UAAU,CAAC,EAAE,UAAU,CAAC;IACjC,+CAA+C;IAC/C,QAAQ,CAAC,aAAa,CAAC,EAAE,iBAAiB,CAAC;IAC3C,4CAA4C;IAC5C,QAAQ,CAAC,SAAS,CAAC,EAAE,UAAU,CAAC;IAChC,0BAA0B;IAC1B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC7C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-log-entry.js","sourceRoot":"","sources":["../../../../../../../packages/digitaldefiance-ecies-lib/src/lib/voting/interfaces/event-log-entry.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { PlatformID } from '../../../interfaces';
|
|
2
|
+
import { EventType } from '../enumerations/event-type';
|
|
3
|
+
import { EventLogEntry } from './event-log-entry';
|
|
4
|
+
import { PollConfiguration } from './poll-configuration';
|
|
5
|
+
export interface EventLogger<TID extends PlatformID = Uint8Array> {
|
|
6
|
+
/** Log poll creation event */
|
|
7
|
+
logPollCreated(pollId: TID, creatorId: TID, configuration: PollConfiguration): EventLogEntry<TID>;
|
|
8
|
+
/** Log vote cast event */
|
|
9
|
+
logVoteCast(pollId: TID, voterToken: Uint8Array, metadata?: Record<string, unknown>): EventLogEntry<TID>;
|
|
10
|
+
/** Log poll closure event */
|
|
11
|
+
logPollClosed(pollId: TID, tallyHash: Uint8Array, metadata?: Record<string, unknown>): EventLogEntry<TID>;
|
|
12
|
+
/** Log generic event */
|
|
13
|
+
logEvent(eventType: EventType, pollId: TID, data?: Partial<Omit<EventLogEntry<TID>, 'sequence' | 'timestamp' | 'eventType' | 'pollId'>>): EventLogEntry<TID>;
|
|
14
|
+
/** Get all events */
|
|
15
|
+
getEvents(): readonly EventLogEntry<TID>[];
|
|
16
|
+
/** Get events for specific poll */
|
|
17
|
+
getEventsForPoll(pollId: TID): readonly EventLogEntry<TID>[];
|
|
18
|
+
/** Get events by type */
|
|
19
|
+
getEventsByType(eventType: EventType): readonly EventLogEntry<TID>[];
|
|
20
|
+
/** Verify sequence integrity */
|
|
21
|
+
verifySequence(): boolean;
|
|
22
|
+
/** Export events for archival */
|
|
23
|
+
export(): Uint8Array;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=event-logger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-logger.d.ts","sourceRoot":"","sources":["../../../../../../../packages/digitaldefiance-ecies-lib/src/lib/voting/interfaces/event-logger.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,MAAM,WAAW,WAAW,CAAC,GAAG,SAAS,UAAU,GAAG,UAAU;IAC9D,8BAA8B;IAC9B,cAAc,CACZ,MAAM,EAAE,GAAG,EACX,SAAS,EAAE,GAAG,EACd,aAAa,EAAE,iBAAiB,GAC/B,aAAa,CAAC,GAAG,CAAC,CAAC;IAEtB,0BAA0B;IAC1B,WAAW,CACT,MAAM,EAAE,GAAG,EACX,UAAU,EAAE,UAAU,EACtB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACjC,aAAa,CAAC,GAAG,CAAC,CAAC;IAEtB,6BAA6B;IAC7B,aAAa,CACX,MAAM,EAAE,GAAG,EACX,SAAS,EAAE,UAAU,EACrB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACjC,aAAa,CAAC,GAAG,CAAC,CAAC;IAEtB,wBAAwB;IACxB,QAAQ,CACN,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,GAAG,EACX,IAAI,CAAC,EAAE,OAAO,CACZ,IAAI,CACF,aAAa,CAAC,GAAG,CAAC,EAClB,UAAU,GAAG,WAAW,GAAG,WAAW,GAAG,QAAQ,CAClD,CACF,GACA,aAAa,CAAC,GAAG,CAAC,CAAC;IACtB,qBAAqB;IACrB,SAAS,IAAI,SAAS,aAAa,CAAC,GAAG,CAAC,EAAE,CAAC;IAE3C,mCAAmC;IACnC,gBAAgB,CAAC,MAAM,EAAE,GAAG,GAAG,SAAS,aAAa,CAAC,GAAG,CAAC,EAAE,CAAC;IAE7D,yBAAyB;IACzB,eAAe,CAAC,SAAS,EAAE,SAAS,GAAG,SAAS,aAAa,CAAC,GAAG,CAAC,EAAE,CAAC;IAErE,gCAAgC;IAChC,cAAc,IAAI,OAAO,CAAC;IAE1B,iCAAiC;IACjC,MAAM,IAAI,UAAU,CAAC;CACtB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-logger.js","sourceRoot":"","sources":["../../../../../../../packages/digitaldefiance-ecies-lib/src/lib/voting/interfaces/event-logger.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export type * from './aggregated-tally';
|
|
2
|
+
export type * from './audit-entry';
|
|
3
|
+
export type * from './audit-log';
|
|
4
|
+
export type * from './bulletin-board-entry';
|
|
5
|
+
export type * from './bulletin-board';
|
|
6
|
+
export type * from './checkpoint-manager';
|
|
7
|
+
export type * from './checkpoint-manager-extended';
|
|
8
|
+
export type * from './checkpoint-metadata';
|
|
9
|
+
export type * from './ecies-service-with-voting';
|
|
10
|
+
export type * from './encrypted-vote';
|
|
11
|
+
export type * from './event-log-entry';
|
|
12
|
+
export type * from './event-logger';
|
|
13
|
+
export type * from './jurisdiction-config';
|
|
14
|
+
export type * from './plaintext-vote';
|
|
15
|
+
export type * from './poll-configuration';
|
|
16
|
+
export type * from './poll-results';
|
|
17
|
+
export type * from './poll-tallier';
|
|
18
|
+
export type * from './poll';
|
|
19
|
+
export type * from './round-result';
|
|
20
|
+
export type * from './state-snapshot';
|
|
21
|
+
export type * from './supermajority-config';
|
|
22
|
+
export type * from './tally-proof';
|
|
23
|
+
export type * from './vote-encoder';
|
|
24
|
+
export type * from './vote-logger';
|
|
25
|
+
export type * from './vote-logger-extended';
|
|
26
|
+
export * from './voting-consts';
|
|
27
|
+
export type * from './voting-key-derivation-options';
|
|
28
|
+
export type * from './voting-poll-results';
|
|
29
|
+
export type * from './voting-receipt';
|
|
30
|
+
export type * from './voting-security-validator';
|
|
31
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../packages/digitaldefiance-ecies-lib/src/lib/voting/interfaces/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,oBAAoB,CAAC;AACxC,mBAAmB,eAAe,CAAC;AACnC,mBAAmB,aAAa,CAAC;AACjC,mBAAmB,wBAAwB,CAAC;AAC5C,mBAAmB,kBAAkB,CAAC;AACtC,mBAAmB,sBAAsB,CAAC;AAC1C,mBAAmB,+BAA+B,CAAC;AACnD,mBAAmB,uBAAuB,CAAC;AAC3C,mBAAmB,6BAA6B,CAAC;AACjD,mBAAmB,kBAAkB,CAAC;AACtC,mBAAmB,mBAAmB,CAAC;AACvC,mBAAmB,gBAAgB,CAAC;AACpC,mBAAmB,uBAAuB,CAAC;AAC3C,mBAAmB,kBAAkB,CAAC;AACtC,mBAAmB,sBAAsB,CAAC;AAC1C,mBAAmB,gBAAgB,CAAC;AACpC,mBAAmB,gBAAgB,CAAC;AACpC,mBAAmB,QAAQ,CAAC;AAC5B,mBAAmB,gBAAgB,CAAC;AACpC,mBAAmB,kBAAkB,CAAC;AACtC,mBAAmB,wBAAwB,CAAC;AAC5C,mBAAmB,eAAe,CAAC;AACnC,mBAAmB,gBAAgB,CAAC;AACpC,mBAAmB,eAAe,CAAC;AACnC,mBAAmB,wBAAwB,CAAC;AAC5C,cAAc,iBAAiB,CAAC;AAChC,mBAAmB,iCAAiC,CAAC;AACrD,mBAAmB,uBAAuB,CAAC;AAC3C,mBAAmB,kBAAkB,CAAC;AACtC,mBAAmB,6BAA6B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/digitaldefiance-ecies-lib/src/lib/voting/interfaces/index.ts"],"names":[],"mappings":";;;AAyBA,0DAAgC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { PlatformID } from '../../../interfaces';
|
|
2
|
+
import { JurisdictionLevel } from '../enumerations/jurisdictional-level';
|
|
3
|
+
export interface JurisdictionConfig<TID extends PlatformID = Uint8Array> {
|
|
4
|
+
id: TID;
|
|
5
|
+
name: string;
|
|
6
|
+
level: JurisdictionLevel;
|
|
7
|
+
parentId?: TID;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=jurisdiction-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jurisdiction-config.d.ts","sourceRoot":"","sources":["../../../../../../../packages/digitaldefiance-ecies-lib/src/lib/voting/interfaces/jurisdiction-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAEzE,MAAM,WAAW,kBAAkB,CAAC,GAAG,SAAS,UAAU,GAAG,UAAU;IACrE,EAAE,EAAE,GAAG,CAAC;IACR,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,iBAAiB,CAAC;IACzB,QAAQ,CAAC,EAAE,GAAG,CAAC;CAChB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jurisdiction-config.js","sourceRoot":"","sources":["../../../../../../../packages/digitaldefiance-ecies-lib/src/lib/voting/interfaces/jurisdiction-config.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { PlatformID } from '../../../interfaces';
|
|
2
|
+
/**
|
|
3
|
+
* Plaintext vote data for insecure voting methods.
|
|
4
|
+
* WARNING: Only use for Quadratic, Consensus, or ConsentBased methods.
|
|
5
|
+
*/
|
|
6
|
+
export interface PlaintextVote<TID extends PlatformID = Uint8Array> {
|
|
7
|
+
/** Unique identifier of the voter */
|
|
8
|
+
voterId: TID;
|
|
9
|
+
/** Single choice index */
|
|
10
|
+
choiceIndex?: number;
|
|
11
|
+
/** Multiple choice indices */
|
|
12
|
+
choices?: number[];
|
|
13
|
+
/** Vote weight */
|
|
14
|
+
weight?: bigint;
|
|
15
|
+
/** Objection text (for consent-based voting) */
|
|
16
|
+
objection?: string;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=plaintext-vote.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plaintext-vote.d.ts","sourceRoot":"","sources":["../../../../../../../packages/digitaldefiance-ecies-lib/src/lib/voting/interfaces/plaintext-vote.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEtD;;;GAGG;AACH,MAAM,WAAW,aAAa,CAAC,GAAG,SAAS,UAAU,GAAG,UAAU;IAChE,qCAAqC;IACrC,OAAO,EAAE,GAAG,CAAC;IACb,0BAA0B;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,8BAA8B;IAC9B,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,kBAAkB;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,gDAAgD;IAChD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plaintext-vote.js","sourceRoot":"","sources":["../../../../../../../packages/digitaldefiance-ecies-lib/src/lib/voting/interfaces/plaintext-vote.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"poll-configuration.d.ts","sourceRoot":"","sources":["../../../../../../../packages/digitaldefiance-ecies-lib/src/lib/voting/interfaces/poll-configuration.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,CAAC;IAC3B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,SAAS,CAAC,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC;CACjE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"poll-configuration.js","sourceRoot":"","sources":["../../../../../../../packages/digitaldefiance-ecies-lib/src/lib/voting/interfaces/poll-configuration.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { VotingMethod } from '../enumerations/voting-method';
|
|
2
|
+
import { RoundResult } from './round-result';
|
|
3
|
+
/**
|
|
4
|
+
* Results of a completed poll after tallying.
|
|
5
|
+
* Includes winner(s), tallies, and round-by-round data for multi-round methods.
|
|
6
|
+
*/
|
|
7
|
+
export interface PollResults {
|
|
8
|
+
/** Voting method used */
|
|
9
|
+
method: VotingMethod;
|
|
10
|
+
/** Array of choice names */
|
|
11
|
+
choices: string[];
|
|
12
|
+
/** Index of winning choice (undefined if tie) */
|
|
13
|
+
winner?: number;
|
|
14
|
+
/** Indices of tied winners (for ties or multi-winner methods) */
|
|
15
|
+
winners?: number[];
|
|
16
|
+
/** Indices of eliminated choices (for RCV) */
|
|
17
|
+
eliminated?: number[];
|
|
18
|
+
/** Round-by-round results (for multi-round methods) */
|
|
19
|
+
rounds?: RoundResult[];
|
|
20
|
+
/** Final vote tallies for each choice */
|
|
21
|
+
tallies: bigint[];
|
|
22
|
+
/** Total number of unique voters */
|
|
23
|
+
voterCount: number;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=poll-results.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"poll-results.d.ts","sourceRoot":"","sources":["../../../../../../../packages/digitaldefiance-ecies-lib/src/lib/voting/interfaces/poll-results.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B,yBAAyB;IACzB,MAAM,EAAE,YAAY,CAAC;IACrB,4BAA4B;IAC5B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,iDAAiD;IACjD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,iEAAiE;IACjE,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,8CAA8C;IAC9C,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,uDAAuD;IACvD,MAAM,CAAC,EAAE,WAAW,EAAE,CAAC;IACvB,yCAAyC;IACzC,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,oCAAoC;IACpC,UAAU,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"poll-results.js","sourceRoot":"","sources":["../../../../../../../packages/digitaldefiance-ecies-lib/src/lib/voting/interfaces/poll-results.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { PlatformID } from '../../../interfaces/platform-id';
|
|
2
|
+
import type { IPoll } from './poll';
|
|
3
|
+
import type { PollResults } from './poll-results';
|
|
4
|
+
/**
|
|
5
|
+
* Poll tallier interface for decrypting and tallying votes.
|
|
6
|
+
* Holds private key and can decrypt results after poll closes.
|
|
7
|
+
*/
|
|
8
|
+
export interface IPollTallier<TID extends PlatformID = Uint8Array> {
|
|
9
|
+
/**
|
|
10
|
+
* Tally votes and determine winner(s).
|
|
11
|
+
* Automatically selects appropriate tallying algorithm based on poll's voting method.
|
|
12
|
+
* @param poll - Poll to tally
|
|
13
|
+
* @returns Poll results
|
|
14
|
+
* @throws Error if poll is not closed
|
|
15
|
+
*/
|
|
16
|
+
tally(poll: IPoll<TID>): PollResults;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=poll-tallier.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"poll-tallier.d.ts","sourceRoot":"","sources":["../../../../../../../packages/digitaldefiance-ecies-lib/src/lib/voting/interfaces/poll-tallier.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD;;;GAGG;AACH,MAAM,WAAW,YAAY,CAAC,GAAG,SAAS,UAAU,GAAG,UAAU;IAC/D;;;;;;OAMG;IACH,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,WAAW,CAAC;CACtC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"poll-tallier.js","sourceRoot":"","sources":["../../../../../../../packages/digitaldefiance-ecies-lib/src/lib/voting/interfaces/poll-tallier.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { PlatformID } from '../../../interfaces/platform-id';
|
|
2
|
+
import { VotingMethod } from '../enumerations';
|
|
3
|
+
import { EncryptedVote } from './encrypted-vote';
|
|
4
|
+
import { VoteReceipt } from './voting-receipt';
|
|
5
|
+
/**
|
|
6
|
+
* Poll interface for vote aggregation and management.
|
|
7
|
+
* Holds encrypted votes and issues receipts, but cannot decrypt votes.
|
|
8
|
+
*/
|
|
9
|
+
export interface IPoll<TID extends PlatformID = Uint8Array> {
|
|
10
|
+
/** Poll ID */
|
|
11
|
+
readonly id: TID;
|
|
12
|
+
/** Array of choice names */
|
|
13
|
+
readonly choices: ReadonlyArray<string>;
|
|
14
|
+
/** Voting method */
|
|
15
|
+
readonly method: VotingMethod;
|
|
16
|
+
/** Whether poll is closed to new votes */
|
|
17
|
+
get isClosed(): boolean;
|
|
18
|
+
/** Total number of unique voters */
|
|
19
|
+
get voterCount(): number;
|
|
20
|
+
/** Poll creation timestamp */
|
|
21
|
+
get createdAt(): number;
|
|
22
|
+
/** Poll closed timestamp (undefined if not closed) */
|
|
23
|
+
get closedAt(): number | undefined;
|
|
24
|
+
/**
|
|
25
|
+
* Get encrypted votes for tallying.
|
|
26
|
+
*/
|
|
27
|
+
getEncryptedVotes(): ReadonlyMap<string, readonly bigint[]>;
|
|
28
|
+
/**
|
|
29
|
+
* Cast a vote.
|
|
30
|
+
*/
|
|
31
|
+
vote(voter: import('../../../interfaces').IMember<TID>, vote: EncryptedVote<TID>): VoteReceipt<TID>;
|
|
32
|
+
/**
|
|
33
|
+
* Verify a receipt is valid.
|
|
34
|
+
*/
|
|
35
|
+
verifyReceipt(voter: import('../../../interfaces').IMember<TID>, receipt: VoteReceipt<TID>): boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Close the poll to new votes.
|
|
38
|
+
*/
|
|
39
|
+
close(): void;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=poll.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"poll.d.ts","sourceRoot":"","sources":["../../../../../../../packages/digitaldefiance-ecies-lib/src/lib/voting/interfaces/poll.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C;;;GAGG;AACH,MAAM,WAAW,KAAK,CAAC,GAAG,SAAS,UAAU,GAAG,UAAU;IACxD,cAAc;IACd,QAAQ,CAAC,EAAE,EAAE,GAAG,CAAC;IACjB,4BAA4B;IAC5B,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IACxC,oBAAoB;IACpB,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IAC9B,0CAA0C;IAC1C,IAAI,QAAQ,IAAI,OAAO,CAAC;IACxB,oCAAoC;IACpC,IAAI,UAAU,IAAI,MAAM,CAAC;IACzB,8BAA8B;IAC9B,IAAI,SAAS,IAAI,MAAM,CAAC;IACxB,sDAAsD;IACtD,IAAI,QAAQ,IAAI,MAAM,GAAG,SAAS,CAAC;IAEnC;;OAEG;IACH,iBAAiB,IAAI,WAAW,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,CAAC;IAE5D;;OAEG;IACH,IAAI,CACF,KAAK,EAAE,OAAO,qBAAqB,EAAE,OAAO,CAAC,GAAG,CAAC,EACjD,IAAI,EAAE,aAAa,CAAC,GAAG,CAAC,GACvB,WAAW,CAAC,GAAG,CAAC,CAAC;IAEpB;;OAEG;IACH,aAAa,CACX,KAAK,EAAE,OAAO,qBAAqB,EAAE,OAAO,CAAC,GAAG,CAAC,EACjD,OAAO,EAAE,WAAW,CAAC,GAAG,CAAC,GACxB,OAAO,CAAC;IAEX;;OAEG;IACH,KAAK,IAAI,IAAI,CAAC;CACf"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"poll.js","sourceRoot":"","sources":["../../../../../../../packages/digitaldefiance-ecies-lib/src/lib/voting/interfaces/poll.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Results from a single round of multi-round voting.
|
|
3
|
+
* Used in RCV, Two-Round, STAR, and STV methods.
|
|
4
|
+
*/
|
|
5
|
+
export interface RoundResult {
|
|
6
|
+
/** Round number (1-indexed) */
|
|
7
|
+
round: number;
|
|
8
|
+
/** Vote tallies for this round */
|
|
9
|
+
tallies: bigint[];
|
|
10
|
+
/** Index of choice eliminated this round (if any) */
|
|
11
|
+
eliminated?: number;
|
|
12
|
+
/** Index of winner determined this round (if any) */
|
|
13
|
+
winner?: number;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=round-result.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"round-result.d.ts","sourceRoot":"","sources":["../../../../../../../packages/digitaldefiance-ecies-lib/src/lib/voting/interfaces/round-result.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B,+BAA+B;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,kCAAkC;IAClC,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,qDAAqD;IACrD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,qDAAqD;IACrD,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"round-result.js","sourceRoot":"","sources":["../../../../../../../packages/digitaldefiance-ecies-lib/src/lib/voting/interfaces/round-result.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { PlatformID } from '../../../interfaces';
|
|
2
|
+
import { AggregatedTally } from './aggregated-tally';
|
|
3
|
+
import { CheckpointMetadata } from './checkpoint-metadata';
|
|
4
|
+
export interface StateSnapshot<TID extends PlatformID = Uint8Array> {
|
|
5
|
+
metadata: CheckpointMetadata;
|
|
6
|
+
tally: AggregatedTally<TID>;
|
|
7
|
+
voteLog: Uint8Array;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=state-snapshot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state-snapshot.d.ts","sourceRoot":"","sources":["../../../../../../../packages/digitaldefiance-ecies-lib/src/lib/voting/interfaces/state-snapshot.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE3D,MAAM,WAAW,aAAa,CAAC,GAAG,SAAS,UAAU,GAAG,UAAU;IAChE,QAAQ,EAAE,kBAAkB,CAAC;IAC7B,KAAK,EAAE,eAAe,CAAC,GAAG,CAAC,CAAC;IAC5B,OAAO,EAAE,UAAU,CAAC;CACrB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state-snapshot.js","sourceRoot":"","sources":["../../../../../../../packages/digitaldefiance-ecies-lib/src/lib/voting/interfaces/state-snapshot.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration for supermajority voting.
|
|
3
|
+
* Defines the required threshold as a fraction (e.g., 2/3, 3/4).
|
|
4
|
+
*/
|
|
5
|
+
export interface SupermajorityConfig {
|
|
6
|
+
/** Numerator of the fraction (e.g., 2 for 2/3) */
|
|
7
|
+
numerator: number;
|
|
8
|
+
/** Denominator of the fraction (e.g., 3 for 2/3) */
|
|
9
|
+
denominator: number;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=supermajority-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"supermajority-config.d.ts","sourceRoot":"","sources":["../../../../../../../packages/digitaldefiance-ecies-lib/src/lib/voting/interfaces/supermajority-config.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC,kDAAkD;IAClD,SAAS,EAAE,MAAM,CAAC;IAClB,oDAAoD;IACpD,WAAW,EAAE,MAAM,CAAC;CACrB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"supermajority-config.js","sourceRoot":"","sources":["../../../../../../../packages/digitaldefiance-ecies-lib/src/lib/voting/interfaces/supermajority-config.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { PlatformID } from '../../../interfaces';
|
|
2
|
+
export interface TallyProof<TID extends PlatformID = Uint8Array> {
|
|
3
|
+
/** Poll identifier */
|
|
4
|
+
readonly pollId: TID;
|
|
5
|
+
/** Final tallies */
|
|
6
|
+
readonly tallies: bigint[];
|
|
7
|
+
/** Choice names */
|
|
8
|
+
readonly choices: string[];
|
|
9
|
+
/** Timestamp of tally */
|
|
10
|
+
readonly timestamp: number;
|
|
11
|
+
/** Hash of all encrypted votes */
|
|
12
|
+
readonly votesHash: Uint8Array;
|
|
13
|
+
/** Cryptographic proof of correct decryption */
|
|
14
|
+
readonly decryptionProof: Uint8Array;
|
|
15
|
+
/** Authority signature */
|
|
16
|
+
readonly signature: Uint8Array;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=tally-proof.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tally-proof.d.ts","sourceRoot":"","sources":["../../../../../../../packages/digitaldefiance-ecies-lib/src/lib/voting/interfaces/tally-proof.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACtD,MAAM,WAAW,UAAU,CAAC,GAAG,SAAS,UAAU,GAAG,UAAU;IAC7D,sBAAsB;IACtB,QAAQ,CAAC,MAAM,EAAE,GAAG,CAAC;IACrB,oBAAoB;IACpB,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,CAAC;IAC3B,mBAAmB;IACnB,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,CAAC;IAC3B,yBAAyB;IACzB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,kCAAkC;IAClC,QAAQ,CAAC,SAAS,EAAE,UAAU,CAAC;IAC/B,gDAAgD;IAChD,QAAQ,CAAC,eAAe,EAAE,UAAU,CAAC;IACrC,0BAA0B;IAC1B,QAAQ,CAAC,SAAS,EAAE,UAAU,CAAC;CAChC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tally-proof.js","sourceRoot":"","sources":["../../../../../../../packages/digitaldefiance-ecies-lib/src/lib/voting/interfaces/tally-proof.ts"],"names":[],"mappings":""}
|