summaryrefslogtreecommitdiff
path: root/python/lilliput_ae_2.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/lilliput_ae_2.py')
-rw-r--r--python/lilliput_ae_2.py32
1 files changed, 8 insertions, 24 deletions
diff --git a/python/lilliput_ae_2.py b/python/lilliput_ae_2.py
index ed57cdf..aeebe27 100644
--- a/python/lilliput_ae_2.py
+++ b/python/lilliput_ae_2.py
@@ -221,19 +221,11 @@ def SCT2Enc(A, M, N, key) :
A = ArrayToBlockbytesMatrix(A)
M = ArrayToBlockbytesMatrix(M)
+ K = list(key)
- ltbc.KEY_BITS = KEY_BITS
- ltbc.TWEAK_BITS = TWEAK_BITS
- ltbc.LANES = LANES
-
- ltbc.TWEAKEY_BITS = TWEAKEY_BITS
- ltbc.KEY_BYTES = KEY_BYTES
- ltbc.TWEAK_BYTES = TWEAK_BYTES
- ltbc.TWEAKEY_BYTES = TWEAKEY_BYTES
-
- Auth = BuildAuth(A, key)
- tag = MesssageAuthTag(M, N, Auth, key)
- C = MessageEncryption(M, N, tag, key)
+ Auth = BuildAuth(A, K)
+ tag = MesssageAuthTag(M, N, Auth, K)
+ C = MessageEncryption(M, N, tag, K)
return BlockbytesMatrixToBytes(C), bytes(tag)
@@ -249,19 +241,11 @@ def SCT2Dec(A, C, N, tag, key) :
A = ArrayToBlockbytesMatrix(A)
C = ArrayToBlockbytesMatrix(C)
+ K = list(key)
- ltbc.KEY_BITS = KEY_BITS
- ltbc.TWEAK_BITS = TWEAK_BITS
- ltbc.LANES = LANES
-
- ltbc.TWEAKEY_BITS = TWEAKEY_BITS
- ltbc.KEY_BYTES = KEY_BYTES
- ltbc.TWEAK_BYTES = TWEAK_BYTES
- ltbc.TWEAKEY_BYTES = TWEAKEY_BYTES
-
- M = MessageEncryption(C, N, tag, key)
- Auth = BuildAuth(A, key)
- tag2 = MesssageAuthTag(M, N, Auth, key)
+ M = MessageEncryption(C, N, tag, K)
+ Auth = BuildAuth(A, K)
+ tag2 = MesssageAuthTag(M, N, Auth, K)
if(tag == tag2) :
return BlockbytesMatrixToBytes(M)