2017-01-16 13:05:53 +00:00
|
|
|
from fontTools.misc.eexec import decrypt, encrypt
|
|
|
|
|
|
|
|
|
|
|
|
def test_decrypt():
|
|
|
|
testStr = b"\0\0asdadads asds\265"
|
|
|
|
decryptedStr, R = decrypt(testStr, 12321)
|
2022-12-13 11:26:36 +00:00
|
|
|
assert decryptedStr == b"0d\nh\x15\xe8\xc4\xb2\x15\x1d\x108\x1a<6\xa1"
|
2017-01-16 13:05:53 +00:00
|
|
|
assert R == 36142
|
|
|
|
|
|
|
|
|
|
|
|
def test_encrypt():
|
2022-12-13 11:26:36 +00:00
|
|
|
testStr = b"0d\nh\x15\xe8\xc4\xb2\x15\x1d\x108\x1a<6\xa1"
|
2017-01-16 13:05:53 +00:00
|
|
|
encryptedStr, R = encrypt(testStr, 12321)
|
|
|
|
assert encryptedStr == b"\0\0asdadads asds\265"
|
|
|
|
assert R == 36142
|