keys: adjust error type

pull/267/head
Bogdan Opanchuk 2021-04-18 21:33:10 -07:00
parent 4f6f1741b7
commit 768ac3ae9e
2 changed files with 4 additions and 4 deletions

View File

@ -57,7 +57,7 @@ def test_secret_key_str():
def test_secret_key_hash():
sk = SecretKey.random()
# Insecure Python hash, shouldn't be available.
with pytest.raises(NotImplementedError):
with pytest.raises(RuntimeError):
hash(sk)
@ -70,7 +70,7 @@ def test_secret_key_factory_str():
def test_secret_key_factory_hash():
skf = SecretKeyFactory.random()
# Insecure Python hash, shouldn't be available.
with pytest.raises(NotImplementedError):
with pytest.raises(RuntimeError):
hash(skf)

View File

@ -44,7 +44,7 @@ class SecretKey(Serializable):
return f"{self.__class__.__name__}:..."
def __hash__(self):
raise NotImplementedError("Hashing secret objects is not secure")
raise RuntimeError("Hashing secret objects is not secure")
def secret_scalar(self):
return self._scalar_key
@ -162,4 +162,4 @@ class SecretKeyFactory(Serializable):
return f"{self.__class__.__name__}:..."
def __hash__(self):
raise NotImplementedError("Hashing secret objects is not secure")
raise RuntimeError("Hashing secret objects is not secure")