File: test_xormask.py

package info (click to toggle)
python-wsaccel 0.6.3-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 160 kB
  • sloc: python: 370; makefile: 41; ansic: 16
file content (9 lines) | stat: -rw-r--r-- 321 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
from wsaccel.xormask import XorMaskerSimple

def test_xormasker():
    masker = XorMaskerSimple(b'\xf0\xf0\x0f\x0f')
    assert b'\xf0\xf0\x0f\x0f\xf0\xf0' == masker.process(b'\x00'*6)
    assert masker.pointer() == 6
    assert b'\x0f\x0f\xf0\xf0\x0f\x0f' == masker.process(b'\x00'*6)
    assert masker.pointer() == 12