uProxy/libfte — pull request #20 by kpdyer (2014-07-11 16:11:30+00:00)
Title: Make libfte modular (and faster)

**tl;dr** I've made libfte more modular, and optimized the cases uProxy is most likely to use. Specifically, I've implemented the rabbit stream cipher and made special rankers for languages such as ```.*```. For some configurations this has resulted in a speed-up of ~50x.

This pull request focused on making libfte more modular. Specifically, making it easy to specify different rankers/encrypters that are more efficient for specific cases. Apologies for the number of files touched, but this required a bit of refactoring.

### Highlights:
* We now have ```Ranker``` [2] and ```Encrypter``` [3] APIs, only used internally, which define the interfaces for the rank, encrypt, unrank boxes in [1].
* I've implemented special-purpose rankers for ```.*``` and ```.+```, which implement ```Ranker```, and are much more efficient than using general-purpose DFA ranking.
* The general-purpose DFA ranker implements the ```Ranker``` API now.
* I've implemented the ```Encrypter``` API using both FFX and Rabbit.
* I've refactored the directory structure under ```src/fte```, such that FFX is no longer a top-level module.
* This may, in fact, make the uTransformers rabbit module redundant, as one can use libfte with ```.+``` as both the plaintext/ciphertext language format.

### References
[1] https://raw.githubusercontent.com/uProxy/libfte/master/images/fte-workflow.png
[2] ```src/fte/ranking/ranker.h```
[3] ```src/fte/encrypting/encrypter.h```