X-Git-Url: http://www.git.cypherpunks.ru/?a=blobdiff_plain;f=pygost%2Fgost28147_mac.py;h=7efda87a5cc6383905dfab88703734c3748e61a9;hb=9af4461c6af50f9cf83030867e7054d1f6311b32;hp=524b694633f474fb7fe941f39aaab0883c3b9a87;hpb=a2b4808f6628225be99874bd5f6a0f80a514db82;p=pygost.git diff --git a/pygost/gost28147_mac.py b/pygost/gost28147_mac.py index 524b694..7efda87 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-2020 Sergey Matveev +# Copyright (C) 2015-2021 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 @@ -13,7 +13,7 @@ # # You should have received a copy of the GNU General Public License # along with this program. If not, see . -""" GOST 28147-89 MAC +"""GOST 28147-89 MAC """ from copy import copy @@ -29,7 +29,7 @@ from pygost.gost28147 import xcrypt from pygost.gost3413 import pad1 from pygost.iface import PEP247 from pygost.utils import strxor -from pygost.utils import xrange # pylint: disable=redefined-builtin +from pygost.utils import xrange digest_size = 8 SEQ_MAC = ( @@ -39,7 +39,7 @@ SEQ_MAC = ( class MAC(PEP247): - """ GOST 28147-89 MAC mode of operation + """GOST 28147-89 MAC mode of operation >>> m = MAC(key=key) >>> m.update("some data") @@ -70,12 +70,12 @@ class MAC(PEP247): return MAC(self.key, copy(self.data), self.iv, self.sbox) def update(self, data): - """ Append data that has to be authenticated + """Append data that has to be authenticated """ self.data += data def digest(self): - """ Get MAC tag of supplied data + """Get MAC tag of supplied data You have to provide at least single byte of data. If you want to produce tag length of 3 bytes, then