adding/implementing BlockCipherMode.array_concat(), an efficient array concat method. #1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Tested that MD5s from encrypting larger files matched before/after these changes (they do).
before changes (336kb file):
after changes:
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 thatmix_columns
is the slowest, HOWEVERmix_columns
is reported to only take up about 1/4 of the time thatblock_encrypt
uses. I don't see any realy math inblock_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.