Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Improved coverage with signing #97

merged 1 commit into from

3 participants


No description provided.


I think after this there's no more "obvious" coverage missing, it's all handling failures in NaCl itself that I have no idea how to trigger.


Some of those failure scenarios can likely be switched to asserts. Looking at the libsodium source I've seen a few functions that return an int, but it's always zero.


Coverage Status

Coverage increased (+0.95%) when pulling bcfecfa on alex:signing-coverage into b8863b8 on pyca:master.

@reaperhulk reaperhulk merged commit aba4272 into pyca:master
@alex alex deleted the alex:signing-coverage branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jul 16, 2014
  1. @alex

    Improved coverage with signing

    alex authored
This page is out of date. Refresh to see the latest.
Showing with 15 additions and 1 deletion.
  1. +15 −1 tests/
16 tests/
@@ -47,10 +47,17 @@ def ed25519_known_answers():
class TestSigningKey:
def test_initialize_with_generate(self):
+ def test_wrong_length(self):
+ with pytest.raises(ValueError):
+ nacl.signing.SigningKey(b"")
+ def test_bytes(self):
+ k = nacl.signing.SigningKey(b"\x00" * nacl.c.crypto_sign_SEEDBYTES)
+ assert bytes(k) == b"\x00" * nacl.c.crypto_sign_SEEDBYTES
@pytest.mark.parametrize("seed", [
@@ -80,6 +87,13 @@ def test_message_signing(self, seed, message, signature, expected):
class TestVerifyKey:
+ def test_wrong_length(self):
+ with pytest.raises(ValueError):
+ nacl.signing.VerifyKey(b"")
+ def test_bytes(self):
+ k = nacl.signing.VerifyKey(b"\x00" * nacl.c.crypto_sign_PUBLICKEYBYTES)
+ assert bytes(k) == b"\x00" * nacl.c.crypto_sign_PUBLICKEYBYTES
("public_key", "signed", "message", "signature"),
Something went wrong with that request. Please try again.