rubbingalcoholic/cowcrypt — pull request #1 by orthecreedence (2013-10-02 20:43:54+00:00)
Title: adding/implementing BlockCipherMode.array_concat(), an efficient array concat method.

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.