예제 #1
0
 def test_normal_other(self):
     actual = tea_encrypt('''AaBbcdfja0123456789!@#$%^*()_+~`=|\:";;'?/>.:''',
                          '''!@#$%^*()_+~`=|\:";;'?/>.:''',
                          32)
     expect = [0xeb9ececf, 0x40701d52, 0xf20bb308, 0xb251c4db, 0x8c3343d9, 0xfcb3811e\
             , 0xb65a307, 0xb8f2bc2f, 0x356824b3, 0xc739ef7, 0x2e3e2f3f, 0x3a]
     eq_(expect, actual)
예제 #2
0
 def test_wrong_round(self):
     actual = tea_encrypt('abcdefgh', 'key', 60)
     expect = []
     eq_(expect, actual)
예제 #3
0
 def test_less_than_eight(self):
     actual = tea_encrypt('player', 'key', 64)
     expect = _string_to_longs('player')
     eq_(expect, actual)
예제 #4
0
 def test_normal(self):
     actual = tea_encrypt('abcdefgh', 'key', 64)
     expect = [0xcfee8a3d, 0xaf8b1016]
     eq_(expect, actual)
예제 #5
0
 def test_empty(self):
     actual = tea_encrypt('', '', 16)
     expect = []
     eq_(expect, actual)