Skip to content

Commit

Permalink
Add roundtrip encrypt-decrypt test using hypothesis.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ayrx committed Mar 21, 2015
1 parent b746eb6 commit c7ef488
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/test_with_hypothesis.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from hypothesis import given

from aead import AEAD


@given(bytes, bytes)
def test_round_trip_encrypt_decrypt(plaintext, associated_data):
cryptor = AEAD(AEAD.generate_key())
ct = cryptor.encrypt(plaintext, associated_data)
assert plaintext == cryptor.decrypt(ct, associated_data)

0 comments on commit c7ef488

Please sign in to comment.