WhisperSystems/TextSecure-iOS — pull request #51 by nabla-c0d3 (2013-12-29 18:18:05+00:00)
Title: Revamp ECKeyPair pt1

As I was working on moving the key storage from TSEncryptedDatabase to TSKeyManager, I made some major changes to ECKeyPair:
* Limit the number of exposed methods - only expose the ones that need to be public: generating a key pair, generating a shared secret, exporting the pair's public key. Did I miss one ?
* Use C byte arrays instead of NSString for storing the keys (there was a TODO about this)
* Use the NSCoder protocol for key pair serialization. This means that we can easily serialize a key to store it somewhere (a file, the keychain, etc.) without having to separately store base64-encoded strings of the public key and the private key (how it is currently done). Basically, serializing/deserializing a key pair is now a one-liner.
* Add some unit tests.

This all implemented in a new class called TSECKeyPair. I haven't "plugged" this class into the code base so ECKeyPair is still here for now. Before making the switch, I wanted to make sure the changes I made were fine from your side.
Thanks,