@digitaldefiance/ecies-lib 4.8.6 → 4.9.0

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.
Files changed (297) hide show
  1. package/package.json +7 -7
  2. package/src/builders/member-builder.d.ts +1 -2
  3. package/src/builders/member-builder.d.ts.map +1 -1
  4. package/src/builders/member-builder.js.map +1 -1
  5. package/src/constants.d.ts +1 -1
  6. package/src/constants.d.ts.map +1 -1
  7. package/src/constants.js +2 -0
  8. package/src/constants.js.map +1 -1
  9. package/src/interfaces/constants.d.ts +1 -1
  10. package/src/interfaces/constants.d.ts.map +1 -1
  11. package/src/interfaces/ecies-consts.d.ts +1 -0
  12. package/src/interfaces/ecies-consts.d.ts.map +1 -1
  13. package/src/interfaces/index.d.ts +2 -4
  14. package/src/interfaces/index.d.ts.map +1 -1
  15. package/src/interfaces/index.js +2 -5
  16. package/src/interfaces/index.js.map +1 -1
  17. package/src/interfaces/isolated-private-key-async.d.ts +13 -0
  18. package/src/interfaces/isolated-private-key-async.d.ts.map +1 -0
  19. package/src/interfaces/isolated-private-key-async.js +3 -0
  20. package/src/interfaces/isolated-private-key-async.js.map +1 -0
  21. package/src/interfaces/isolated-public-key-async.d.ts +17 -0
  22. package/src/interfaces/isolated-public-key-async.d.ts.map +1 -0
  23. package/src/interfaces/isolated-public-key-async.js +3 -0
  24. package/src/interfaces/isolated-public-key-async.js.map +1 -0
  25. package/src/interfaces/platform-buffer.d.ts +5 -5
  26. package/src/interfaces/platform-buffer.d.ts.map +1 -1
  27. package/src/interfaces/voting-service.d.ts +0 -111
  28. package/src/interfaces/voting-service.d.ts.map +1 -1
  29. package/src/interfaces/voting-service.js +0 -7
  30. package/src/interfaces/voting-service.js.map +1 -1
  31. package/src/lib/id-providers/index.d.ts +1 -0
  32. package/src/lib/id-providers/index.d.ts.map +1 -1
  33. package/src/lib/id-providers/index.js +3 -1
  34. package/src/lib/id-providers/index.js.map +1 -1
  35. package/src/lib/id-providers/uint8array-provider.d.ts +54 -0
  36. package/src/lib/id-providers/uint8array-provider.d.ts.map +1 -0
  37. package/src/lib/id-providers/uint8array-provider.js +97 -0
  38. package/src/lib/id-providers/uint8array-provider.js.map +1 -0
  39. package/src/lib/voting/audit.d.ts +4 -38
  40. package/src/lib/voting/audit.d.ts.map +1 -1
  41. package/src/lib/voting/audit.js +8 -10
  42. package/src/lib/voting/audit.js.map +1 -1
  43. package/src/lib/voting/bulletin-board.d.ts +5 -56
  44. package/src/lib/voting/bulletin-board.d.ts.map +1 -1
  45. package/src/lib/voting/bulletin-board.js +11 -2
  46. package/src/lib/voting/bulletin-board.js.map +1 -1
  47. package/src/lib/voting/encoder.d.ts +2 -1
  48. package/src/lib/voting/encoder.d.ts.map +1 -1
  49. package/src/lib/voting/encoder.js +9 -9
  50. package/src/lib/voting/encoder.js.map +1 -1
  51. package/src/lib/voting/enumerations/audit-event-type.d.ts +6 -0
  52. package/src/lib/voting/enumerations/audit-event-type.d.ts.map +1 -0
  53. package/src/lib/voting/enumerations/audit-event-type.js +10 -0
  54. package/src/lib/voting/enumerations/audit-event-type.js.map +1 -0
  55. package/src/lib/voting/enumerations/event-type.d.ts +9 -0
  56. package/src/lib/voting/enumerations/event-type.d.ts.map +1 -0
  57. package/src/lib/voting/enumerations/event-type.js +13 -0
  58. package/src/lib/voting/enumerations/event-type.js.map +1 -0
  59. package/src/lib/voting/enumerations/index.d.ts +6 -0
  60. package/src/lib/voting/enumerations/index.d.ts.map +1 -0
  61. package/src/lib/voting/enumerations/index.js +9 -0
  62. package/src/lib/voting/enumerations/index.js.map +1 -0
  63. package/src/lib/voting/enumerations/jurisdictional-level.d.ts +7 -0
  64. package/src/lib/voting/enumerations/jurisdictional-level.d.ts.map +1 -0
  65. package/src/lib/voting/enumerations/jurisdictional-level.js +11 -0
  66. package/src/lib/voting/enumerations/jurisdictional-level.js.map +1 -0
  67. package/src/lib/voting/enumerations/security-level.d.ts +6 -0
  68. package/src/lib/voting/enumerations/security-level.d.ts.map +1 -0
  69. package/src/lib/voting/enumerations/security-level.js +10 -0
  70. package/src/lib/voting/enumerations/security-level.js.map +1 -0
  71. package/src/lib/voting/enumerations/voting-method.d.ts +41 -0
  72. package/src/lib/voting/enumerations/voting-method.d.ts.map +1 -0
  73. package/src/lib/voting/{types.js → enumerations/voting-method.js} +1 -1
  74. package/src/lib/voting/enumerations/voting-method.js.map +1 -0
  75. package/src/lib/voting/event-logger.d.ts +14 -65
  76. package/src/lib/voting/event-logger.d.ts.map +1 -1
  77. package/src/lib/voting/event-logger.js +32 -19
  78. package/src/lib/voting/event-logger.js.map +1 -1
  79. package/src/lib/voting/factory.d.ts +2 -2
  80. package/src/lib/voting/factory.d.ts.map +1 -1
  81. package/src/lib/voting/factory.js +6 -6
  82. package/src/lib/voting/factory.js.map +1 -1
  83. package/src/lib/voting/hierarchical-aggregator.d.ts +72 -0
  84. package/src/lib/voting/hierarchical-aggregator.d.ts.map +1 -0
  85. package/src/lib/voting/hierarchical-aggregator.js +234 -0
  86. package/src/lib/voting/hierarchical-aggregator.js.map +1 -0
  87. package/src/lib/voting/index.d.ts +8 -5
  88. package/src/lib/voting/index.d.ts.map +1 -1
  89. package/src/lib/voting/index.js +12 -7
  90. package/src/lib/voting/index.js.map +1 -1
  91. package/src/lib/voting/interfaces/aggregated-tally.d.ts +11 -0
  92. package/src/lib/voting/interfaces/aggregated-tally.d.ts.map +1 -0
  93. package/src/{interfaces/member-with-mnemonic.js → lib/voting/interfaces/aggregated-tally.js} +1 -1
  94. package/src/lib/voting/interfaces/aggregated-tally.js.map +1 -0
  95. package/src/lib/voting/interfaces/audit-entry.d.ts +25 -0
  96. package/src/lib/voting/interfaces/audit-entry.d.ts.map +1 -0
  97. package/src/lib/voting/interfaces/audit-entry.js +3 -0
  98. package/src/lib/voting/interfaces/audit-entry.js.map +1 -0
  99. package/src/lib/voting/interfaces/audit-log.d.ts +13 -0
  100. package/src/lib/voting/interfaces/audit-log.d.ts.map +1 -0
  101. package/src/lib/voting/interfaces/audit-log.js +3 -0
  102. package/src/lib/voting/interfaces/audit-log.js.map +1 -0
  103. package/src/lib/voting/interfaces/bulletin-board-entry.d.ts +20 -0
  104. package/src/lib/voting/interfaces/bulletin-board-entry.d.ts.map +1 -0
  105. package/src/lib/voting/interfaces/bulletin-board-entry.js +3 -0
  106. package/src/lib/voting/interfaces/bulletin-board-entry.js.map +1 -0
  107. package/src/lib/voting/interfaces/bulletin-board.d.ts +24 -0
  108. package/src/lib/voting/interfaces/bulletin-board.d.ts.map +1 -0
  109. package/src/lib/voting/interfaces/bulletin-board.js +3 -0
  110. package/src/lib/voting/interfaces/bulletin-board.js.map +1 -0
  111. package/src/lib/voting/interfaces/checkpoint-manager-extended.d.ts +14 -0
  112. package/src/lib/voting/interfaces/checkpoint-manager-extended.d.ts.map +1 -0
  113. package/src/lib/voting/interfaces/checkpoint-manager-extended.js +3 -0
  114. package/src/lib/voting/interfaces/checkpoint-manager-extended.js.map +1 -0
  115. package/src/lib/voting/interfaces/checkpoint-manager.d.ts +8 -0
  116. package/src/lib/voting/interfaces/checkpoint-manager.d.ts.map +1 -0
  117. package/src/lib/voting/interfaces/checkpoint-manager.js +3 -0
  118. package/src/lib/voting/interfaces/checkpoint-manager.js.map +1 -0
  119. package/src/lib/voting/interfaces/checkpoint-metadata.d.ts +9 -0
  120. package/src/lib/voting/interfaces/checkpoint-metadata.d.ts.map +1 -0
  121. package/src/lib/voting/interfaces/checkpoint-metadata.js +3 -0
  122. package/src/lib/voting/interfaces/checkpoint-metadata.js.map +1 -0
  123. package/src/lib/voting/interfaces/ecies-service-with-voting.d.ts +55 -0
  124. package/src/lib/voting/interfaces/ecies-service-with-voting.d.ts.map +1 -0
  125. package/src/lib/voting/interfaces/ecies-service-with-voting.js +3 -0
  126. package/src/lib/voting/interfaces/ecies-service-with-voting.js.map +1 -0
  127. package/src/lib/voting/interfaces/encrypted-vote.d.ts +23 -0
  128. package/src/lib/voting/interfaces/encrypted-vote.d.ts.map +1 -0
  129. package/src/lib/voting/interfaces/encrypted-vote.js +3 -0
  130. package/src/lib/voting/interfaces/encrypted-vote.js.map +1 -0
  131. package/src/lib/voting/interfaces/event-log-entry.d.ts +24 -0
  132. package/src/lib/voting/interfaces/event-log-entry.d.ts.map +1 -0
  133. package/src/lib/voting/interfaces/event-log-entry.js +3 -0
  134. package/src/lib/voting/interfaces/event-log-entry.js.map +1 -0
  135. package/src/lib/voting/interfaces/event-logger.d.ts +25 -0
  136. package/src/lib/voting/interfaces/event-logger.d.ts.map +1 -0
  137. package/src/lib/voting/interfaces/event-logger.js +3 -0
  138. package/src/lib/voting/interfaces/event-logger.js.map +1 -0
  139. package/src/lib/voting/interfaces/index.d.ts +31 -0
  140. package/src/lib/voting/interfaces/index.d.ts.map +1 -0
  141. package/src/lib/voting/interfaces/index.js +5 -0
  142. package/src/lib/voting/interfaces/index.js.map +1 -0
  143. package/src/lib/voting/interfaces/jurisdiction-config.d.ts +9 -0
  144. package/src/lib/voting/interfaces/jurisdiction-config.d.ts.map +1 -0
  145. package/src/lib/voting/interfaces/jurisdiction-config.js +3 -0
  146. package/src/lib/voting/interfaces/jurisdiction-config.js.map +1 -0
  147. package/src/lib/voting/interfaces/plaintext-vote.d.ts +18 -0
  148. package/src/lib/voting/interfaces/plaintext-vote.d.ts.map +1 -0
  149. package/src/lib/voting/interfaces/plaintext-vote.js +3 -0
  150. package/src/lib/voting/interfaces/plaintext-vote.js.map +1 -0
  151. package/src/lib/voting/interfaces/poll-configuration.d.ts +10 -0
  152. package/src/lib/voting/interfaces/poll-configuration.d.ts.map +1 -0
  153. package/src/lib/voting/interfaces/poll-configuration.js +3 -0
  154. package/src/lib/voting/interfaces/poll-configuration.js.map +1 -0
  155. package/src/lib/voting/interfaces/poll-results.d.ts +25 -0
  156. package/src/lib/voting/interfaces/poll-results.d.ts.map +1 -0
  157. package/src/lib/voting/interfaces/poll-results.js +3 -0
  158. package/src/lib/voting/interfaces/poll-results.js.map +1 -0
  159. package/src/lib/voting/interfaces/poll-tallier.d.ts +18 -0
  160. package/src/lib/voting/interfaces/poll-tallier.d.ts.map +1 -0
  161. package/src/lib/voting/interfaces/poll-tallier.js +3 -0
  162. package/src/lib/voting/interfaces/poll-tallier.js.map +1 -0
  163. package/src/lib/voting/interfaces/poll.d.ts +41 -0
  164. package/src/lib/voting/interfaces/poll.d.ts.map +1 -0
  165. package/src/lib/voting/interfaces/poll.js +3 -0
  166. package/src/lib/voting/interfaces/poll.js.map +1 -0
  167. package/src/lib/voting/interfaces/round-result.d.ts +15 -0
  168. package/src/lib/voting/interfaces/round-result.d.ts.map +1 -0
  169. package/src/lib/voting/interfaces/round-result.js +3 -0
  170. package/src/lib/voting/interfaces/round-result.js.map +1 -0
  171. package/src/lib/voting/interfaces/state-snapshot.d.ts +9 -0
  172. package/src/lib/voting/interfaces/state-snapshot.d.ts.map +1 -0
  173. package/src/lib/voting/interfaces/state-snapshot.js +3 -0
  174. package/src/lib/voting/interfaces/state-snapshot.js.map +1 -0
  175. package/src/lib/voting/interfaces/supermajority-config.d.ts +11 -0
  176. package/src/lib/voting/interfaces/supermajority-config.d.ts.map +1 -0
  177. package/src/lib/voting/interfaces/supermajority-config.js +3 -0
  178. package/src/lib/voting/interfaces/supermajority-config.js.map +1 -0
  179. package/src/lib/voting/interfaces/tally-proof.d.ts +18 -0
  180. package/src/lib/voting/interfaces/tally-proof.d.ts.map +1 -0
  181. package/src/lib/voting/interfaces/tally-proof.js +3 -0
  182. package/src/lib/voting/interfaces/tally-proof.js.map +1 -0
  183. package/src/lib/voting/interfaces/vote-encoder.d.ts +59 -0
  184. package/src/lib/voting/interfaces/vote-encoder.d.ts.map +1 -0
  185. package/src/lib/voting/interfaces/vote-encoder.js +3 -0
  186. package/src/lib/voting/interfaces/vote-encoder.js.map +1 -0
  187. package/src/lib/voting/interfaces/vote-logger-extended.d.ts +15 -0
  188. package/src/lib/voting/interfaces/vote-logger-extended.d.ts.map +1 -0
  189. package/src/lib/voting/interfaces/vote-logger-extended.js +3 -0
  190. package/src/lib/voting/interfaces/vote-logger-extended.js.map +1 -0
  191. package/src/lib/voting/interfaces/vote-logger.d.ts +11 -0
  192. package/src/lib/voting/interfaces/vote-logger.d.ts.map +1 -0
  193. package/src/lib/voting/interfaces/vote-logger.js +3 -0
  194. package/src/lib/voting/interfaces/vote-logger.js.map +1 -0
  195. package/src/lib/voting/interfaces/voting-consts.d.ts.map +1 -0
  196. package/src/lib/voting/interfaces/voting-consts.js.map +1 -0
  197. package/src/lib/voting/interfaces/voting-key-derivation-options.d.ts +26 -0
  198. package/src/lib/voting/interfaces/voting-key-derivation-options.d.ts.map +1 -0
  199. package/src/lib/voting/interfaces/voting-key-derivation-options.js +3 -0
  200. package/src/lib/voting/interfaces/voting-key-derivation-options.js.map +1 -0
  201. package/src/lib/voting/interfaces/voting-poll-results.d.ts +20 -0
  202. package/src/lib/voting/interfaces/voting-poll-results.d.ts.map +1 -0
  203. package/src/lib/voting/interfaces/voting-poll-results.js +3 -0
  204. package/src/lib/voting/interfaces/voting-poll-results.js.map +1 -0
  205. package/src/lib/voting/interfaces/voting-receipt.d.ts +18 -0
  206. package/src/lib/voting/interfaces/voting-receipt.d.ts.map +1 -0
  207. package/src/lib/voting/interfaces/voting-receipt.js +3 -0
  208. package/src/lib/voting/interfaces/voting-receipt.js.map +1 -0
  209. package/src/lib/voting/interfaces/voting-security-validator.d.ts +37 -0
  210. package/src/lib/voting/interfaces/voting-security-validator.d.ts.map +1 -0
  211. package/src/lib/voting/interfaces/voting-security-validator.js +3 -0
  212. package/src/lib/voting/interfaces/voting-security-validator.js.map +1 -0
  213. package/src/lib/voting/persistent-state.d.ts +21 -0
  214. package/src/lib/voting/persistent-state.d.ts.map +1 -0
  215. package/src/lib/voting/persistent-state.js +32 -0
  216. package/src/lib/voting/persistent-state.js.map +1 -0
  217. package/src/lib/voting/poll-core.d.ts +3 -3
  218. package/src/lib/voting/poll-core.d.ts.map +1 -1
  219. package/src/lib/voting/poll-core.js +6 -7
  220. package/src/lib/voting/poll-core.js.map +1 -1
  221. package/src/lib/voting/security.d.ts +2 -6
  222. package/src/lib/voting/security.d.ts.map +1 -1
  223. package/src/lib/voting/security.js +25 -28
  224. package/src/lib/voting/security.js.map +1 -1
  225. package/src/lib/voting/tallier.d.ts +5 -5
  226. package/src/lib/voting/tallier.d.ts.map +1 -1
  227. package/src/lib/voting/tallier.js +26 -26
  228. package/src/lib/voting/tallier.js.map +1 -1
  229. package/src/lib/voting/test-voter-pool.d.ts +16 -0
  230. package/src/lib/voting/test-voter-pool.d.ts.map +1 -0
  231. package/src/lib/voting/test-voter-pool.js +65 -0
  232. package/src/lib/voting/test-voter-pool.js.map +1 -0
  233. package/src/member.d.ts +8 -1
  234. package/src/member.d.ts.map +1 -1
  235. package/src/member.js +6 -6
  236. package/src/member.js.map +1 -1
  237. package/src/services/ecies/interfaces/decryption-result.d.ts +5 -0
  238. package/src/services/ecies/interfaces/decryption-result.d.ts.map +1 -0
  239. package/src/services/ecies/interfaces/decryption-result.js +3 -0
  240. package/src/services/ecies/interfaces/decryption-result.js.map +1 -0
  241. package/src/services/ecies/interfaces/encryption-result.d.ts +7 -0
  242. package/src/services/ecies/interfaces/encryption-result.d.ts.map +1 -0
  243. package/src/services/ecies/interfaces/encryption-result.js +3 -0
  244. package/src/services/ecies/interfaces/encryption-result.js.map +1 -0
  245. package/src/services/ecies/interfaces/index.d.ts +9 -0
  246. package/src/services/ecies/interfaces/index.d.ts.map +1 -0
  247. package/src/services/ecies/interfaces/index.js +3 -0
  248. package/src/services/ecies/interfaces/index.js.map +1 -0
  249. package/src/services/ecies/interfaces/multi-encrypted-message.d.ts +11 -0
  250. package/src/services/ecies/interfaces/multi-encrypted-message.d.ts.map +1 -0
  251. package/src/services/ecies/interfaces/multi-encrypted-message.js +3 -0
  252. package/src/services/ecies/interfaces/multi-encrypted-message.js.map +1 -0
  253. package/src/services/ecies/interfaces/multi-encrypted-parsed-header.d.ts +10 -0
  254. package/src/services/ecies/interfaces/multi-encrypted-parsed-header.d.ts.map +1 -0
  255. package/src/services/ecies/interfaces/multi-encrypted-parsed-header.js +3 -0
  256. package/src/services/ecies/interfaces/multi-encrypted-parsed-header.js.map +1 -0
  257. package/src/services/ecies/interfaces/multi-recipient.d.ts +6 -0
  258. package/src/services/ecies/interfaces/multi-recipient.d.ts.map +1 -0
  259. package/src/services/ecies/interfaces/multi-recipient.js +3 -0
  260. package/src/services/ecies/interfaces/multi-recipient.js.map +1 -0
  261. package/src/services/ecies/interfaces/simple-keypair.d.ts +5 -0
  262. package/src/services/ecies/interfaces/simple-keypair.d.ts.map +1 -0
  263. package/src/services/ecies/interfaces/simple-keypair.js +3 -0
  264. package/src/services/ecies/interfaces/simple-keypair.js.map +1 -0
  265. package/src/services/ecies/interfaces/single-encrypted-parsed-header.d.ts +11 -0
  266. package/src/services/ecies/interfaces/single-encrypted-parsed-header.d.ts.map +1 -0
  267. package/src/services/ecies/interfaces/single-encrypted-parsed-header.js +3 -0
  268. package/src/services/ecies/interfaces/single-encrypted-parsed-header.js.map +1 -0
  269. package/src/services/ecies/interfaces/wallet-seed.d.ts +6 -0
  270. package/src/services/ecies/interfaces/wallet-seed.d.ts.map +1 -0
  271. package/src/services/ecies/interfaces/wallet-seed.js +3 -0
  272. package/src/services/ecies/interfaces/wallet-seed.js.map +1 -0
  273. package/src/services/ecies/multi-recipient.d.ts.map +1 -1
  274. package/src/services/ecies/multi-recipient.js +14 -5
  275. package/src/services/ecies/multi-recipient.js.map +1 -1
  276. package/src/interfaces/member-with-mnemonic.d.ts +0 -8
  277. package/src/interfaces/member-with-mnemonic.d.ts.map +0 -1
  278. package/src/interfaces/member-with-mnemonic.js.map +0 -1
  279. package/src/interfaces/voting-consts.d.ts.map +0 -1
  280. package/src/interfaces/voting-consts.js.map +0 -1
  281. package/src/interfaces/voting-poll.d.ts +0 -455
  282. package/src/interfaces/voting-poll.d.ts.map +0 -1
  283. package/src/interfaces/voting-poll.js +0 -54
  284. package/src/interfaces/voting-poll.js.map +0 -1
  285. package/src/lib/voting/poll.d.ts +0 -125
  286. package/src/lib/voting/poll.d.ts.map +0 -1
  287. package/src/lib/voting/poll.js +0 -323
  288. package/src/lib/voting/poll.js.map +0 -1
  289. package/src/lib/voting/types.d.ts +0 -146
  290. package/src/lib/voting/types.d.ts.map +0 -1
  291. package/src/lib/voting/types.js.map +0 -1
  292. package/src/services/ecies/interfaces.d.ts +0 -55
  293. package/src/services/ecies/interfaces.d.ts.map +0 -1
  294. package/src/services/ecies/interfaces.js +0 -6
  295. package/src/services/ecies/interfaces.js.map +0 -1
  296. /package/src/{interfaces → lib/voting/interfaces}/voting-consts.d.ts +0 -0
  297. /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,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=ecies-service-with-voting.js.map
@@ -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,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=encrypted-vote.js.map
@@ -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,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=event-log-entry.js.map
@@ -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,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=event-logger.js.map
@@ -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,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./voting-consts"), exports);
5
+ //# sourceMappingURL=index.js.map
@@ -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,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=jurisdiction-config.js.map
@@ -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,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=plaintext-vote.js.map
@@ -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,10 @@
1
+ export interface PollConfiguration {
2
+ readonly method: string;
3
+ readonly choices: string[];
4
+ readonly maxWeight?: bigint;
5
+ readonly threshold?: {
6
+ numerator: number;
7
+ denominator: number;
8
+ };
9
+ }
10
+ //# sourceMappingURL=poll-configuration.d.ts.map
@@ -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,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=poll-configuration.js.map
@@ -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,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=poll-results.js.map
@@ -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,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=poll-tallier.js.map
@@ -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,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=poll.js.map
@@ -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,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=round-result.js.map
@@ -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,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=state-snapshot.js.map
@@ -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,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=supermajority-config.js.map
@@ -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,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=tally-proof.js.map
@@ -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":""}