Manuel Pégourié-Gonnard
366e1b0464
aria: fix comment on aria_a function
The new version of the comment has been generated by the following python3
script, when the first constant is copy-pasted from RFC 5794 2.4.3.
#!/usr/bin/python3
RFC_A = """
y0 = x3 ^ x4 ^ x6 ^ x8 ^ x9 ^ x13 ^ x14,
y1 = x2 ^ x5 ^ x7 ^ x8 ^ x9 ^ x12 ^ x15,
y2 = x1 ^ x4 ^ x6 ^ x10 ^ x11 ^ x12 ^ x15,
y3 = x0 ^ x5 ^ x7 ^ x10 ^ x11 ^ x13 ^ x14,
y4 = x0 ^ x2 ^ x5 ^ x8 ^ x11 ^ x14 ^ x15,
y5 = x1 ^ x3 ^ x4 ^ x9 ^ x10 ^ x14 ^ x15,
y6 = x0 ^ x2 ^ x7 ^ x9 ^ x10 ^ x12 ^ x13,
y7 = x1 ^ x3 ^ x6 ^ x8 ^ x11 ^ x12 ^ x13,
y8 = x0 ^ x1 ^ x4 ^ x7 ^ x10 ^ x13 ^ x15,
y9 = x0 ^ x1 ^ x5 ^ x6 ^ x11 ^ x12 ^ x14,
y10 = x2 ^ x3 ^ x5 ^ x6 ^ x8 ^ x13 ^ x15,
y11 = x2 ^ x3 ^ x4 ^ x7 ^ x9 ^ x12 ^ x14,
y12 = x1 ^ x2 ^ x6 ^ x7 ^ x9 ^ x11 ^ x12,
y13 = x0 ^ x3 ^ x6 ^ x7 ^ x8 ^ x10 ^ x13,
y14 = x0 ^ x3 ^ x4 ^ x5 ^ x9 ^ x11 ^ x14,
y15 = x1 ^ x2 ^ x4 ^ x5 ^ x8 ^ x10 ^ x15.
"""
matrix = []
for l in RFC_A.split('\n')[1:-1]:
rhs = l.split('=')[1][:-1]
row = tuple(hex(int(t[2:]))[2:] for t in rhs.split('^'))
matrix.append(row)
out = {}
out['a'] = tuple(''.join(w) for w in zip(*(matrix[0:4])))
out['b'] = tuple(''.join(w) for w in zip(*(matrix[4:8])))
out['c'] = tuple(''.join(w) for w in zip(*(matrix[8:12])))
out['d'] = tuple(''.join(w) for w in zip(*(matrix[12:])))
out2 = {}
for o, r in out.items():
row = list(r)
for i in range(len(r) - 1):
w1 = row[i]
if len(set(w1)) == 2:
w2 = row[i+1]
nw1 = nw2 = ''
for j in range(len(w1)):
if w1[j] in nw1:
nw1 += w2[j]
nw2 += w1[j]
else:
nw1 += w1[j]
nw2 += w2[j]
row[i] = nw1
row[i+1] = nw2
out2[o] = row
for o in 'abcd':
print(o, '=', ' + '.join(out[o]))
print(' ', '=', ' + '.join(out2[o]))
2018-03-01 14:48:10 +01:00
..
2015-06-25 10:59:56 +02:00
2018-01-02 16:24:29 +01:00
2016-05-23 14:29:28 +01:00
2016-05-23 14:29:32 +01:00
2018-03-01 14:48:10 +01:00
2016-10-13 13:54:14 +01:00
2016-08-25 15:42:27 +01:00
2017-02-15 23:31:07 +02:00
2017-10-18 12:41:30 +01:00
2016-05-23 14:29:32 +01:00
2016-06-07 14:52:35 +01:00
2017-04-04 11:37:15 +02:00
2017-07-27 21:44:33 +01:00
2018-02-27 12:39:12 +01:00
2017-12-23 23:40:08 +01:00
2018-01-02 15:55:55 +01:00
2018-02-27 12:39:12 +01:00
2018-02-10 11:11:41 +02:00
2017-02-15 09:08:26 +00:00
2016-05-23 14:29:32 +01:00
2018-01-26 18:43:04 +00:00
2017-10-10 19:04:27 +03:00
2018-01-09 10:42:03 +00:00
2018-01-24 10:36:22 +00:00
2017-05-11 22:42:14 +01:00
2017-10-17 15:19:38 +01:00
2016-06-12 00:31:33 +01:00
2018-01-25 17:28:31 +00:00
2018-03-01 09:25:05 +01:00
2018-01-02 16:24:29 +01:00
2016-05-23 23:18:26 +01:00
2017-06-26 10:22:24 +01:00
2018-02-27 12:39:12 +01:00
2018-02-22 10:24:30 +00:00
2018-02-22 10:24:30 +00:00
2018-02-22 10:24:30 +00:00
2018-01-22 11:54:42 +01:00
2018-01-25 17:28:31 +00:00
2016-05-23 14:29:29 +01:00
2017-11-29 20:49:21 +01:00
2018-02-08 17:18:15 +08:00
2015-09-04 14:21:07 +02:00
2018-01-25 17:28:31 +00:00
2017-12-22 10:24:32 +00:00
2017-08-04 13:32:15 +01:00
2018-02-08 17:18:15 +08:00
2015-09-04 14:21:07 +02:00
2016-05-23 14:29:28 +01:00
2018-02-14 17:20:42 +01:00
2017-08-23 16:17:27 +01:00
2017-12-20 12:52:49 +01:00
2018-02-22 10:24:30 +00:00
2018-01-03 09:27:40 +00:00
2018-01-25 17:28:31 +00:00
2018-02-22 10:24:30 +00:00
2018-02-22 10:24:30 +00:00
2018-02-22 10:24:30 +00:00
2017-10-29 17:53:52 +02:00
2018-02-27 12:39:12 +01:00
2018-01-19 11:25:10 +01:00
2017-03-02 12:26:11 +00:00
2018-01-26 18:43:04 +00:00
2016-07-13 14:46:18 +01:00
2018-02-27 12:39:12 +01:00
2017-07-27 21:44:32 +01:00
2018-01-29 10:24:50 +01:00
2018-02-27 12:39:12 +01:00
2015-09-04 14:21:07 +02:00
2015-10-21 12:50:45 +02:00
2017-07-27 21:44:34 +01:00
2018-02-06 15:59:38 +02:00
2017-07-27 21:44:34 +01:00
2017-10-12 23:21:37 +01:00
2018-01-22 11:54:42 +01:00
2017-09-22 16:05:43 +01:00
2015-09-04 14:21:07 +02:00