X-Git-Url: http://www.git.cypherpunks.ru/?a=blobdiff_plain;f=pygost%2Fgost28147_mac.py;h=99dbc03288cc85a2b3d83f557c1031c5f7b6e249;hb=4ff0adf8cb4b497daa634e2430a4fd015a2bb427;hp=0f7eda13154a04d371b130c5dc65a3044c67fa64;hpb=34c9c9a4f95eecfee75fc36d75d2ee45d1054a25;p=pygost.git diff --git a/pygost/gost28147_mac.py b/pygost/gost28147_mac.py index 0f7eda1..99dbc03 100644 --- a/pygost/gost28147_mac.py +++ b/pygost/gost28147_mac.py @@ -1,6 +1,6 @@ # coding: utf-8 # PyGOST -- Pure Python GOST cryptographic functions library -# Copyright (C) 2015-2016 Sergey Matveev +# Copyright (C) 2015-2018 Sergey Matveev # # 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 @@ -29,9 +29,8 @@ from pygost.gost28147 import validate_sbox from pygost.gost28147 import xcrypt from pygost.gost3413 import pad1 from pygost.iface import PEP247 -from pygost.utils import hexenc from pygost.utils import strxor -from pygost.utils import xrange +from pygost.utils import xrange # pylint: disable=redefined-builtin digest_size = 8 SEQ_MAC = ( @@ -51,7 +50,7 @@ class MAC(PEP247): """ digest_size = digest_size - def __init__(self, key, data=b'', iv=8 * b'\x00', sbox=DEFAULT_SBOX): + def __init__(self, key, data=b"", iv=8 * b"\x00", sbox=DEFAULT_SBOX): """ :param key: authentication key :type key: bytes, 32 bytes @@ -96,9 +95,6 @@ class MAC(PEP247): )[::-1] return ns2block(prev) - def hexdigest(self): - return hexenc(self.digest()) - -def new(key, data=b'', iv=8 * b'\x00', sbox=DEFAULT_SBOX): +def new(key, data=b"", iv=8 * b"\x00", sbox=DEFAULT_SBOX): return MAC(key, data, iv, sbox)