Utilities/crypto/py3AES.py

changeset 3034
7ce719013078
parent 3019
7912530a33e2
child 3039
8dd0165d805d
equal deleted inserted replaced
3033:58fe260e7469 3034:7ce719013078
660 firstRound = True 660 firstRound = True
661 if input: 661 if input:
662 for j in range(int(math.ceil(float(len(input)) / 16))): 662 for j in range(int(math.ceil(float(len(input)) / 16))):
663 start = j * 16 663 start = j * 16
664 end = j * 16 + 16 664 end = j * 16 + 16
665 if end > len(input): 665 if end > len(input):
666 end = len(input) 666 end = len(input)
667 plaintext = self.__extractBytes(input, start, end, mode) 667 plaintext = self.__extractBytes(input, start, end, mode)
668 # print 'PT@%s:%s' % (j, plaintext) 668 # print 'PT@%s:%s' % (j, plaintext)
669 if mode == self.ModeOfOperation["CFB"]: 669 if mode == self.ModeOfOperation["CFB"]:
670 if firstRound: 670 if firstRound:
749 plaintext = bytearray(16) 749 plaintext = bytearray(16)
750 # the output bytes 750 # the output bytes
751 bytesOut = bytearray() 751 bytesOut = bytearray()
752 # char firstRound 752 # char firstRound
753 firstRound = True 753 firstRound = True
754 if cipherIn != None: 754 if cipherIn is not None:
755 for j in range(int(math.ceil(float(len(cipherIn)) / 16))): 755 for j in range(int(math.ceil(float(len(cipherIn)) / 16))):
756 start = j * 16 756 start = j * 16
757 end = j * 16 + 16 757 end = j * 16 + 16
758 if j * 16 + 16 > len(cipherIn): 758 if j * 16 + 16 > len(cipherIn):
759 end = len(cipherIn) 759 end = len(cipherIn)

eric ide

mercurial