- First replacement of xyssl by polarssl where needed

diff --git a/programs/Makefile b/programs/Makefile
index 5771a57..a29f358 100644
--- a/programs/Makefile
+++ b/programs/Makefile
@@ -4,7 +4,7 @@
 
 CFLAGS	= -I../include -D_FILE_OFFSET_BITS=64
 OFLAGS	= -O
-LDFLAGS	= -L../library -lxyssl
+LDFLAGS	= -L../library -lpolarssl
 
 APPS =	aes/aescrypt2		hash/hello		\
 	hash/md5sum		hash/sha1sum		\
@@ -20,75 +20,75 @@
 
 all: $(APPS)
 
-aes/aescrypt2: aes/aescrypt2.c ../library/libxyssl.a
+aes/aescrypt2: aes/aescrypt2.c ../library/libpolarssl.a
 	echo   "  CC    aes/aescrypt2.c"
 	$(CC) $(CFLAGS) $(OFLAGS) aes/aescrypt2.c    $(LDFLAGS) -o $@
 
-hash/hello: hash/hello.c ../library/libxyssl.a
+hash/hello: hash/hello.c ../library/libpolarssl.a
 	echo   "  CC    hash/hello.c"
 	$(CC) $(CFLAGS) $(OFLAGS) hash/hello.c       $(LDFLAGS) -o $@
 
-hash/md5sum: hash/md5sum.c ../library/libxyssl.a
+hash/md5sum: hash/md5sum.c ../library/libpolarssl.a
 	echo   "  CC    hash/md5sum.c"
 	$(CC) $(CFLAGS) $(OFLAGS) hash/md5sum.c      $(LDFLAGS) -o $@
 
-hash/sha1sum: hash/sha1sum.c ../library/libxyssl.a
+hash/sha1sum: hash/sha1sum.c ../library/libpolarssl.a
 	echo   "  CC    hash/sha1sum.c"
 	$(CC) $(CFLAGS) $(OFLAGS) hash/sha1sum.c     $(LDFLAGS) -o $@
 
-hash/sha2sum: hash/sha2sum.c ../library/libxyssl.a
+hash/sha2sum: hash/sha2sum.c ../library/libpolarssl.a
 	echo   "  CC    hash/sha2sum.c"
 	$(CC) $(CFLAGS) $(OFLAGS) hash/sha2sum.c     $(LDFLAGS) -o $@
 
-pkey/dh_client: pkey/dh_client.c ../library/libxyssl.a
+pkey/dh_client: pkey/dh_client.c ../library/libpolarssl.a
 	echo   "  CC    pkey/dh_client.c"
 	$(CC) $(CFLAGS) $(OFLAGS) pkey/dh_client.c   $(LDFLAGS) -o $@
 
-pkey/dh_genprime: pkey/dh_genprime.c ../library/libxyssl.a
+pkey/dh_genprime: pkey/dh_genprime.c ../library/libpolarssl.a
 	echo   "  CC    pkey/dh_genprime.c"
 	$(CC) $(CFLAGS) $(OFLAGS) pkey/dh_genprime.c $(LDFLAGS) -o $@
 
-pkey/dh_server: pkey/dh_server.c ../library/libxyssl.a
+pkey/dh_server: pkey/dh_server.c ../library/libpolarssl.a
 	echo   "  CC    pkey/dh_server.c"
 	$(CC) $(CFLAGS) $(OFLAGS) pkey/dh_server.c   $(LDFLAGS) -o $@
 
-pkey/mpi_demo: pkey/mpi_demo.c ../library/libxyssl.a
+pkey/mpi_demo: pkey/mpi_demo.c ../library/libpolarssl.a
 	echo   "  CC    pkey/mpi_demo.c"
 	$(CC) $(CFLAGS) $(OFLAGS) pkey/mpi_demo.c    $(LDFLAGS) -o $@
 
-pkey/rsa_genkey: pkey/rsa_genkey.c ../library/libxyssl.a
+pkey/rsa_genkey: pkey/rsa_genkey.c ../library/libpolarssl.a
 	echo   "  CC    pkey/rsa_genkey.c"
 	$(CC) $(CFLAGS) $(OFLAGS) pkey/rsa_genkey.c  $(LDFLAGS) -o $@
 
-pkey/rsa_sign: pkey/rsa_sign.c ../library/libxyssl.a
+pkey/rsa_sign: pkey/rsa_sign.c ../library/libpolarssl.a
 	echo   "  CC    pkey/rsa_sign.c"
 	$(CC) $(CFLAGS) $(OFLAGS) pkey/rsa_sign.c    $(LDFLAGS) -o $@
 
-pkey/rsa_verify: pkey/rsa_verify.c ../library/libxyssl.a
+pkey/rsa_verify: pkey/rsa_verify.c ../library/libpolarssl.a
 	echo   "  CC    pkey/rsa_verify.c"
 	$(CC) $(CFLAGS) $(OFLAGS) pkey/rsa_verify.c  $(LDFLAGS) -o $@
 
-ssl/ssl_client1: ssl/ssl_client1.c ../library/libxyssl.a
+ssl/ssl_client1: ssl/ssl_client1.c ../library/libpolarssl.a
 	echo   "  CC    ssl/ssl_client1.c"
 	$(CC) $(CFLAGS) $(OFLAGS) ssl/ssl_client1.c  $(LDFLAGS) -o $@
 
-ssl/ssl_client2: ssl/ssl_client2.c ../library/libxyssl.a
+ssl/ssl_client2: ssl/ssl_client2.c ../library/libpolarssl.a
 	echo   "  CC    ssl/ssl_client2.c"
 	$(CC) $(CFLAGS) $(OFLAGS) ssl/ssl_client2.c  $(LDFLAGS) -o $@
 
-ssl/ssl_server: ssl/ssl_server.c ../library/libxyssl.a
+ssl/ssl_server: ssl/ssl_server.c ../library/libpolarssl.a
 	echo   "  CC    ssl/ssl_server.c"
 	$(CC) $(CFLAGS) $(OFLAGS) ssl/ssl_server.c   $(LDFLAGS) -o $@
 
-test/benchmark: test/benchmark.c ../library/libxyssl.a
+test/benchmark: test/benchmark.c ../library/libpolarssl.a
 	echo   "  CC    test/benchmark.c"
 	$(CC) $(CFLAGS) $(OFLAGS) test/benchmark.c   $(LDFLAGS) -o $@
 
-test/selftest: test/selftest.c ../library/libxyssl.a
+test/selftest: test/selftest.c ../library/libpolarssl.a
 	echo   "  CC    test/selftest.c"
 	$(CC) $(CFLAGS) $(OFLAGS) test/selftest.c    $(LDFLAGS) -o $@
 
-test/ssl_test: test/ssl_test.c ../library/libxyssl.a
+test/ssl_test: test/ssl_test.c ../library/libpolarssl.a
 	echo   "  CC    test/ssl_test.c"
 	$(CC) $(CFLAGS) $(OFLAGS) test/ssl_test.c    $(LDFLAGS) -o $@
 
diff --git a/programs/aes/aescrypt2.c b/programs/aes/aescrypt2.c
index 3d9c06d..8e632f0 100644
--- a/programs/aes/aescrypt2.c
+++ b/programs/aes/aescrypt2.c
@@ -35,8 +35,8 @@
 #include <stdio.h>
 #include <time.h>
 
-#include "xyssl/aes.h"
-#include "xyssl/sha2.h"
+#include "polarssl/aes.h"
+#include "polarssl/sha2.h"
 
 #define MODE_ENCRYPT    0
 #define MODE_DECRYPT    1
diff --git a/programs/hash/hello.c b/programs/hash/hello.c
index 12e0167..f1e93ab 100644
--- a/programs/hash/hello.c
+++ b/programs/hash/hello.c
@@ -24,7 +24,7 @@
 
 #include <stdio.h>
 
-#include "xyssl/md5.h"
+#include "polarssl/md5.h"
 
 int main( void )
 {
diff --git a/programs/hash/md5sum.c b/programs/hash/md5sum.c
index 10e9a71..d246900 100644
--- a/programs/hash/md5sum.c
+++ b/programs/hash/md5sum.c
@@ -25,7 +25,7 @@
 #include <string.h>
 #include <stdio.h>
 
-#include "xyssl/md5.h"
+#include "polarssl/md5.h"
 
 static int md5_wrapper( char *filename, unsigned char *sum )
 {
diff --git a/programs/hash/sha1sum.c b/programs/hash/sha1sum.c
index 33c3142..53a97d0 100644
--- a/programs/hash/sha1sum.c
+++ b/programs/hash/sha1sum.c
@@ -25,7 +25,7 @@
 #include <string.h>
 #include <stdio.h>
 
-#include "xyssl/sha1.h"
+#include "polarssl/sha1.h"
 
 static int sha1_wrapper( char *filename, unsigned char *sum )
 {
diff --git a/programs/hash/sha2sum.c b/programs/hash/sha2sum.c
index c0d42a8..beb21cb 100644
--- a/programs/hash/sha2sum.c
+++ b/programs/hash/sha2sum.c
@@ -25,7 +25,7 @@
 #include <string.h>
 #include <stdio.h>
 
-#include "xyssl/sha2.h"
+#include "polarssl/sha2.h"
 
 static int sha2_wrapper( char *filename, unsigned char *sum )
 {
diff --git a/programs/pkey/dh_client.c b/programs/pkey/dh_client.c
index 2122078..8bf6b5f 100644
--- a/programs/pkey/dh_client.c
+++ b/programs/pkey/dh_client.c
@@ -25,12 +25,12 @@
 #include <string.h>
 #include <stdio.h>
 
-#include "xyssl/net.h"
-#include "xyssl/aes.h"
-#include "xyssl/dhm.h"
-#include "xyssl/rsa.h"
-#include "xyssl/sha1.h"
-#include "xyssl/havege.h"
+#include "polarssl/net.h"
+#include "polarssl/aes.h"
+#include "polarssl/dhm.h"
+#include "polarssl/rsa.h"
+#include "polarssl/sha1.h"
+#include "polarssl/havege.h"
 
 #define SERVER_NAME "localhost"
 #define SERVER_PORT 11999
diff --git a/programs/pkey/dh_genprime.c b/programs/pkey/dh_genprime.c
index 09d9b1d..45605e3 100644
--- a/programs/pkey/dh_genprime.c
+++ b/programs/pkey/dh_genprime.c
@@ -24,9 +24,9 @@
 
 #include <stdio.h>
 
-#include "xyssl/bignum.h"
-#include "xyssl/config.h"
-#include "xyssl/havege.h"
+#include "polarssl/bignum.h"
+#include "polarssl/config.h"
+#include "polarssl/havege.h"
 
 /*
  * Note: G = 4 is always a quadratic residue mod P,
@@ -39,7 +39,7 @@
 {
     int ret = 1;
 
-#if defined(XYSSL_GENPRIME)
+#if defined(POLARSSL_GENPRIME)
     mpi G, P, Q;
     havege_state hs;
     FILE *fout;
diff --git a/programs/pkey/dh_server.c b/programs/pkey/dh_server.c
index 4990dcf..f4b7b44 100644
--- a/programs/pkey/dh_server.c
+++ b/programs/pkey/dh_server.c
@@ -25,12 +25,12 @@
 #include <string.h>
 #include <stdio.h>
 
-#include "xyssl/net.h"
-#include "xyssl/aes.h"
-#include "xyssl/dhm.h"
-#include "xyssl/rsa.h"
-#include "xyssl/sha1.h"
-#include "xyssl/havege.h"
+#include "polarssl/net.h"
+#include "polarssl/aes.h"
+#include "polarssl/dhm.h"
+#include "polarssl/rsa.h"
+#include "polarssl/sha1.h"
+#include "polarssl/havege.h"
 
 #define SERVER_PORT 11999
 #define PLAINTEXT "==Hello there!=="
diff --git a/programs/pkey/mpi_demo.c b/programs/pkey/mpi_demo.c
index 699fa5a..87737c8 100644
--- a/programs/pkey/mpi_demo.c
+++ b/programs/pkey/mpi_demo.c
@@ -24,7 +24,7 @@
 
 #include <stdio.h>
 
-#include "xyssl/bignum.h"
+#include "polarssl/bignum.h"
 
 int main( void )
 {
diff --git a/programs/pkey/rsa_genkey.c b/programs/pkey/rsa_genkey.c
index 0619f15..cd8016d 100644
--- a/programs/pkey/rsa_genkey.c
+++ b/programs/pkey/rsa_genkey.c
@@ -24,10 +24,10 @@
 
 #include <stdio.h>
 
-#include "xyssl/havege.h"
-#include "xyssl/bignum.h"
-#include "xyssl/x509.h"
-#include "xyssl/rsa.h"
+#include "polarssl/havege.h"
+#include "polarssl/bignum.h"
+#include "polarssl/x509.h"
+#include "polarssl/rsa.h"
 
 #define KEY_SIZE 1024
 #define EXPONENT 65537
diff --git a/programs/pkey/rsa_sign.c b/programs/pkey/rsa_sign.c
index 0e7077e..85016b9 100644
--- a/programs/pkey/rsa_sign.c
+++ b/programs/pkey/rsa_sign.c
@@ -25,8 +25,8 @@
 #include <string.h>
 #include <stdio.h>
 
-#include "xyssl/rsa.h"
-#include "xyssl/sha1.h"
+#include "polarssl/rsa.h"
+#include "polarssl/sha1.h"
 
 int main( int argc, char *argv[] )
 {
diff --git a/programs/pkey/rsa_verify.c b/programs/pkey/rsa_verify.c
index aacc664..a8096f3 100644
--- a/programs/pkey/rsa_verify.c
+++ b/programs/pkey/rsa_verify.c
@@ -25,8 +25,8 @@
 #include <string.h>
 #include <stdio.h>
 
-#include "xyssl/rsa.h"
-#include "xyssl/sha1.h"
+#include "polarssl/rsa.h"
+#include "polarssl/sha1.h"
 
 int main( int argc, char *argv[] )
 {
diff --git a/programs/ssl/ssl_client1.c b/programs/ssl/ssl_client1.c
index e752d87..f32c228 100644
--- a/programs/ssl/ssl_client1.c
+++ b/programs/ssl/ssl_client1.c
@@ -25,9 +25,9 @@
 #include <string.h>
 #include <stdio.h>
 
-#include "xyssl/net.h"
-#include "xyssl/ssl.h"
-#include "xyssl/havege.h"
+#include "polarssl/net.h"
+#include "polarssl/ssl.h"
+#include "polarssl/havege.h"
 
 #define SERVER_PORT 443
 /*
@@ -115,7 +115,7 @@
 
     while( ( ret = ssl_write( &ssl, buf, len ) ) <= 0 )
     {
-        if( ret != XYSSL_ERR_NET_TRY_AGAIN )
+        if( ret != POLARSSL_ERR_NET_TRY_AGAIN )
         {
             printf( " failed\n  ! ssl_write returned %d\n\n", ret );
             goto exit;
@@ -137,10 +137,10 @@
         memset( buf, 0, sizeof( buf ) );
         ret = ssl_read( &ssl, buf, len );
 
-        if( ret == XYSSL_ERR_NET_TRY_AGAIN )
+        if( ret == POLARSSL_ERR_NET_TRY_AGAIN )
             continue;
 
-        if( ret == XYSSL_ERR_SSL_PEER_CLOSE_NOTIFY )
+        if( ret == POLARSSL_ERR_SSL_PEER_CLOSE_NOTIFY )
             break;
 
         if( ret <= 0 )
diff --git a/programs/ssl/ssl_client2.c b/programs/ssl/ssl_client2.c
index a19c37b..e814931 100644
--- a/programs/ssl/ssl_client2.c
+++ b/programs/ssl/ssl_client2.c
@@ -25,11 +25,11 @@
 #include <string.h>
 #include <stdio.h>
 
-#include "xyssl/net.h"
-#include "xyssl/ssl.h"
-#include "xyssl/havege.h"
-#include "xyssl/certs.h"
-#include "xyssl/x509.h"
+#include "polarssl/net.h"
+#include "polarssl/ssl.h"
+#include "polarssl/havege.h"
+#include "polarssl/certs.h"
+#include "polarssl/x509.h"
 
 #define SERVER_PORT 443
 /*
@@ -174,7 +174,7 @@
 
     while( ( ret = ssl_handshake( &ssl ) ) != 0 )
     {
-        if( ret != XYSSL_ERR_NET_TRY_AGAIN )
+        if( ret != POLARSSL_ERR_NET_TRY_AGAIN )
         {
             printf( " failed\n  ! ssl_handshake returned %d\n\n", ret );
             goto exit;
@@ -223,7 +223,7 @@
 
     while( ( ret = ssl_write( &ssl, buf, len ) ) <= 0 )
     {
-        if( ret != XYSSL_ERR_NET_TRY_AGAIN )
+        if( ret != POLARSSL_ERR_NET_TRY_AGAIN )
         {
             printf( " failed\n  ! ssl_write returned %d\n\n", ret );
             goto exit;
@@ -245,10 +245,10 @@
         memset( buf, 0, sizeof( buf ) );
         ret = ssl_read( &ssl, buf, len );
 
-        if( ret == XYSSL_ERR_NET_TRY_AGAIN )
+        if( ret == POLARSSL_ERR_NET_TRY_AGAIN )
             continue;
 
-        if( ret == XYSSL_ERR_SSL_PEER_CLOSE_NOTIFY )
+        if( ret == POLARSSL_ERR_SSL_PEER_CLOSE_NOTIFY )
             break;
 
         if( ret <= 0 )
diff --git a/programs/ssl/ssl_server.c b/programs/ssl/ssl_server.c
index 565fed2..4b07ef6 100644
--- a/programs/ssl/ssl_server.c
+++ b/programs/ssl/ssl_server.c
@@ -30,11 +30,11 @@
 #include <stdlib.h>
 #include <stdio.h>
 
-#include "xyssl/havege.h"
-#include "xyssl/certs.h"
-#include "xyssl/x509.h"
-#include "xyssl/ssl.h"
-#include "xyssl/net.h"
+#include "polarssl/havege.h"
+#include "polarssl/certs.h"
+#include "polarssl/x509.h"
+#include "polarssl/ssl.h"
+#include "polarssl/net.h"
 
 #define HTTP_RESPONSE \
     "HTTP/1.0 200 OK\r\nContent-Type: text/html\r\n\r\n" \
@@ -293,7 +293,7 @@
 
     while( ( ret = ssl_handshake( &ssl ) ) != 0 )
     {
-        if( ret != XYSSL_ERR_NET_TRY_AGAIN )
+        if( ret != POLARSSL_ERR_NET_TRY_AGAIN )
         {
             printf( " failed\n  ! ssl_handshake returned %d\n\n", ret );
             goto accept;
@@ -314,18 +314,18 @@
         memset( buf, 0, sizeof( buf ) );
         ret = ssl_read( &ssl, buf, len );
 
-        if( ret == XYSSL_ERR_NET_TRY_AGAIN )
+        if( ret == POLARSSL_ERR_NET_TRY_AGAIN )
             continue;
 
         if( ret <= 0 )
         {
             switch( ret )
             {
-                case XYSSL_ERR_SSL_PEER_CLOSE_NOTIFY:
+                case POLARSSL_ERR_SSL_PEER_CLOSE_NOTIFY:
                     printf( " connection was closed gracefully\n" );
                     break;
 
-                case XYSSL_ERR_NET_CONN_RESET:
+                case POLARSSL_ERR_NET_CONN_RESET:
                     printf( " connection was reset by peer\n" );
                     break;
 
@@ -353,13 +353,13 @@
 
     while( ( ret = ssl_write( &ssl, buf, len ) ) <= 0 )
     {
-        if( ret == XYSSL_ERR_NET_CONN_RESET )
+        if( ret == POLARSSL_ERR_NET_CONN_RESET )
         {
             printf( " failed\n  ! peer closed the connection\n\n" );
             goto accept;
         }
 
-        if( ret != XYSSL_ERR_NET_TRY_AGAIN )
+        if( ret != POLARSSL_ERR_NET_TRY_AGAIN )
         {
             printf( " failed\n  ! ssl_write returned %d\n\n", ret );
             goto exit;
diff --git a/programs/test/benchmark.c b/programs/test/benchmark.c
index 9869cc4..5058cff 100644
--- a/programs/test/benchmark.c
+++ b/programs/test/benchmark.c
@@ -26,17 +26,17 @@
 #include <stdlib.h>
 #include <stdio.h>
 
-#include "xyssl/config.h"
+#include "polarssl/config.h"
 
-#include "xyssl/md4.h"
-#include "xyssl/md5.h"
-#include "xyssl/sha1.h"
-#include "xyssl/sha2.h"
-#include "xyssl/arc4.h"
-#include "xyssl/des.h"
-#include "xyssl/aes.h"
-#include "xyssl/rsa.h"
-#include "xyssl/timing.h"
+#include "polarssl/md4.h"
+#include "polarssl/md5.h"
+#include "polarssl/sha1.h"
+#include "polarssl/sha2.h"
+#include "polarssl/arc4.h"
+#include "polarssl/des.h"
+#include "polarssl/aes.h"
+#include "polarssl/rsa.h"
+#include "polarssl/timing.h"
 
 #define BUFSIZE 1024
 
@@ -55,17 +55,17 @@
     int keysize;
     unsigned long i, j, tsc;
     unsigned char tmp[32];
-#if defined(XYSSL_ARC4_C)
+#if defined(POLARSSL_ARC4_C)
     arc4_context arc4;
 #endif
-#if defined(XYSSL_DES_C)
+#if defined(POLARSSL_DES_C)
     des3_context des3;
     des_context des;
 #endif
-#if defined(XYSSL_AES_C)
+#if defined(POLARSSL_AES_C)
     aes_context aes;
 #endif
-#if defined(XYSSL_RSA_C)
+#if defined(POLARSSL_RSA_C)
     rsa_context rsa;
 #endif
 
@@ -73,7 +73,7 @@
 
     printf( "\n" );
 
-#if defined(XYSSL_MD4_C)
+#if defined(POLARSSL_MD4_C)
     printf( "  MD4       :  " );
     fflush( stdout );
 
@@ -89,7 +89,7 @@
                     ( hardclock() - tsc ) / ( j * BUFSIZE ) );
 #endif
 
-#if defined(XYSSL_MD5_C)
+#if defined(POLARSSL_MD5_C)
     printf( "  MD5       :  " );
     fflush( stdout );
 
@@ -105,7 +105,7 @@
                     ( hardclock() - tsc ) / ( j * BUFSIZE ) );
 #endif
 
-#if defined(XYSSL_SHA1_C)
+#if defined(POLARSSL_SHA1_C)
     printf( "  SHA-1     :  " );
     fflush( stdout );
 
@@ -121,7 +121,7 @@
                     ( hardclock() - tsc ) / ( j * BUFSIZE ) );
 #endif
 
-#if defined(XYSSL_SHA2_C)
+#if defined(POLARSSL_SHA2_C)
     printf( "  SHA-256   :  " );
     fflush( stdout );
 
@@ -137,7 +137,7 @@
                     ( hardclock() - tsc ) / ( j * BUFSIZE ) );
 #endif
 
-#if defined(XYSSL_ARC4_C)
+#if defined(POLARSSL_ARC4_C)
     printf( "  ARC4      :  " );
     fflush( stdout );
 
@@ -155,7 +155,7 @@
                     ( hardclock() - tsc ) / ( j * BUFSIZE ) );
 #endif
 
-#if defined(XYSSL_DES_C)
+#if defined(POLARSSL_DES_C)
     printf( "  3DES      :  " );
     fflush( stdout );
 
@@ -189,7 +189,7 @@
                     ( hardclock() - tsc ) / ( j * BUFSIZE ) );
 #endif
 
-#if defined(XYSSL_AES_C)
+#if defined(POLARSSL_AES_C)
     for( keysize = 128; keysize <= 256; keysize += 64 )
     {
         printf( "  AES-%d   :  ", keysize );
@@ -213,7 +213,7 @@
     }
 #endif
 
-#if defined(XYSSL_RSA_C)
+#if defined(POLARSSL_RSA_C)
     rsa_init( &rsa, RSA_PKCS_V15, 0, myrand, NULL );
     rsa_gen_key( &rsa, 1024, 65537 );
 
diff --git a/programs/test/selftest.c b/programs/test/selftest.c
index 6fc0e1f..cf77939 100644
--- a/programs/test/selftest.c
+++ b/programs/test/selftest.c
@@ -25,21 +25,21 @@
 #include <string.h>
 #include <stdio.h>
 
-#include "xyssl/config.h"
+#include "polarssl/config.h"
 
-#include "xyssl/md2.h"
-#include "xyssl/md4.h"
-#include "xyssl/md5.h"
-#include "xyssl/sha1.h"
-#include "xyssl/sha2.h"
-#include "xyssl/sha4.h"
-#include "xyssl/arc4.h"
-#include "xyssl/des.h"
-#include "xyssl/aes.h"
-#include "xyssl/base64.h"
-#include "xyssl/bignum.h"
-#include "xyssl/rsa.h"
-#include "xyssl/x509.h"
+#include "polarssl/md2.h"
+#include "polarssl/md4.h"
+#include "polarssl/md5.h"
+#include "polarssl/sha1.h"
+#include "polarssl/sha2.h"
+#include "polarssl/sha4.h"
+#include "polarssl/arc4.h"
+#include "polarssl/des.h"
+#include "polarssl/aes.h"
+#include "polarssl/base64.h"
+#include "polarssl/bignum.h"
+#include "polarssl/rsa.h"
+#include "polarssl/x509.h"
 
 int main( int argc, char *argv[] )
 {
@@ -53,67 +53,67 @@
         printf( "\n" );
     }
 
-#if defined(XYSSL_MD2_C)
+#if defined(POLARSSL_MD2_C)
     if( ( ret = md2_self_test( v ) ) != 0 )
         return( ret );
 #endif
 
-#if defined(XYSSL_MD4_C)
+#if defined(POLARSSL_MD4_C)
     if( ( ret = md4_self_test( v ) ) != 0 )
         return( ret );
 #endif
 
-#if defined(XYSSL_MD5_C)
+#if defined(POLARSSL_MD5_C)
     if( ( ret = md5_self_test( v ) ) != 0 )
         return( ret );
 #endif
 
-#if defined(XYSSL_SHA1_C)
+#if defined(POLARSSL_SHA1_C)
     if( ( ret = sha1_self_test( v ) ) != 0 )
         return( ret );
 #endif
 
-#if defined(XYSSL_SHA2_C)
+#if defined(POLARSSL_SHA2_C)
     if( ( ret = sha2_self_test( v ) ) != 0 )
         return( ret );
 #endif
 
-#if defined(XYSSL_SHA4_C)
+#if defined(POLARSSL_SHA4_C)
     if( ( ret = sha4_self_test( v ) ) != 0 )
         return( ret );
 #endif
 
-#if defined(XYSSL_ARC4_C)
+#if defined(POLARSSL_ARC4_C)
     if( ( ret = arc4_self_test( v ) ) != 0 )
         return( ret );
 #endif
 
-#if defined(XYSSL_DES_C)
+#if defined(POLARSSL_DES_C)
     if( ( ret = des_self_test( v ) ) != 0 )
         return( ret );
 #endif
 
-#if defined(XYSSL_AES_C)
+#if defined(POLARSSL_AES_C)
     if( ( ret = aes_self_test( v ) ) != 0 )
         return( ret );
 #endif
 
-#if defined(XYSSL_BASE64_C)
+#if defined(POLARSSL_BASE64_C)
     if( ( ret = base64_self_test( v ) ) != 0 )
         return( ret );
 #endif
 
-#if defined(XYSSL_BIGNUM_C)
+#if defined(POLARSSL_BIGNUM_C)
     if( ( ret = mpi_self_test( v ) ) != 0 )
         return( ret );
 #endif
 
-#if defined(XYSSL_RSA_C)
+#if defined(POLARSSL_RSA_C)
     if( ( ret = rsa_self_test( v ) ) != 0 )
         return( ret );
 #endif
 
-#if defined(XYSSL_X509_C)
+#if defined(POLARSSL_X509_C)
     if( ( ret = x509_self_test( v ) ) != 0 )
         return( ret );
 #endif
diff --git a/programs/test/ssl_test.c b/programs/test/ssl_test.c
index 44ff7d8..ebf2be9 100644
--- a/programs/test/ssl_test.c
+++ b/programs/test/ssl_test.c
@@ -26,11 +26,11 @@
 #include <stdlib.h>
 #include <stdio.h>
 
-#include "xyssl/net.h"
-#include "xyssl/ssl.h"
-#include "xyssl/havege.h"
-#include "xyssl/timing.h"
-#include "xyssl/certs.h"
+#include "polarssl/net.h"
+#include "polarssl/ssl.h"
+#include "polarssl/havege.h"
+#include "polarssl/timing.h"
+#include "polarssl/certs.h"
 
 #define OPMODE_NONE             0
 #define OPMODE_CLIENT           1
@@ -281,14 +281,14 @@
                 offset_to_write += ret;
             }
 
-            if( ret == XYSSL_ERR_SSL_PEER_CLOSE_NOTIFY ||
-                ret == XYSSL_ERR_NET_CONN_RESET )
+            if( ret == POLARSSL_ERR_SSL_PEER_CLOSE_NOTIFY ||
+                ret == POLARSSL_ERR_NET_CONN_RESET )
             {
                 ret = 0;
                 goto exit;
             }
 
-            if( ret < 0 && ret != XYSSL_ERR_NET_TRY_AGAIN )
+            if( ret < 0 && ret != POLARSSL_ERR_NET_TRY_AGAIN )
             {
                 printf( "  ! ssl_write returned %d\n\n", ret );
                 break;
@@ -324,14 +324,14 @@
                 offset_to_read += ret;
             }
 
-            if( ret == XYSSL_ERR_SSL_PEER_CLOSE_NOTIFY ||
-                ret == XYSSL_ERR_NET_CONN_RESET )
+            if( ret == POLARSSL_ERR_SSL_PEER_CLOSE_NOTIFY ||
+                ret == POLARSSL_ERR_NET_CONN_RESET )
             {
                 ret = 0;
                 goto exit;
             }
 
-            if( ret < 0 && ret != XYSSL_ERR_NET_TRY_AGAIN )
+            if( ret < 0 && ret != POLARSSL_ERR_NET_TRY_AGAIN )
             {
                 printf( "  ! ssl_read returned %d\n\n", ret );
                 break;