Exemplo n.º 1
0
 def __init__(self, groupObj):
     IBEnc.__init__(self)
     IBEnc.setProperty(self, secdef='IND_ID_CPA', assumption='DBDH', secmodel='Standard')
     #, other={'id':ZR}
     #message_space=[GT, 'KEM']
     global group
     group = groupObj
Exemplo n.º 2
0
 def __init__(self, groupObj):
     IBEnc.__init__(self)
     IBEnc.setProperty(self, secdef="IND_ID_CPA", assumption="DBDH", secmodel="Standard")
     # , other={'id':ZR}
     # message_space=[GT, 'KEM']
     global group
     group = groupObj
Exemplo n.º 3
0
 def __init__(self, groupObj):
     IBEnc.__init__(self)
     #IBEnc.setProperty(self, secdef='IND_ID_CPA', assumption='DBDH', secmodel='Standard')
     #, other={'id':ZR}
     #message_space=[GT, 'KEM']
     global group
     group = groupObj
     global waters_hash
     waters_hash = Waters(group)
Exemplo n.º 4
0
 def __init__(self, groupObj):
     IBEnc.__init__(self)
     IBEnc.setProperty(self,
                       secdef='IND_sID_CPA',
                       assumption='DBDH',
                       message_space=[GT, 'KEM'],
                       secmodel='ROM',
                       other={'id': ZR})
     global group
     group = groupObj
Exemplo n.º 5
0
 def extract(self, mk, ID):
     if not self.ibe_good: return IBEnc.extract(self, mk, ID)
     if type(ID) == str:
         ID2 = self.group.hash(ID)
         return self.ibenc.extract(mk, ID2)
     else:
         assert False, "invalid type on ID."
Exemplo n.º 6
0
 def encrypt(self, pk, ID, msg):
     if not self.ibe_good: return IBEnc.encrypt(self, pk, ID, msg)
     if type(ID) == str:
         ID2 = self.group.hash(ID)
         return self.ibenc.encrypt(pk, ID2, msg)
     else:
         assert False, "invalid type on ID."
Exemplo n.º 7
0
 def extract(self, mk, ID):
     if not self.ibe_good: return IBEnc.extract(self, mk, ID)
     if type(ID) == str:
         ID2 = self.group.hash(ID)
         return self.ibenc.extract(mk, ID2)
     else:
         assert False, "invalid type on ID."
Exemplo n.º 8
0
 def encrypt(self, pk, ID, msg):
     if not self.ibe_good: return IBEnc.encrypt(self, pk, ID, msg)
     if type(ID) == str:
         ID2 = self.group.hash(ID)
         return self.ibenc.encrypt(pk, ID2, msg)
     else:
         assert False, "invalid type on ID."
Exemplo n.º 9
0
    def __init__(self, scheme, group):
        IBEnc.__init__(self)
        self.group = group
        self.ibe_good = False
        # validate that we have the appropriate object
        
        if IBEnc.checkProperty(self, scheme, {'scheme':self.baseSchemeTypes.IBEnc, 
                                        'secdef':self.baseSecDefs.sIND_ID_CPA, 
                                        'id':ZR}):
            self.ibenc = scheme
            # change our property as well
            IBEnc.setProperty(self, secdef='IND_ID_CPA', other={'id':str}, secmodel='ROM')
            # check message space?
            self.ibe_good = True

        if not self.ibe_good:
            assert False, "ibe object does not satisfy requirements."
Exemplo n.º 10
0
    def __init__(self, scheme, group):
        IBEnc.__init__(self)
        self.group = group
        self.ibe_good = False
        # validate that we have the appropriate object

        if IBEnc.checkProperty(
                self, scheme, {
                    'scheme': self.baseSchemeTypes.IBEnc,
                    'secdef': self.baseSecDefs.sIND_ID_CPA,
                    'id': ZR
                }):
            self.ibenc = scheme
            # change our property as well
            IBEnc.setProperty(self,
                              secdef='IND_ID_CPA',
                              other={'id': str},
                              secmodel='ROM')
            # check message space?
            self.ibe_good = True

        if not self.ibe_good:
            assert False, "ibe object does not satisfy requirements."
Exemplo n.º 11
0
 def __init__(self, groupObj):
     IBEnc.__init__(self)
     global group,h
     group = groupObj
     h = Hash('sha1', group)
Exemplo n.º 12
0
 def __init__(self, groupObj):
     IBEnc.__init__(self)
     global group, util
     group = groupObj
Exemplo n.º 13
0
 def __init__(self, groupObj):
     IBEnc.__init__(self)
     global group, H, util
     group = groupObj
     H = lambda x: group.hash(('0', x), ZR)
     util = SecretShare(group, False)
Exemplo n.º 14
0
 def decrypt(self, pk, sk, ct):
     if not self.ibe_good: return IBEnc.decrypt(self, pk, sk, ct)
     return self.ibenc.decrypt(pk, sk, ct)
Exemplo n.º 15
0
 def setup(self):
     if not self.ibe_good: return IBEnc.setup(self)
     return self.ibenc.setup()
Exemplo n.º 16
0
 def decrypt(self, pk, sk, ct):
     if not self.ibe_good: return IBEnc.decrypt(self, pk, sk, ct)
     return self.ibenc.decrypt(pk, sk, ct)
Exemplo n.º 17
0
 def __init__(self, groupObj):
     IBEnc.__init__(self)
     global group, H, util
     group = groupObj
     H = lambda x: group.hash(('0', x), ZR)
     util = SecretShare(group, False)
Exemplo n.º 18
0
 def __init__(self, groupObj):
     IBEnc.__init__(self)
     global group
     group = groupObj
Exemplo n.º 19
0
 def __init__(self, groupObj):
     IBEnc.__init__(self)
     #IBEnc.setProperty(self, message_space=[GT, 'KEM'], secdef='IND_sID_CPA', assumption='DBDH', secmodel='ROM', other={'id':ZR})
     global group
     group = groupObj
Exemplo n.º 20
0
 def setup(self):
     if not self.ibe_good: return IBEnc.setup(self)
     return self.ibenc.setup()