Skip to content
Snippets Groups Projects
Select Git revision
  • dda86f900a5a0571e8c14551971bb21a63f865ec
  • test default protected
  • master protected
  • original
  • pirati-backup protected
  • beta-2
  • beta-1
  • v3.1.4
  • v3.1.3
  • v3.1.2
  • v3.1.1
  • v3.1.0
  • v3.0.16
  • v3.0.15
  • v3.0.14
  • v3.0.13
  • v3.0.12
  • v3.0.11
  • v3.0.10
  • v3.0.9
  • v3.0.8
  • v3.0.7
  • v3.0.6
  • v3.0.5
  • v3.0.4
25 results

helios_trustee_decrypt.py

Blame
  • helios_trustee_decrypt.py 1022 B
    """
    decrypt elections where Helios is trustee
    
    DEPRECATED
    
    Ben Adida
    ben@adida.net
    2010-05-22
    """
    
    from django.core.management.base import BaseCommand
    
    from helios.models import Trustee
    
    
    class Command(BaseCommand):
        args = ''
        help = 'decrypt elections where helios is the trustee'
        
        def handle(self, *args, **options):
            # query for elections where decryption is ready to go and Helios is the trustee
            active_helios_trustees = Trustee.objects.exclude(secret_key = None).exclude(election__encrypted_tally = None).filter(decryption_factors = None)
    
            # for each one, do the decryption
            for t in active_helios_trustees:
                tally = t.election.encrypted_tally
    
                # FIXME: this should probably be in the encrypted_tally getter
                tally.init_election(t.election)
    
                factors, proof = tally.decryption_factors_and_proofs(t.secret_key)
                t.decryption_factors = factors
                t.decryption_proofs = proof
                t.save()