示例#1
0
 def __init__(self, pkenc, key_len=16, mode=AES): 
     PKEnc.__init__(self)
     # check that pkenc satisfies properties of a pkenc scheme
     if hasattr(pkenc, 'keygen') and hasattr(pkenc, 'encrypt') and hasattr(pkenc, 'decrypt'):
         self.pkenc = pkenc
         self.key_len = key_len # 128-bit session key by default
         self.alg = mode
         if debug: print("PKEnc satisfied.")
示例#2
0
 def __init__(self,
              padding=SAEPEncryptionPadding(),
              redundancy=InMessageRedundancy(),
              params=None):
     Rabin.__init__(self)
     PKEnc.__init__(self)
     self.paddingscheme = padding
     self.redundancyscheme = redundancy
 def __init__(self, groupObj, p=0, q=0):
     PKEnc.__init__(self)
     global group
     global lt
     global lk
     lt=lk=160
     group = groupObj
     group.p, group.q, group.r = p, q, 2
 def __init__(self, par, p=0):
     '''
     initializes an ElGamal object with the number of parameters and the pairing group
     '''
     PKEnc.__init__(self)
     global group
     self.params = par
     group = PairingGroup('BN254')
 def __init__(self, pkenc, key_len=16, mode=AES):
     PKEnc.__init__(self)
     # check that pkenc satisfies properties of a pkenc scheme
     if hasattr(pkenc, 'keygen') and hasattr(pkenc, 'encrypt') and hasattr(
             pkenc, 'decrypt'):
         self.pkenc = pkenc
         self.key_len = key_len  # 128-bit session key by default
         self.alg = mode
         if debug: print("PKEnc satisfied.")
示例#6
0
 def __init__(self, groupObj):
     PKEnc.__init__(self)
     global group
     group = groupObj
示例#7
0
 def __init__(self, groupObj, p=0, q=0):
     PKEnc.__init__(self)
     global group
     group = groupObj
     if group.groupSetting() == 'integer':
         group.p, group.q, group.r = p, q, 2
示例#8
0
 def __init__(self, padding=OAEPEncryptionPadding(), params=None):
     RSA.__init__(self)
     PKEnc.__init__(self)
     self.paddingscheme = padding
示例#9
0
 def __init__(self, groupObj):
     PKEnc.__init__(self)
     global group
     group = groupObj
 def __init__(self, groupObj, p=0, q=0):
     PKEnc.__init__(self)
     global group
     group = groupObj
     if group.groupSetting() == 'integer':
         group.p, group.q, group.r = p, q, 2
 def __init__(self, groupObj, p=0, q=0):
     PKEnc.__init__(self)
     global group
     group = groupObj
     group.p, group.q, group.r = p, q, 2
示例#12
0
 def __init__(self):
     PKEnc.__init__(self)
     self.k = None
示例#13
0
 def __init__(self, padding=SAEPEncryptionPadding(), redundancy=InMessageRedundancy(), params=None):
     Rabin.__init__(self)
     PKEnc.__init__(self)
     self.paddingscheme = padding 
     self.redundancyscheme = redundancy
示例#14
0
文件: pkenc_rsa.py 项目: FinalF/charm
 def __init__(self, padding=OAEPEncryptionPadding(), params=None):
     RSA.__init__(self)
     PKEnc.__init__(self)
     self.paddingscheme = padding 
示例#15
0
文件: HIKE.py 项目: Pica4x6/HIKE
 def __init__(self, groupObj):
     PKEnc.__init__(self)
     global group
     group = groupObj
     self.isbyte = True
     self.pp = self.setup()
示例#16
0
 def __init__(self):
     PKEnc.__init__(self)
     self.group = RSAGroup()