- for ( uint8_t i=0; i<8; ++i){
- if ( i%2 == 0) {
- calc[0] += v[i];
- calc[1] += NibbleHigh( v[i]);
- calc[2] += NibbleLow( v[i]);
- calc[3] ^= v[i];
- calc[4] ^= NibbleHigh(v[i]);
- calc[5] ^= NibbleLow( v[i]);
- }
- else {
- calc[6] += v[i];
- calc[7] += NibbleHigh( v[i]);
- calc[8] += NibbleLow( v[i]);
- calc[9] ^= v[i];
- calc[10] ^= NibbleHigh(v[i]);
- calc[11] ^= NibbleLow( v[i]);
- }
- }
- for ( uint8_t i=0; i<4; ++i) calc[12] += v[i];
- for ( uint8_t i=1; i<5; ++i) calc[13] += v[i];
- for ( uint8_t i=2; i<6; ++i) calc[14] += v[i];
- for ( uint8_t i=3; i<7; ++i) calc[15] += v[i];
+ PrintAndLog("TEST LE enc| %s", sprint_hex(v_ptr, 8));
+
+ tea_decrypt(v_ptr, key_ptr);
+ PrintAndLog("TEST LE dec | %s", sprint_hex_ascii(v_ptr, 8));
+
+ tea_encrypt(v_ptr, key_ptr);
+ tea_encrypt(v_ptr, key_ptr);
+ PrintAndLog("TEST enc2 | %s", sprint_hex_ascii(v_ptr, 8));