File: eexec_test.py

package info (click to toggle)
fonttools 4.61.1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 27,584 kB
  • sloc: python: 145,091; xml: 103; makefile: 24
file content (15 lines) | stat: -rw-r--r-- 458 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
from fontTools.misc.eexec import decrypt, encrypt


def test_decrypt():
    testStr = b"\0\0asdadads asds\265"
    decryptedStr, R = decrypt(testStr, 12321)
    assert decryptedStr == b"0d\nh\x15\xe8\xc4\xb2\x15\x1d\x108\x1a<6\xa1"
    assert R == 36142


def test_encrypt():
    testStr = b"0d\nh\x15\xe8\xc4\xb2\x15\x1d\x108\x1a<6\xa1"
    encryptedStr, R = encrypt(testStr, 12321)
    assert encryptedStr == b"\0\0asdadads asds\265"
    assert R == 36142