diff options
-rw-r--r-- | cryptography/hazmat/primitives/kdf/hkdf.py | 2 | ||||
-rw-r--r-- | tests/hazmat/primitives/test_hkdf.py | 22 |
2 files changed, 12 insertions, 12 deletions
diff --git a/cryptography/hazmat/primitives/kdf/hkdf.py b/cryptography/hazmat/primitives/kdf/hkdf.py index 959e8c9b..7dae2b6c 100644 --- a/cryptography/hazmat/primitives/kdf/hkdf.py +++ b/cryptography/hazmat/primitives/kdf/hkdf.py @@ -79,7 +79,7 @@ class HKDF(object): return self._expand(key_material) def _expand(self, key_material): - output = [b''] + output = [b""] counter = 1 while (self._algorithm.digest_size // 8) * len(output) < self._length: diff --git a/tests/hazmat/primitives/test_hkdf.py b/tests/hazmat/primitives/test_hkdf.py index bd896cef..028a08af 100644 --- a/tests/hazmat/primitives/test_hkdf.py +++ b/tests/hazmat/primitives/test_hkdf.py @@ -43,10 +43,10 @@ class TestHKDF(object): backend=backend ) - hkdf.derive(b'\x01' * 16) + hkdf.derive(b"\x01" * 16) with pytest.raises(exceptions.AlreadyFinalized): - hkdf.derive(b'\x02' * 16) + hkdf.derive(b"\x02" * 16) hkdf = HKDF( hashes.SHA256(), @@ -56,10 +56,10 @@ class TestHKDF(object): backend=backend ) - hkdf.verify(b'\x01' * 16, b'gJ\xfb{\xb1Oi\xc5sMC\xb7\xe4@\xf7u') + hkdf.verify(b"\x01" * 16, b"gJ\xfb{\xb1Oi\xc5sMC\xb7\xe4@\xf7u") with pytest.raises(exceptions.AlreadyFinalized): - hkdf.verify(b'\x02' * 16, b'gJ\xfb{\xb1Oi\xc5sMC\xb7\xe4@\xf7u') + hkdf.verify(b"\x02" * 16, b"gJ\xfb{\xb1Oi\xc5sMC\xb7\xe4@\xf7u") def test_verify(self, backend): hkdf = HKDF( @@ -70,7 +70,7 @@ class TestHKDF(object): backend=backend ) - hkdf.verify(b'\x01' * 16, b'gJ\xfb{\xb1Oi\xc5sMC\xb7\xe4@\xf7u') + hkdf.verify(b"\x01" * 16, b"gJ\xfb{\xb1Oi\xc5sMC\xb7\xe4@\xf7u") def test_verify_invalid(self, backend): hkdf = HKDF( @@ -82,14 +82,14 @@ class TestHKDF(object): ) with pytest.raises(exceptions.InvalidKey): - hkdf.verify(b'\x02' * 16, b'gJ\xfb{\xb1Oi\xc5sMC\xb7\xe4@\xf7u') + hkdf.verify(b"\x02" * 16, b"gJ\xfb{\xb1Oi\xc5sMC\xb7\xe4@\xf7u") def test_unicode_typeerror(self, backend): with pytest.raises(TypeError): - HKDF(hashes.SHA256(), 16, salt=u'foo', info=None, backend=backend) + HKDF(hashes.SHA256(), 16, salt=u"foo", info=None, backend=backend) with pytest.raises(TypeError): - HKDF(hashes.SHA256(), 16, salt=None, info=u'foo', backend=backend) + HKDF(hashes.SHA256(), 16, salt=None, info=u"foo", backend=backend) with pytest.raises(TypeError): hkdf = HKDF( @@ -100,7 +100,7 @@ class TestHKDF(object): backend=backend ) - hkdf.derive(u'foo') + hkdf.derive(u"foo") with pytest.raises(TypeError): hkdf = HKDF( @@ -111,7 +111,7 @@ class TestHKDF(object): backend=backend ) - hkdf.verify(u'foo', b'bar') + hkdf.verify(u"foo", b"bar") with pytest.raises(TypeError): hkdf = HKDF( @@ -122,4 +122,4 @@ class TestHKDF(object): backend=backend ) - hkdf.verify(b'foo', u'bar') + hkdf.verify(b"foo", u"bar") |