]> Cypherpunks.ru repositories - pygost.git/blobdiff - pygost/gost28147_mac.py
Unify quotes
[pygost.git] / pygost / gost28147_mac.py
index 0f7eda13154a04d371b130c5dc65a3044c67fa64..64712c6da5090e5d9e9cf86e9c26a82fcec92459 100644 (file)
@@ -1,11 +1,10 @@
 # coding: utf-8
 # PyGOST -- Pure Python GOST cryptographic functions library
-# Copyright (C) 2015-2016 Sergey Matveev <stargrave@stargrave.org>
+# Copyright (C) 2015-2020 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
-# 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)