summaryrefslogtreecommitdiff
path: root/python/lilliput_ae_1.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/lilliput_ae_1.py')
-rw-r--r--python/lilliput_ae_1.py35
1 files changed, 1 insertions, 34 deletions
diff --git a/python/lilliput_ae_1.py b/python/lilliput_ae_1.py
index 8cf55bb..9de753c 100644
--- a/python/lilliput_ae_1.py
+++ b/python/lilliput_ae_1.py
@@ -15,32 +15,9 @@ from helpers import (
)
-KEY_BITS = 128
TWEAK_BITS = 192
-TWEAKEY_BITS = KEY_BITS + TWEAK_BITS
-LANE_BITS = 64
-LANES = int((TWEAKEY_BITS) / LANE_BITS)
+TWEAK_BYTES = TWEAK_BITS//8
-KEY_BYTES = int(KEY_BITS / 8)
-TWEAK_BYTES = int(TWEAK_BITS / 8)
-TWEAKEY_BYTES = int(TWEAKEY_BITS / 8)
-
-
-def InitParameters(key_bits) :
- global KEY_BITS
- global KEY_BYTES
- global TWEAKEY_BITS
- global TWEAKEY_BYTES
- global LANES
-
- KEY_BITS = key_bits
- TWEAKEY_BITS = KEY_BITS + TWEAK_BITS
- LANES = int((TWEAKEY_BITS) / LANE_BITS)
- KEY_BYTES = int(KEY_BITS / 8)
- TWEAKEY_BYTES = int(TWEAKEY_BITS / 8)
-
-
-###############################################################################
def LowPart(array, number_bits) :
shifted = 0
@@ -64,11 +41,6 @@ def LowPart(array, number_bits) :
return lower_part_byte
-###############################################################################
-
-
-
-################################################################################
class _MessageTweak(Enum):
BLOCK = 0b000
@@ -156,11 +128,8 @@ def TreatMessageDec(C, N, key) :
return (Final, M)
-
################################################################################
def OCB3Enc(A, M, N, key) :
- InitParameters(len(key)*8)
-
K = list(key)
Auth = BuildAuth(TWEAK_BITS, A, K)
@@ -171,8 +140,6 @@ def OCB3Enc(A, M, N, key) :
def OCB3Dec(A, C, N, tag, key) :
- InitParameters(len(key)*8)
-
K = list(key)
Auth = BuildAuth(TWEAK_BITS, A, K)