# coding: utf-8
# PyGOST -- Pure Python GOST cryptographic functions library
-# Copyright (C) 2015-2020 Sergey Matveev <stargrave@stargrave.org>
+# Copyright (C) 2015-2021 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
class ECBTest(TestCase):
def test_gcl(self):
- """ Test vectors from libgcl3
+ """Test vectors from libgcl3
"""
sbox = "id-Gost28147-89-TestParamSet"
key = hexdec(b"0475f6e05038fbfad2c7c390edb3ca3d1547124291ae1e8a2f79cd9ed2bcefbd")
self.assertSequenceEqual(decrypted, plaintext)
def test_cryptopp(self):
- """ Test vectors from Crypto++ 5.6.2
+ """Test vectors from Crypto++ 5.6.2
"""
sbox = "AppliedCryptography"
data = (
self.assertSequenceEqual(ecb_encrypt(key, pt, sbox=sbox), ct)
def test_cryptomanager(self):
- """ Test vector from http://cryptomanager.com/tv.html
+ """Test vector from http://cryptomanager.com/tv.html
"""
sbox = "id-GostR3411-94-TestParamSet"
key = hexdec(b"75713134B60FEC45A607BB83AA3746AF4FF99DA6D1B53B5B1B402A1BAA030D1B")
class CFBTest(TestCase):
def test_cryptomanager(self):
- """ Test vector from http://cryptomanager.com/tv.html
+ """Test vector from http://cryptomanager.com/tv.html
"""
key = hexdec(b"75713134B60FEC45A607BB83AA3746AF4FF99DA6D1B53B5B1B402A1BAA030D1B")
sbox = "id-GostR3411-94-TestParamSet"
)
def test_steps(self):
- """ Check step-by-step operation manually
+ """Check step-by-step operation manually
"""
key = urandom(KEYSIZE)
iv = urandom(BLOCKSIZE)
self.assertSequenceEqual(step[:4], ciphertext[16:])
def test_random(self):
- """ Random data with various sizes
+ """Random data with various sizes
"""
key = urandom(KEYSIZE)
iv = urandom(BLOCKSIZE)
class CTRTest(TestCase):
def test_gcl(self):
- """ Test vectors from libgcl3
+ """Test vectors from libgcl3
"""
sbox = "id-Gost28147-89-TestParamSet"
key = hexdec(b"0475f6e05038fbfad2c7c390edb3ca3d1547124291ae1e8a2f79cd9ed2bcefbd")
self.assertSequenceEqual(decrypted, plaintext)
def test_gcl2(self):
- """ Test vectors 2 from libgcl3
+ """Test vectors 2 from libgcl3
"""
sbox = "id-Gost28147-89-TestParamSet"
key = hexdec(b"fc7ad2886f455b50d29008fa622b57d5c65b3c637202025799cadf0768519e8a")