X-Git-Url: http://www.git.cypherpunks.ru/?a=blobdiff_plain;f=pygost%2Fgost28147_mac.py;h=64712c6da5090e5d9e9cf86e9c26a82fcec92459;hb=5e92533267cb41c42af1243592c530304d18bff5;hp=0f7eda13154a04d371b130c5dc65a3044c67fa64;hpb=34c9c9a4f95eecfee75fc36d75d2ee45d1054a25;p=pygost.git diff --git a/pygost/gost28147_mac.py b/pygost/gost28147_mac.py index 0f7eda1..64712c6 100644 --- a/pygost/gost28147_mac.py +++ b/pygost/gost28147_mac.py @@ -1,11 +1,10 @@ # coding: utf-8 # PyGOST -- Pure Python GOST cryptographic functions library -# Copyright (C) 2015-2016 Sergey Matveev +# Copyright (C) 2015-2020 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 -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. +# the Free Software Foundation, version 3 of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -29,7 +28,6 @@ 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 @@ -51,7 +49,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 +94,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)