Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve performance of decryption loop #1

Merged
merged 1 commit into from Dec 4, 2012

Conversation

sulix
Copy link
Contributor

@sulix sulix commented Dec 4, 2012

Hi!

I'm the original author of the C 'ttm_unpack' program. I'm not a Python expert, but I've managed to clean up the main decryption loop a bit. (This is the bit with the nasty pointer arithmetic in the C version!)

Converting decryptState to hex is quite slow, so this does roughly does (though slightly less efficiently) and uses bit-shifts and bitwise and to extract the byte required.

In my tests, it performs roughly twice as fast as the original version (1m17s versus 2m55s), though neither are anywhere near as fast as the C version (which runs in around 2 seconds on my box).

Thanks for doing this port, it's quite amazing. I've put a webpage for the C version up at http://davidgow.net/hacks/ttm_unpack.html if you want a canonical place to check for any updates to it that I might do.

-- David

@Kaira-
Copy link
Owner

Kaira- commented Dec 4, 2012

This seems to work as intended and the speed improvement seems good, so I'm going to accept this. Thank you for your original work, it's much appreciated and very useful. :)

  • Jukka

Kaira- added a commit that referenced this pull request Dec 4, 2012
Improve performance of decryption loop
@Kaira- Kaira- merged commit 2d77ad1 into Kaira-:master Dec 4, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants