Beispiel #1
0
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'',
        )
Beispiel #2
0
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,
        )
Beispiel #3
0
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,
        )
Beispiel #4
0
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,
        )
Beispiel #5
0
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'',
        )
Beispiel #6
0
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,
        )
Beispiel #7
0
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'
Beispiel #8
0
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'