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

All Samples(13)  |  Call(11)  |  Derive(0)  |  Import(2)

src/s/w/swiftarm-HEAD/tribler/Tribler/dispersy/member.py   swiftarm(Download)
if __debug__:
    from dprint import dprint
    from crypto import ec_check_public_bin, ec_check_private_bin
 
class DummyMember(object):
        assert isinstance(public_key, str)
        assert isinstance(private_key, str)
        assert ec_check_public_bin(public_key), public_key.encode("HEX")
        assert private_key == "" or ec_check_private_bin(private_key), private_key.encode("HEX")
 
    def __new__(cls, public_key, private_key=""):
        assert isinstance(public_key, str)
        assert isinstance(private_key, str)
        assert ec_check_public_bin(public_key), [len(public_key), public_key.encode("HEX")]
        assert private_key == "" or ec_check_private_bin(private_key), [len(private_key), private_key.encode("HEX")]
    def __new__(cls, public_key, private_key=""):
        assert isinstance(public_key, str)
        assert isinstance(private_key, str)
        assert ec_check_public_bin(public_key), [len(public_key), public_key.encode("HEX")]
        assert private_key == "" or ec_check_private_bin(private_key), [len(private_key), private_key.encode("HEX")]

src/s/w/swiftarm-HEAD/tribler/Tribler/dispersy/conversion.py   swiftarm(Download)
from authentication import NoAuthentication, MemberAuthentication, MultiMemberAuthentication
from bloomfilter import BloomFilter
from crypto import ec_check_public_bin
from destination import MemberDestination, CommunityDestination, CandidateDestination, SubjectiveDestination
from dispersydatabase import DispersyDatabase
 
        key = data[offset:offset+key_length]
        if not ec_check_public_bin(key):
            raise DropPacket("Invalid cryptographic key (_decode_missing_message)")
        member = self._community.dispersy.get_member(key)
 
        key = data[offset:offset+key_length]
        if not ec_check_public_bin(key):
            raise DropPacket("Invalid cryptographic key (_decode_missing_message)")
        member = self._community.dispersy.get_member(key)
 
            key = data[offset:offset+key_length]
            if not ec_check_public_bin(key):
                raise DropPacket("Invalid cryptographic key (_decode_authorize)")
            member = self._community.dispersy.get_member(key)
 
            key = data[offset:offset+key_length]
            if not ec_check_public_bin(key):
                raise DropPacket("Invalid cryptographic key (_decode_revoke)")
            member = self._community.dispersy.get_member(key)