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

adding/implementing BlockCipherMode.array_concat(), an efficient array concat method. #1

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

orthecreedence
Copy link

Tested that MD5s from encrypting larger files matched before/after these changes (they do).

before changes (336kb file):

FF:      11,506 ms
Chrome:  21,190 ms

after changes:

FF:         809 ms
Chrome:     476 ms

The main bottleneck is now in Firefox in aes.js (line 133) block_encrypt. I tried some performance tweaks there but nothing worked out so I reverted everything. Firebug's profiler is generally good about finding the sub-functions that are taking the most time, and in this case it says that mix_columns is the slowest, HOWEVER mix_columns is reported to only take up about 1/4 of the time that block_encrypt uses. I don't see any realy math in block_encrypt, just a loop and some calls to other functions, so I don't know where that number is coming from.

Anyway, chrome now encrypts at about a rate of 1mb/s, and firefox at about 0.5mb/s.

@orthecreedence
Copy link
Author

OH please note that although I updated all the supported block ciphers with the new array_concat method, I only tested CBC. It should work but please test before merging!

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.

1 participant