]> Cypherpunks.ru repositories - pygost.git/blobdiff - pygost/gost28147_mac.py
Raise copyright years
[pygost.git] / pygost / gost28147_mac.py
index 0f7eda13154a04d371b130c5dc65a3044c67fa64..99dbc03288cc85a2b3d83f557c1031c5f7b6e249 100644 (file)
@@ -1,6 +1,6 @@
 # coding: utf-8
 # PyGOST -- Pure Python GOST cryptographic functions library
-# Copyright (C) 2015-2016 Sergey Matveev <stargrave@stargrave.org>
+# Copyright (C) 2015-2018 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
@@ -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)