def test_crypto_box_open_invalid_sk(nonce, pk): with pytest.raises(AssertionError): crypto_box_open( c=b'x' * 100, nonce=nonce, pk=pk, sk=b'', )
def test_crypto_box_open_failure(nonce, pk, sk): with pytest.raises(ValueError): crypto_box_open( c=b'x' * 100, nonce=nonce, pk=pk, sk=sk, )
def test_crypto_box_open_invalid_nonce(pk, sk): with pytest.raises(AssertionError): crypto_box_open( c=b'x' * 100, nonce=b'', pk=pk, sk=sk, )
def test_crypto_box_open(nonce, pk, sk): c = crypto_box( msg=b'foo', nonce=nonce, pk=pk, sk=sk, ) msg = crypto_box_open( c=c, nonce=nonce, pk=pk, sk=sk, ) assert msg == b'foo'