diff options
| author | Kévin Le Gouguec <kevin.legouguec@airbus.com> | 2019-03-14 17:17:50 +0100 |
|---|---|---|
| committer | Kévin Le Gouguec <kevin.legouguec@airbus.com> | 2019-03-21 14:49:15 +0100 |
| commit | 6d62f24fc34dae3c28f1b1cfed664bde3edbb1ec (patch) | |
| tree | 85aff9aa33aacbe6a6c5d93abf56cb4332c30efb /python/lilliput_ae_2.py | |
| parent | 60707e26d3068a43e0caa7973a4fb88428443738 (diff) | |
| download | lilliput-ae-implem-6d62f24fc34dae3c28f1b1cfed664bde3edbb1ec.tar.xz | |
[implem-python] Ajustement de l'API externe
Utilisation d'une enum, pour que les valeurs possibles soient
explicites.
Renommage des points d'entrée pour qu'ils soient uniformes et
interchangeables.
Transformation du tag en liste plus bas pour que lilliput.py ne se
soucie pas des détails d'implémentation des fonctions en-dessous.
Diffstat (limited to 'python/lilliput_ae_2.py')
| -rw-r--r-- | python/lilliput_ae_2.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/python/lilliput_ae_2.py b/python/lilliput_ae_2.py index cb1d1c4..f455f43 100644 --- a/python/lilliput_ae_2.py +++ b/python/lilliput_ae_2.py @@ -98,7 +98,7 @@ def MessageEncryption(M, N, tag, key) : return C ################################################################################ -def SCT2Enc(A, M, N, key) : +def encrypt(A, M, N, key) : K = list(key) Auth = BuildAuth(TWEAK_BITS, A, K) @@ -108,8 +108,9 @@ def SCT2Enc(A, M, N, key) : return BlockbytesMatrixToBytes(C), bytes(tag) -def SCT2Dec(A, C, N, tag, key) : +def decrypt(A, C, N, tag, key) : K = list(key) + tag = list(tag) M = BlockbytesMatrixToBytes( MessageEncryption(C, N, tag, K) |
