예제 #1
0
파일: cbc.py 프로젝트: TerryLo/onchipsdk-1
    def decrypt(self, cipherText, iv=None, more=None):
        """ CBC decryption - overloads baseCipher to allow optional explicit IV
            when iv=None, iv is auto generated!
        """
        if self.decryptBlockCount == 0:
            self.iv = iv
        else:
            assert(iv==None), 'IV used only on first call to decrypt'

        return BlockCipher.decrypt(self, cipherText, more=more)
예제 #2
0
    def decrypt(self, cipherText, iv=None, more=None):
        """ CBC decryption - overloads baseCipher to allow optional explicit IV
            when iv=None, iv is auto generated!
        """
        if self.decryptBlockCount == 0:
            self.iv = iv
        else:
            assert (iv == None), 'IV used only on first call to decrypt'

        return BlockCipher.decrypt(self, cipherText, more=more)
예제 #3
0
파일: cbc.py 프로젝트: TerryLo/onchipsdk-1
 def resetDecrypt(self):
     BlockCipher.resetDecrypt(self)  # reset CBC state (super class)
     self.baseCipher.resetDecrypt()  # reset base cipher decrypt state
예제 #4
0
파일: cbc.py 프로젝트: TerryLo/onchipsdk-1
 def resetEncrypt(self):
     BlockCipher.resetEncrypt(self)  # reset CBC encrypt state (super class)
     self.baseCipher.resetEncrypt()  # reset base cipher encrypt state
예제 #5
0
 def resetDecrypt(self):
     BlockCipher.resetDecrypt(self)  # reset CBC state (super class)
     self.baseCipher.resetDecrypt()  # reset base cipher decrypt state
예제 #6
0
 def resetEncrypt(self):
     BlockCipher.resetEncrypt(self)  # reset CBC encrypt state (super class)
     self.baseCipher.resetEncrypt()  # reset base cipher encrypt state