Running wolfSSL on the Apple TV 2

The Apple TV brought with it a long list of desirable and useful features for the home – including high usability, a small form factor, easy setup, and low cost. We here at yaSSL are users and fans of the second generation Apple TV, and as such, recently ported the wolfSSL embedded SSL library to the Apple TV 2. We were quite surprised by how easy it was to get wolfSSL up and running.

The Apple TV 2 runs iOS with the Apple A4 (ARM Cortex-A8) processor and is equipped with 256 Mb of RAM and a 8GB flash drive, giving it more than enough space and speed to effectively run wolfSSL.

Installation

1. Jailbreak your Apple TV
Installation of wolfSSL onto the Apple TV requires that the TV be jailbroken first. There are any number of readily-accessible posts around the internet explaining this process, therefore, we will leave this step up to you.

1. Cross compile wolfSSL for iOS and ARM
For this step, we used a modified version of a script written by Michael Aaron Safyan to cross compile libraries for iOS. You can find our modified version of the script for iOS 4.3 and the armv7 architecture, here: Cross Compile Script. This script uses the ARM toolchain from the iOS Developer tools that come with the iPhone SDK. It sets environment variables, then runs wolfSSL’s normal ./configure script.

If you want to change the location where wolfSSL is installed, you can edit the script to adjust for your desired directory location. To build wolfSSL, place the cross compile script (iOS4.3-configure.sh) in the root directory of the wolfSSL download and run the following commands. This builds wolfSSL with the –enable-fastmath option.

./iOS4.3-configure.sh
make
sudo make install

If unaltered, this will install the cross-compiled wolfSSL library into /usr/local/cyassl_atv2.

1. Copy wolfSSL to the Apple TV
Use your favorite FTP client to upload the contents of the /usr/local/cyassl_atv2 directory to the same location on your second generation Apple TV. If desired, you can also copy additional wolfSSL elements to the Apple TV such as the CTaoCrypt benchmark utility, the wolfSSL testsuite, or examples. We chose to place these on the Apple TV under the /var/mobile/Applications/cyassl directory.

1. Benchmark Results
Our results of running the CTaoCrypt benchmark application are below:

AES 5 megs took 0.500 seconds, 9.99 MB/s
ARC4 5 megs took 0.174 seconds, 28.66 MB/s
RABBIT 5 megs took 0.126 seconds, 39.56 MB/s
3DES 5 megs took 2.196 seconds, 2.28 MB/s

MD5 5 megs took 0.163 seconds, 30.73 MB/s
SHA 5 megs took 0.137 seconds, 36.61 MB/s
SHA-256 5 megs took 0.309 seconds, 16.20 MB/s

RSA 1024 encryption took 1.12 milliseconds, avg over 100 iterations
RSA 1024 decryption took 17.81 milliseconds, avg over 100 iterations
DH 1024 key generation 11.90 milliseconds, avg over 100 iterations
DH 1024 key agreement 11.22 milliseconds, avg over 100 iterations

If you have any questions or comments about our port to the Apple TV, please let us know at info@yassl.com. We’d be happy to hear what you think!