Skip to content
This repository was archived by the owner on Jul 15, 2022. It is now read-only.

add an int() to make the i/4 be a interger rather than a float #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions aes.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def text2matrix(text):
if i % 4 == 0:
matrix.append([byte])
else:
matrix[i / 4].append(byte)
matrix[int(i / 4)].append(byte)
return matrix


Expand All @@ -106,7 +106,7 @@ def change_key(self, master_key):
if i % 4 == 0:
byte = self.round_keys[i - 4][0] \
^ Sbox[self.round_keys[i - 1][1]] \
^ Rcon[i / 4]
^ Rcon[int(i / 4)]
self.round_keys[i].append(byte)

for j in range(1, 4):
Expand Down