Skip to content

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

Open
orthecreedence wants to merge 3 commits into
rubbingalcoholic:masterfrom
orthecreedence:master
Open

adding/implementing BlockCipherMode.array_concat(), an efficient array concat method.#1
orthecreedence wants to merge 3 commits into
rubbingalcoholic:masterfrom
orthecreedence:master

Conversation

@orthecreedence

Copy link
Copy Markdown

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
Copy Markdown
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