# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+from os import urandom
+from random import randint
from unittest import skip
from unittest import TestCase
import hmac
self.assertSequenceEqual(m.digest(), c.digest())
+class TestSymmetric(TestCase):
+ def runTest(self):
+ chunks = []
+ for _ in range(randint(1, 10)):
+ chunks.append(urandom(randint(20, 80)))
+ m = GOST34112012256()
+ for chunk in chunks:
+ m.update(chunk)
+ self.assertSequenceEqual(
+ m.hexdigest(),
+ GOST34112012256(b"".join(chunks)).hexdigest(),
+ )
+
+
class TestHMAC(TestCase):
"""RFC 7836
"""