voting_schemes-dummy 0.21.0 → 0.22.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 25790594cfcf4a401cc7c5c157ff9231901b1edf8dcd929ea9b460005742b904
4
- data.tar.gz: 3cd889978214f3d1ad21bb77d57f35c7f55dcd22b9aeaaa4cac831a0a39a9145
3
+ metadata.gz: 03fb1f1a56bf94aa7cdd8d05fceccb589f653cee741791a63abb84eae4bc0646
4
+ data.tar.gz: 8ce31759adf83aec085d49b40bf2a105faad2a04550e2c071b1df1397befcad5
5
5
  SHA512:
6
- metadata.gz: af1ab9492c5d35803c6d3492e47ee8ef7a7a3327e9dfe89c462607b3bb02f86f6eea5d871420558b68430e9523af51a2276b04be26b08ce1e00bce40aa65bf15
7
- data.tar.gz: cbae261fe1ecc5b829cb313bfd2e2bc5243ce1c2456003473d4528a4a2e6229f65cd9eac10836944fb52e84d4c519d6339710bdb560b7e615e46aff1f80d7330
6
+ metadata.gz: 2192b25217f12daede912168b50420b170c8b9744768fb8f28b676d641f56c8214248cd0ce87a9a7ee27b696b59573a3e8d7ea542958553321f1a966ebb8294a
7
+ data.tar.gz: d9adafa82c864e0ffa214e3d64bb4c6c7ecda792d3ae4d06922a0fd38ade8162958f35058837d78c3339a7757e08143339cc3222e41b566ebe3c0fe19d15596e
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 2.6.6
data/Gemfile.lock CHANGED
@@ -1,66 +1,66 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- voting_schemes-dummy (0.21.0)
4
+ voting_schemes-dummy (0.22.1)
5
5
  rails (>= 5.0.0)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- actioncable (6.1.3.1)
11
- actionpack (= 6.1.3.1)
12
- activesupport (= 6.1.3.1)
10
+ actioncable (6.1.4.1)
11
+ actionpack (= 6.1.4.1)
12
+ activesupport (= 6.1.4.1)
13
13
  nio4r (~> 2.0)
14
14
  websocket-driver (>= 0.6.1)
15
- actionmailbox (6.1.3.1)
16
- actionpack (= 6.1.3.1)
17
- activejob (= 6.1.3.1)
18
- activerecord (= 6.1.3.1)
19
- activestorage (= 6.1.3.1)
20
- activesupport (= 6.1.3.1)
15
+ actionmailbox (6.1.4.1)
16
+ actionpack (= 6.1.4.1)
17
+ activejob (= 6.1.4.1)
18
+ activerecord (= 6.1.4.1)
19
+ activestorage (= 6.1.4.1)
20
+ activesupport (= 6.1.4.1)
21
21
  mail (>= 2.7.1)
22
- actionmailer (6.1.3.1)
23
- actionpack (= 6.1.3.1)
24
- actionview (= 6.1.3.1)
25
- activejob (= 6.1.3.1)
26
- activesupport (= 6.1.3.1)
22
+ actionmailer (6.1.4.1)
23
+ actionpack (= 6.1.4.1)
24
+ actionview (= 6.1.4.1)
25
+ activejob (= 6.1.4.1)
26
+ activesupport (= 6.1.4.1)
27
27
  mail (~> 2.5, >= 2.5.4)
28
28
  rails-dom-testing (~> 2.0)
29
- actionpack (6.1.3.1)
30
- actionview (= 6.1.3.1)
31
- activesupport (= 6.1.3.1)
29
+ actionpack (6.1.4.1)
30
+ actionview (= 6.1.4.1)
31
+ activesupport (= 6.1.4.1)
32
32
  rack (~> 2.0, >= 2.0.9)
33
33
  rack-test (>= 0.6.3)
34
34
  rails-dom-testing (~> 2.0)
35
35
  rails-html-sanitizer (~> 1.0, >= 1.2.0)
36
- actiontext (6.1.3.1)
37
- actionpack (= 6.1.3.1)
38
- activerecord (= 6.1.3.1)
39
- activestorage (= 6.1.3.1)
40
- activesupport (= 6.1.3.1)
36
+ actiontext (6.1.4.1)
37
+ actionpack (= 6.1.4.1)
38
+ activerecord (= 6.1.4.1)
39
+ activestorage (= 6.1.4.1)
40
+ activesupport (= 6.1.4.1)
41
41
  nokogiri (>= 1.8.5)
42
- actionview (6.1.3.1)
43
- activesupport (= 6.1.3.1)
42
+ actionview (6.1.4.1)
43
+ activesupport (= 6.1.4.1)
44
44
  builder (~> 3.1)
45
45
  erubi (~> 1.4)
46
46
  rails-dom-testing (~> 2.0)
47
47
  rails-html-sanitizer (~> 1.1, >= 1.2.0)
48
- activejob (6.1.3.1)
49
- activesupport (= 6.1.3.1)
48
+ activejob (6.1.4.1)
49
+ activesupport (= 6.1.4.1)
50
50
  globalid (>= 0.3.6)
51
- activemodel (6.1.3.1)
52
- activesupport (= 6.1.3.1)
53
- activerecord (6.1.3.1)
54
- activemodel (= 6.1.3.1)
55
- activesupport (= 6.1.3.1)
56
- activestorage (6.1.3.1)
57
- actionpack (= 6.1.3.1)
58
- activejob (= 6.1.3.1)
59
- activerecord (= 6.1.3.1)
60
- activesupport (= 6.1.3.1)
51
+ activemodel (6.1.4.1)
52
+ activesupport (= 6.1.4.1)
53
+ activerecord (6.1.4.1)
54
+ activemodel (= 6.1.4.1)
55
+ activesupport (= 6.1.4.1)
56
+ activestorage (6.1.4.1)
57
+ actionpack (= 6.1.4.1)
58
+ activejob (= 6.1.4.1)
59
+ activerecord (= 6.1.4.1)
60
+ activesupport (= 6.1.4.1)
61
61
  marcel (~> 1.0.0)
62
- mini_mime (~> 1.0.2)
63
- activesupport (6.1.3.1)
62
+ mini_mime (>= 1.1.0)
63
+ activesupport (6.1.4.1)
64
64
  concurrent-ruby (~> 1.0, >= 1.0.2)
65
65
  i18n (>= 1.6, < 2)
66
66
  minitest (>= 5.1)
@@ -74,23 +74,25 @@ GEM
74
74
  erubi (1.10.0)
75
75
  faker (2.15.1)
76
76
  i18n (>= 1.6, < 2)
77
- globalid (0.4.2)
78
- activesupport (>= 4.2.0)
77
+ globalid (0.5.2)
78
+ activesupport (>= 5.0)
79
79
  i18n (1.8.10)
80
80
  concurrent-ruby (~> 1.0)
81
- loofah (2.9.1)
81
+ loofah (2.12.0)
82
82
  crass (~> 1.0.2)
83
83
  nokogiri (>= 1.5.9)
84
84
  mail (2.7.1)
85
85
  mini_mime (>= 0.1.1)
86
86
  marcel (1.0.1)
87
87
  method_source (1.0.0)
88
- mini_mime (1.0.3)
89
- mini_portile2 (2.5.0)
88
+ mini_mime (1.1.1)
89
+ mini_portile2 (2.6.1)
90
90
  minitest (5.14.4)
91
- nio4r (2.5.7)
92
- nokogiri (1.11.3)
93
- mini_portile2 (~> 2.5.0)
91
+ nio4r (2.5.8)
92
+ nokogiri (1.12.4)
93
+ mini_portile2 (~> 2.6.1)
94
+ racc (~> 1.4)
95
+ nokogiri (1.12.4-x86_64-linux)
94
96
  racc (~> 1.4)
95
97
  parallel (1.20.1)
96
98
  parser (3.0.0.0)
@@ -99,36 +101,36 @@ GEM
99
101
  rack (2.2.3)
100
102
  rack-test (1.1.0)
101
103
  rack (>= 1.0, < 3)
102
- rails (6.1.3.1)
103
- actioncable (= 6.1.3.1)
104
- actionmailbox (= 6.1.3.1)
105
- actionmailer (= 6.1.3.1)
106
- actionpack (= 6.1.3.1)
107
- actiontext (= 6.1.3.1)
108
- actionview (= 6.1.3.1)
109
- activejob (= 6.1.3.1)
110
- activemodel (= 6.1.3.1)
111
- activerecord (= 6.1.3.1)
112
- activestorage (= 6.1.3.1)
113
- activesupport (= 6.1.3.1)
104
+ rails (6.1.4.1)
105
+ actioncable (= 6.1.4.1)
106
+ actionmailbox (= 6.1.4.1)
107
+ actionmailer (= 6.1.4.1)
108
+ actionpack (= 6.1.4.1)
109
+ actiontext (= 6.1.4.1)
110
+ actionview (= 6.1.4.1)
111
+ activejob (= 6.1.4.1)
112
+ activemodel (= 6.1.4.1)
113
+ activerecord (= 6.1.4.1)
114
+ activestorage (= 6.1.4.1)
115
+ activesupport (= 6.1.4.1)
114
116
  bundler (>= 1.15.0)
115
- railties (= 6.1.3.1)
117
+ railties (= 6.1.4.1)
116
118
  sprockets-rails (>= 2.0.0)
117
119
  rails-dom-testing (2.0.3)
118
120
  activesupport (>= 4.2.0)
119
121
  nokogiri (>= 1.6)
120
- rails-html-sanitizer (1.3.0)
122
+ rails-html-sanitizer (1.4.2)
121
123
  loofah (~> 2.3)
122
- railties (6.1.3.1)
123
- actionpack (= 6.1.3.1)
124
- activesupport (= 6.1.3.1)
124
+ railties (6.1.4.1)
125
+ actionpack (= 6.1.4.1)
126
+ activesupport (= 6.1.4.1)
125
127
  method_source
126
- rake (>= 0.8.7)
128
+ rake (>= 0.13)
127
129
  thor (~> 1.0)
128
130
  rainbow (3.0.0)
129
131
  rake (13.0.3)
130
132
  regexp_parser (2.1.1)
131
- rexml (3.2.4)
133
+ rexml (3.2.5)
132
134
  rspec (3.10.0)
133
135
  rspec-core (~> 3.10.0)
134
136
  rspec-expectations (~> 3.10.0)
@@ -171,7 +173,7 @@ GEM
171
173
  tzinfo (2.0.4)
172
174
  concurrent-ruby (~> 1.0)
173
175
  unicode-display_width (1.7.0)
174
- websocket-driver (0.7.3)
176
+ websocket-driver (0.7.5)
175
177
  websocket-extensions (>= 0.1.0)
176
178
  websocket-extensions (0.1.5)
177
179
  zeitwerk (2.4.2)
@@ -189,4 +191,4 @@ DEPENDENCIES
189
191
  voting_schemes-dummy!
190
192
 
191
193
  BUNDLED WITH
192
- 2.2.15
194
+ 2.2.27
@@ -1 +1 @@
1
- (()=>{"use strict";var e={d:(t,s)=>{for(var r in s)e.o(s,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:s[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{TrusteeWrapperAdapter:()=>r,VoterWrapperAdapter:()=>i});class s{constructor({trusteeId:e}){this.trusteeId=e,this.status=0,this.electionPublicKey=0}processMessage(e,t){switch(this.status){case 0:if("start_key_ceremony"===e)return this.status=1,this.electionPublicKey=2*Math.floor(50+200*Math.random())+1,{messageType:"key_ceremony.step_1",content:JSON.stringify({election_public_key:this.electionPublicKey,owner_id:this.trusteeId})};break;case 1:"end_key_ceremony"===e&&(this.status=2);break;case 2:"start_tally"===e&&(this.status=3);break;case 3:if("tally.cast"===e){const e=JSON.parse(t.content);for(const[t,s]of Object.entries(e))for(const[r,n]of Object.entries(s))e[t][r]=n%this.electionPublicKey*this.electionPublicKey;return{messageType:"tally.share",content:JSON.stringify({owner_id:this.trusteeId,contests:e})}}"end_tally"===e&&(this.status=4)}}isFresh(){return 0===this.status}backup(){return JSON.stringify(this)}restore(e){if(!this.isFresh())return console.warn("Restore not needed"),!1;const t=JSON.parse(e);if(t.trusteeId!==this.trusteeId)return console.warn("Invalid trustee id"),!1;if(0===t.status)return console.warn("Invalid restored status"),!1;try{Object.assign(this,t)}catch(e){return console.error(e),!1}return!0}isKeyCeremonyDone(){return this.status>=2}isTallyDone(){return this.status>=4}}class r{constructor({trusteeId:e}){this.trusteeId=e,this.wrapper=new s({trusteeId:e})}setup(){}processMessage(e,t){return this.wrapper.processMessage(e,t)}isFresh(){return this.wrapper.isFresh()}backup(){return this.wrapper.backup()}restore(e){return this.wrapper.restore(e)}isKeyCeremonyDone(){return this.wrapper.isKeyCeremonyDone()}isTallyDone(){return this.wrapper.isTallyDone()}}class n{constructor({voterId:e,waitTime:t}){this.voterId=e,this.jointElectionKey=null,this.contests={},this.waitTime=t??500}processMessage(e,t){switch(e){case"create_election":this.contests=t.description.contests;break;case"end_key_ceremony":{const e=JSON.parse(t.content);this.jointElectionKey=e.joint_election_key;break}}}async encrypt(e,t){return new Promise((e=>setTimeout(e,500))).then((()=>{if(!this.jointElectionKey)return void console.warn("Invalid election status.");const t=this.createAuditableBallot(e);return{auditableData:t,encryptedData:JSON.stringify(this.createEncryptedData(JSON.parse(JSON.stringify(t))))}}))}createAuditableBallot(e){return{ballot_style:"ballot-style",contests:this.contests.map((({object_id:t,ballot_selections:s})=>({object_id:t,ballot_selections:s.map((s=>{const r=Math.random(),n=e[t]&&e[t].includes(s.object_id)?1:0;return{object_id:s.object_id,ciphertext:n+Math.floor(500*r)*this.jointElectionKey,random:r,plaintext:n}}))})))}}createEncryptedData(e){return this.removeAuditInformation(e)}removeAuditInformation(e){return e.contests.map((e=>e.ballot_selections.map((e=>(delete e.random,delete e.plaintext,e))))),e}}class i{constructor({voterId:e,waitTime:t}){this.voterId=e,this.wrapper=new n({voterId:e,waitTime:t})}setup(){}processMessage(e,t){return this.wrapper.processMessage(e,t)}encrypt(e,t){return this.wrapper.encrypt(e,t)}}window.dummyVotingScheme=t})();
1
+ (()=>{"use strict";var e={d:(t,s)=>{for(var r in s)e.o(s,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:s[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{TrusteeWrapperAdapter:()=>r,VoterWrapperAdapter:()=>n});class s{constructor({trusteeId:e}){this.trusteeId=e,this.status=0,this.electionPublicKey=0,this.jointElectionKey=0,this.tallyCastMessage=null}processMessage(e,t){switch(this.status){case 0:if("start_key_ceremony"===e)return this.status=1,this.electionPublicKey=2*Math.floor(50+200*Math.random())+1,{messageType:"key_ceremony.step_1",content:JSON.stringify({election_public_key:this.electionPublicKey,owner_id:this.trusteeId})};break;case 1:if("end_key_ceremony"===e){const e=JSON.parse(t.content);this.jointElectionKey=e.joint_election_key,this.status=2}break;case 2:"start_tally"===e&&(this.status=3);break;case 3:if("tally.cast"===e){this.tallyCastMessage=t.content;const e=JSON.parse(this.tallyCastMessage);for(const[t,s]of Object.entries(e))for(const[r,i]of Object.entries(s))e[t][r]=i%this.electionPublicKey*this.electionPublicKey;return{messageType:"tally.share",content:JSON.stringify({owner_id:this.trusteeId,contests:e})}}if("tally.missing_trustee"===e){const e=JSON.parse(this.tallyCastMessage);for(const[t,s]of Object.entries(e))for(const[r,i]of Object.entries(s))e[t][r]=i%this.electionPublicKey*1*this.jointElectionKey/this.electionPublicKey/this.electionPublicKey;return{messageType:"tally.compensation",content:JSON.stringify({owner_id:this.trusteeId,trustee_id:t.trustee_id,contests:e})}}"end_tally"===e&&(this.status=4)}}isFresh(){return 0===this.status}backup(){return JSON.stringify(this)}restore(e){if(!this.isFresh())return console.warn("Restore not needed"),!1;const t=JSON.parse(e);if(t.trusteeId!==this.trusteeId)return console.warn("Invalid trustee id"),!1;if(0===t.status)return console.warn("Invalid restored status"),!1;try{Object.assign(this,t)}catch(e){return console.error(e),!1}return!0}isKeyCeremonyDone(){return this.status>=2}isTallyDone(){return this.status>=4}}class r{constructor({trusteeId:e}){this.trusteeId=e,this.wrapper=new s({trusteeId:e})}setup(){}processMessage(e,t){return this.wrapper.processMessage(e,t)}isFresh(){return this.wrapper.isFresh()}backup(){return this.wrapper.backup()}restore(e){return this.wrapper.restore(e)}isKeyCeremonyDone(){return this.wrapper.isKeyCeremonyDone()}isTallyDone(){return this.wrapper.isTallyDone()}}class i{constructor({voterId:e,waitTime:t}){this.voterId=e,this.jointElectionKey=null,this.contests={},this.waitTime=t??500}processMessage(e,t){switch(e){case"create_election":this.contests=t.description.contests;break;case"end_key_ceremony":{const e=JSON.parse(t.content);this.jointElectionKey=e.joint_election_key;break}}}async encrypt(e,t){return new Promise((e=>setTimeout(e,500))).then((()=>{if(!this.jointElectionKey)return void console.warn("Invalid election status.");const t=this.createAuditableBallot(e);return{auditableData:t,encryptedData:JSON.stringify(this.createEncryptedData(JSON.parse(JSON.stringify(t))))}}))}createAuditableBallot(e){return{ballot_style:"ballot-style",contests:this.contests.map((({object_id:t,ballot_selections:s})=>({object_id:t,ballot_selections:s.map((s=>{const r=Math.random(),i=e[t]&&e[t].includes(s.object_id)?1:0;return{object_id:s.object_id,ciphertext:i+Math.floor(500*r)*this.jointElectionKey,random:r,plaintext:i}}))})))}}createEncryptedData(e){return this.removeAuditInformation(e)}removeAuditInformation(e){return e.contests.map((e=>e.ballot_selections.map((e=>(delete e.random,delete e.plaintext,e))))),e}}class n{constructor({voterId:e,waitTime:t}){this.voterId=e,this.wrapper=new i({voterId:e,waitTime:t})}setup(){}processMessage(e,t){return this.wrapper.processMessage(e,t)}encrypt(e,t){return this.wrapper.encrypt(e,t)}}window.dummyVotingScheme=t})();
@@ -2,6 +2,6 @@
2
2
 
3
3
  module VotingSchemes
4
4
  module Dummy
5
- VERSION = "0.21.0"
5
+ VERSION = "0.22.1"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,17 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: voting_schemes-dummy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.21.0
4
+ version: 0.22.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Morcillo
8
8
  - Svenja Schäfer
9
9
  - Leonardo Diez
10
10
  - Agustí B.R.
11
- autorequire:
11
+ autorequire:
12
12
  bindir: exe
13
13
  cert_chain: []
14
- date: 2021-04-22 00:00:00.000000000 Z
14
+ date: 2021-09-06 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rails
@@ -68,6 +68,7 @@ files:
68
68
  - ".gitignore"
69
69
  - ".rspec"
70
70
  - ".rubocop.yml"
71
+ - ".ruby-version"
71
72
  - CHANGELOG.md
72
73
  - Gemfile
73
74
  - Gemfile.lock
@@ -85,7 +86,7 @@ homepage: https://github.com/decidim/decidim-bulletin-board
85
86
  licenses:
86
87
  - AGPL-3.0
87
88
  metadata: {}
88
- post_install_message:
89
+ post_install_message:
89
90
  rdoc_options: []
90
91
  require_paths:
91
92
  - lib
@@ -100,8 +101,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
100
101
  - !ruby/object:Gem::Version
101
102
  version: '0'
102
103
  requirements: []
103
- rubygems_version: 3.1.2
104
- signing_key:
104
+ rubygems_version: 3.0.3
105
+ signing_key:
105
106
  specification_version: 4
106
107
  summary: ''
107
108
  test_files: []