# coding: utf-8
# PyGOST -- Pure Python GOST cryptographic functions library
-# Copyright (C) 2015-2016 Sergey Matveev <stargrave@stargrave.org>
+# Copyright (C) 2015-2017 Sergey Matveev <stargrave@stargrave.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
"""
from pygost.utils import strxor
-from pygost.utils import xrange
+from pygost.utils import xrange # pylint: disable=redefined-builtin
LC = bytearray((
# optimization.
# Actually it can be computed only once and saved on the disk.
########################################################################
+
+
GF = [bytearray(256) for _ in xrange(256)]
+
for x in xrange(256):
for y in xrange(256):
GF[x][y] = gf(x, y)
# Precalculate values of the C -- it does not depend on key.
# Actually it can be computed only once and saved on the disk.
########################################################################
+
+
C = []
+
for x in range(1, 33):
y = bytearray(16)
y[15] = x
return L([PI[v] for v in blk])
-class GOST3412Kuz(object):
+class GOST3412Kuznechik(object):
"""GOST 34.12-2015 128-bit block cipher Кузнечик (Kuznechik)
"""
def __init__(self, key):