# Path: typtop/pw_pkcrypto.py



from typtop.pw_pkcrypto import (
    generate_key_pair, pkencrypt, pkdecrypt,
    encrypt, decrypt, hmac256, compute_id,
    serialize_pk, serialize_sk, deserialize_sk,
    deserialize_pk, verify_pk_sk, harden_pw, verify,
    pwencrypt, pwdecrypt, pad_pw, unpad_pw
)
from base64 import urlsafe_b64encode, urlsafe_b64decode
import struct
import os
import pytest
        'aflashdfhaasdfadsf',
        'asdfkjashdflkashld'[:16],
        'The best secret message ever written by any human!!'
    ]
    pk, sk = generate_key_pair()
    for m in msgs:
        c = pkencrypt(pk, unicode(m))
        assert pkdecrypt(sk, c) == m
    assert pkdecrypt(sk, unicode(c)) == m

def test_fail_pwencrypt():
    msgs = [
        'aflashdfhaasdfadsf',
        'asdfkjashdflkashld'[:16],
        'The best secret message ever written by any human!!'
    ]
    pwd = 'Mysecretpass'
    for m in msgs:
        c = pwencrypt(pwd, unicode(m))
        with pytest.raises(ValueError) as excinfo:
            pwdecrypt(pwd+'1', c)

def test_pwencrypt():
    msgs = [
        'aflashdfhaasdfadsf',
        'asdfkjashdflkashld'[:16],
        'The best secret message ever written by any human!!'
    ]
    pwd = 'Mysecretpass'
    for m in msgs:

# Path: typtop/pw_pkcrypto.py



# Path: tests/test_pw_pkcrypto2.py
from typtop.pw_pkcrypto import (
    generate_key_pair, pkencrypt, pkdecrypt,
    encrypt, decrypt, hmac256, compute_id,
    serialize_pk, serialize_sk, deserialize_sk,
    deserialize_pk, verify_pk_sk, harden_pw, verify,
    pwencrypt, pwdecrypt, pad_pw, unpad_pw
)
from base64 import urlsafe_b64encode, urlsafe_b64decode
import struct
import os
import pytest

        'aflashdfhaasdfadsf',
        'asdfkjashdflkashld'[:16],
        'The best secret message ever written by any human!!'
    ]
    pk, sk = generate_key_pair()
    for m in msgs:
        c = pkencrypt(pk, unicode(m))
        assert pkdecrypt(sk, c) == m
    assert pkdecrypt(sk, unicode(c)) == m

def test_fail_pwencrypt():
    msgs = [
        'aflashdfhaasdfadsf',
        'asdfkjashdflkashld'[:16],
        'The best secret message ever written by any human!!'
    ]
    pwd = 'Mysecretpass'
    for m in msgs:
        c = pwencrypt(pwd, unicode(m))
        with pytest.raises(ValueError) as excinfo:
            pwdecrypt(pwd+'1', c)

def test_pwencrypt():
    msgs = [
        'aflashdfhaasdfadsf',
        'asdfkjashdflkashld'[:16],
        'The best secret message ever written by any human!!'
    ]
    pwd = 'Mysecretpass'
    for m in msgs:

        c = pwencrypt(pwd, unicode(m))