Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(24)  |  Call(19)  |  Derive(0)  |  Import(5)
Returns a general-use AESCounterPRNG, initializing it if necessary.

        def getCommonPRNG():
    '''Returns a general-use AESCounterPRNG, initializing it if necessary.'''
    # We create one PRNG per thread.
    thisThread = threading.currentThread()
    try:
        return thisThread.minion_shared_PRNG
    except AttributeError:
        thisThread.minion_shared_PRNG = AESCounterPRNG()
        return thisThread.minion_shared_PRNG
        


src/m/i/mixminion-HEAD/lib/mixminion/BuildMessage.py   mixminion(Download)
    assert overhead in (0, ENC_FWD_OVERHEAD)
    if paddingPRNG is None:
        paddingPRNG = Crypto.getCommonPRNG()
    origLength = len(message)
    payload = compressData(message)
def buildRandomPayload(paddingPRNG=None):
    """Return a new random payload, suitable for use in a DROP packet."""
    if not paddingPRNG:
        paddingPRNG = Crypto.getCommonPRNG()
    return paddingPRNG.getBytes(PAYLOAD_LEN)
    """
    if paddingPRNG is None:
        paddingPRNG = Crypto.getCommonPRNG()
    if not path1:
        raise MixError("First leg of path is empty")
    """
    if paddingPRNG is None:
        paddingPRNG = Crypto.getCommonPRNG()
    if secretRNG is None: secretRNG = paddingPRNG
 
    """
    if paddingPRNG is None:
        paddingPRNG = Crypto.getCommonPRNG()
 
    LOG.debug("Encoding reply message for %s-byte payload",

src/m/i/mixminion-HEAD/lib/mixminion/ClientUtils.py   mixminion(Download)
     createPrivateDir, floorDiv, previousMidnight, readFile, \
     succeedingMidnight, writeFile, armorText, unarmorText, MixFatalError
from mixminion.Crypto import sha1, ctr_crypt, DIGEST_LEN, AES_KEY_LEN, \
     getCommonPRNG, trng
 
       and uses the filetype 'magic'."""
    assert len(magic) == MAGIC_LEN
    prng = getCommonPRNG()
    length = struct.pack("!L", len(data))
    paddingLen = ceilDiv(len(data), 1024)*1024 - len(data)

src/m/i/mixminion-HEAD/lib/mixminion/Fragments.py   mixminion(Download)
import mixminion._minionlib
import mixminion.Filestore
from mixminion.Crypto import ceilDiv, getCommonPRNG, sha1, whiten, unwhiten
from mixminion.Common import disp64, LOG, previousMidnight, MixError, \
     MixFatalError
           them into a random order.)"""
        if paddingPRNG is None:
            paddingPRNG = getCommonPRNG()
 
        self.getFEC()

src/m/i/mixminion-HEAD/lib/mixminion/MMTPClient.py   mixminion(Download)
import mixminion.ServerInfo
import mixminion.TLSConnection
from mixminion.Crypto import sha1, getCommonPRNG
from mixminion.Common import MixProtocolError, MixProtocolReject, \
     MixProtocolBadAuth, LOG, MixError, formatBase64, stringContains, \

src/m/i/mixminion-HEAD/lib/mixminion/ClientDirectory.py   mixminion(Download)
 
        if prng is None:
            prng = mixminion.Crypto.getCommonPRNG()
 
        path1, path2 = pathSpec.path1[:], pathSpec.path2[:]
            endAt = startAt + DEFAULT_REQUIRED_LIFETIME
        if prng is None:
            prng = mixminion.Crypto.getCommonPRNG()
 
        # Resolve explicitly-provided servers (we already warned.)
    def getServerNames(self):
        if self.n is not None:
            n = self.n
        else:
            prng = mixminion.Crypto.getCommonPRNG()

src/m/i/mixminion-HEAD/lib/mixminion/server/ServerQueue.py   mixminion(Download)
     createPrivateDir, readPickled, writePickled, formatTime, readFile, \
     ceilDiv
from mixminion.Crypto import getCommonPRNG
from mixminion.Filestore import CorruptedFile
 
            return []
        msgProbability = n / float(count)
        rng = getCommonPRNG()
        return rng.shuffle([ h for h in self.getAllMessages()
                             if rng.getFloat() < msgProbability ])
    def getBatch(self):
        msgProbability = self._getFraction()
        rng = getCommonPRNG()
        return rng.shuffle([ h for h in self.getAllMessages()
                             if rng.getFloat() < msgProbability ])

src/m/i/mixminion-HEAD/lib/mixminion/server/Pinger.py   mixminion(Download)
    def addLinkPadding(self, pkts):
        prng = mixminion.Crypto.getCommonPRNG()
        addressSet = {}
        for s in self.directory.getAllServers():
            addressSet[s.getRoutingInfo()]=1

src/m/i/mixminion-HEAD/lib/mixminion/server/ServerMain.py   mixminion(Download)
    def updateDirectoryClient(self, reschedulePings=1):
        try:
            self.dirClient.update()
            nextUpdate = succeedingMidnight(time.time()+30)
            prng = mixminion.Crypto.getCommonPRNG()

src/m/i/mixminion-HEAD/lib/mixminion/ClientMain.py   mixminion(Download)
 
        # Initialize PRNG
        self.prng = mixminion.Crypto.getCommonPRNG()
        self.queue = mixminion.ClientUtils.ClientQueue(os.path.join(userdir, "queue"))
        self.pool = mixminion.ClientUtils.ClientFragmentPool(os.path.join(userdir, "fragments"))

src/m/i/mixminion-HEAD/lib/mixminion/Filestore.py   mixminion(Download)
from mixminion.Common import MixError, MixFatalError, secureDelete, LOG, \
     createPrivateDir, readFile, replaceFile, tryUnlink, writePickled
from mixminion.Crypto import getCommonPRNG
 
__all__ = [ "StringStore", "StringMetadataStore",