示例#1
0
文件: verdict.py 项目: ineiti/prifi
 def test_basic(self):
     group = schnorr.verdict_1024()
     self.basic(group)
示例#2
0
文件: dcnet.py 项目: ineiti/prifi
from Crypto.Cipher import AES
from Crypto.Hash import SHA256
from Crypto.Util import Counter
from Crypto.Util.number import long_to_bytes, bytes_to_long

import verdict

from cells.null import NullDecoder, NullEncoder
from certify.encrypted_exchange import EncryptedAccumulator, EncryptedCertifier
from certify.null import NullAccumulator, NullCertifier
from certify.signature import SignatureAccumulator, SignatureCertifier

from elgamal import PublicKey, PrivateKey
import schnorr

global_group = schnorr.verdict_1024()

cell_length = 24
empty_cell = bytes(0 for x in range(cell_length))

class XorNet:
    def __init__(self, secrets, interval):
        self.secrets = secrets
        self.interval = interval
        self.cell_count = {}

    def produce_ciphertext(self, nym_idx):
        if nym_idx not in self.cell_count:
            self.cell_count[nym_idx] = 0

        ciphertext = bytes(0 for x in range(cell_length))
示例#3
0
from Crypto.Cipher import AES
from Crypto.Hash import SHA256
from Crypto.Util import Counter
from Crypto.Util.number import long_to_bytes, bytes_to_long

import verdict

from cells.null import NullDecoder, NullEncoder
from certify.encrypted import EncryptedAccumulator, EncryptedCertifier
from certify.null import NullAccumulator, NullCertifier
from certify.signature import SignatureAccumulator, SignatureCertifier

from elgamal import PublicKey, PrivateKey
import schnorr

global_group = schnorr.verdict_1024()

cell_length = 24
empty_cell = bytes(0 for x in range(cell_length))


class XorNet:
    def __init__(self, secrets, interval):
        self.secrets = secrets
        self.interval = interval
        self.cell_count = {}

    def produce_ciphertext(self, nym_idx):
        if nym_idx not in self.cell_count:
            self.cell_count[nym_idx] = 0
示例#4
0
 def test_basic(self):
     group = schnorr.verdict_1024()
     self.basic(group)