summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/add_python/lilliput/ae_mode_2.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/add_python/lilliput/ae_mode_2.py b/src/add_python/lilliput/ae_mode_2.py
index a486bc9..2349757 100644
--- a/src/add_python/lilliput/ae_mode_2.py
+++ b/src/add_python/lilliput/ae_mode_2.py
@@ -69,8 +69,7 @@ def _message_auth_tag(M, N, Auth, key):
if need_padding:
tweak = _tweak_tag(l, True)
- m_padded = pad10(M[l])
- encryption = tbc.encrypt(tweak, key, m_padded)
+ encryption = tbc.encrypt(tweak, key, pad10(M[l]))
tag = xor(tag, encryption)
tweak = N + [0b00010000]
@@ -89,14 +88,12 @@ def _message_encryption(M, N, tag, key):
for j in range(0, l):
tweak = _add_tag_j(tag, j)
- padded_nonce = N + [0b00000000]
- encryption = tbc.encrypt(tweak, key, padded_nonce)
+ encryption = tbc.encrypt(tweak, key, N+[0b00000000])
C.append(xor(M[j], encryption))
if need_padding:
tweak = _add_tag_j(tag, l)
- padded_nonce = N + [0b00000000]
- encryption = tbc.encrypt(tweak, key, padded_nonce)
+ encryption = tbc.encrypt(tweak, key, N+[0b00000000])
C.append(xor(M[l], encryption))
return C