<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -479,7 +479,7 @@ class EGCiphertext:
           print &quot;bad proof %s, %s, %s&quot; % (i, plaintexts[i], proof.proofs[i])
           return False
           
-      logging.info(&quot;made it past the two encryption proofs&quot;)
+      # logging.info(&quot;made it past the two encryption proofs&quot;)
           
       # check the overall challenge
       return (challenge_generator([p.commitment for p in proof.proofs]) == (sum([p.challenge for p in proof.proofs]) % self.pk.q))</diff>
      <filename>crypto/algs.py</filename>
    </modified>
    <modified>
      <diff>@@ -10,14 +10,14 @@ indexes:
 # automatically uploaded to the admin console when you next deploy
 # your application using appcfg.py.
 
-# Unused in query history -- copied from input.
+# Used once in query history.
 - kind: ElectionExponent
   properties:
   - name: election
   - name: exponent
     direction: desc
 
-# Used once in query history.
+# Used 6 times in query history.
 - kind: KeyShare
   properties:
   - name: election
@@ -43,7 +43,7 @@ indexes:
   - name: tallied_at
   - name: cast_id
 
-# Used once in query history.
+# Used 9 times in query history.
 - kind: Voter
   properties:
   - name: election</diff>
      <filename>index.yaml</filename>
    </modified>
    <modified>
      <diff>@@ -300,6 +300,17 @@ class VoterBase(DBObject):
     self.password = utils.random_string(10)
 
   def set_encrypted_vote(self, votes_json_string):
+    # Check the proof on the vote
+    pk = self.election.get_pk()
+    election_obj = self.election.toElection()
+    vote_dict = utils.from_json(votes_json_string)
+    enc_vote = electionalgs.EncryptedVote.fromJSONDict(vote_dict, pk)
+    
+    # verify
+    if not enc_vote.verify(election_obj):
+      raise Exception(&quot;Vote does not verify&quot;)
+      
+    # store this current vote in the voter structure
     self.vote = votes_json_string
     self.vote_hash = self.compute_vote_hash()
     self.cast_id = str(datetime.datetime.utcnow()) + str(self.voter_id)</diff>
      <filename>models/modelsbase.py</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>94653c012a4688461ae0b4af95b24865df0fcda7</id>
    </parent>
  </parents>
  <author>
    <name>Ben Adida</name>
    <email>ben@adida.net</email>
  </author>
  <url>http://github.com/benadida/helios/commit/c5d28c55e15b036d8e4b6f4f3481cef1598befee</url>
  <id>c5d28c55e15b036d8e4b6f4f3481cef1598befee</id>
  <committed-date>2008-11-16T13:23:42-08:00</committed-date>
  <authored-date>2008-11-16T13:23:42-08:00</authored-date>
  <message>added proof verification at submission time</message>
  <tree>e0ac8ddee63f49869c856e2dff67dc59d399138e</tree>
  <committer>
    <name>Ben Adida</name>
    <email>ben@adida.net</email>
  </committer>
</commit>
