From 0d0ecee46d6e5d47ff390cbaa254bf0d560d504f Mon Sep 17 00:00:00 2001 From: Kévin Le Gouguec Date: Mon, 25 Mar 2019 09:10:33 +0100 Subject: [implem-python] Ajustements de forme --- src/add_python/lilliput/ae_common.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/add_python/lilliput/ae_common.py') diff --git a/src/add_python/lilliput/ae_common.py b/src/add_python/lilliput/ae_common.py index 83db056..b94be1b 100644 --- a/src/add_python/lilliput/ae_common.py +++ b/src/add_python/lilliput/ae_common.py @@ -51,8 +51,12 @@ def pad10(X): return zeroes + [0b10000000] + X +def integer_to_byte_array(i, n): + return list(i.to_bytes(n, 'little')) + + def _tweak_associated_data(t, i, padded): - tweak = list(i.to_bytes(t//8, 'little')) + tweak = integer_to_byte_array(i, t//8) prefix = 0b0110 if padded else 0b0010 -- cgit v1.2.3