Fixed documentation issues found by clang
diff --git a/include/polarssl/ecdh.h b/include/polarssl/ecdh.h
index d20f9bf..3c4800b 100644
--- a/include/polarssl/ecdh.h
+++ b/include/polarssl/ecdh.h
@@ -148,7 +148,7 @@
  *
  * \param ctx       ECDH constext to set
  * \param key       EC key to use
- * \param ours      Is it our key (1) or the peer's key (0) ?
+ * \param side      Is it our key (1) or the peer's key (0) ?
  *
  * \return          0 if successful, or an POLARSSL_ERR_ECP_XXX error code
  */
diff --git a/include/polarssl/ecp.h b/include/polarssl/ecp.h
index ff1072e..eea4c6d 100644
--- a/include/polarssl/ecp.h
+++ b/include/polarssl/ecp.h
@@ -215,7 +215,7 @@
 /**
  * \brief           Get curve information from a TLS NamedCurve value
  *
- * \param grp_id    A POLARSSL_ECP_DP_XXX value
+ * \param tls_id    A POLARSSL_ECP_DP_XXX value
  *
  * \return          The associated curve information or NULL
  */
diff --git a/include/polarssl/entropy.h b/include/polarssl/entropy.h
index 235b773..7e65b78 100644
--- a/include/polarssl/entropy.h
+++ b/include/polarssl/entropy.h
@@ -81,7 +81,8 @@
  * \return          0 if no critical failures occurred,
  *                  POLARSSL_ERR_ENTROPY_SOURCE_FAILED otherwise
  */
-typedef int (*f_source_ptr)(void *, unsigned char *, size_t, size_t *);
+typedef int (*f_source_ptr)(void *data, unsigned char *output, size_t len,
+                            size_t *olen);
 
 /**
  * \brief           Entropy source state
diff --git a/include/polarssl/gcm.h b/include/polarssl/gcm.h
index e4267c6..c2829a0 100644
--- a/include/polarssl/gcm.h
+++ b/include/polarssl/gcm.h
@@ -201,7 +201,7 @@
 /**
  * \brief           Free a GCM context and underlying cipher sub-context
  *
- * \param ctx
+ * \param ctx       GCM context to free
  */
 void gcm_free( gcm_context *ctx );
 
diff --git a/include/polarssl/padlock.h b/include/polarssl/padlock.h
index 8df93c0..545120f 100644
--- a/include/polarssl/padlock.h
+++ b/include/polarssl/padlock.h
@@ -59,7 +59,7 @@
 /**
  * \brief          PadLock detection routine
  *
- * \param          The feature to detect
+ * \param feature  The feature to detect
  *
  * \return         1 if CPU has support for the feature, 0 otherwise
  */
diff --git a/include/polarssl/pk.h b/include/polarssl/pk.h
index 958672b..013d973 100644
--- a/include/polarssl/pk.h
+++ b/include/polarssl/pk.h
@@ -453,14 +453,14 @@
  *                        return value to determine where you should start
  *                        using the buffer
  *
- * \param key       private to write away
+ * \param ctx       private to write away
  * \param buf       buffer to write to
  * \param size      size of the buffer
  *
  * \return          length of data written if successful, or a specific
  *                  error code
  */
-int pk_write_key_der( pk_context *pk, unsigned char *buf, size_t size );
+int pk_write_key_der( pk_context *ctx, unsigned char *buf, size_t size );
 
 /**
  * \brief           Write a public key to a SubjectPublicKeyInfo DER structure
@@ -468,37 +468,37 @@
  *                        return value to determine where you should start
  *                        using the buffer
  *
- * \param key       public key to write away
+ * \param ctx       public key to write away
  * \param buf       buffer to write to
  * \param size      size of the buffer
  *
  * \return          length of data written if successful, or a specific
  *                  error code
  */
-int pk_write_pubkey_der( pk_context *key, unsigned char *buf, size_t size );
+int pk_write_pubkey_der( pk_context *ctx, unsigned char *buf, size_t size );
 
 #if defined(POLARSSL_PEM_WRITE_C)
 /**
  * \brief           Write a public key to a PEM string
  *
- * \param key       public key to write away
+ * \param ctx       public key to write away
  * \param buf       buffer to write to
  * \param size      size of the buffer
  *
  * \return          0 successful, or a specific error code
  */
-int pk_write_pubkey_pem( pk_context *key, unsigned char *buf, size_t size );
+int pk_write_pubkey_pem( pk_context *ctx, unsigned char *buf, size_t size );
 
 /**
  * \brief           Write a private key to a PKCS#1 or SEC1 PEM string
  *
- * \param key       private to write away
+ * \param ctx       private to write away
  * \param buf       buffer to write to
  * \param size      size of the buffer
  *
  * \return          0 successful, or a specific error code
  */
-int pk_write_key_pem( pk_context *key, unsigned char *buf, size_t size );
+int pk_write_key_pem( pk_context *ctx, unsigned char *buf, size_t size );
 #endif /* POLARSSL_PEM_WRITE_C */
 #endif /* POLARSSL_PK_WRITE_C */
 
diff --git a/include/polarssl/pkcs12.h b/include/polarssl/pkcs12.h
index 51bea3d..4bd5018 100644
--- a/include/polarssl/pkcs12.h
+++ b/include/polarssl/pkcs12.h
@@ -38,9 +38,9 @@
 #define POLARSSL_ERR_PKCS12_PBE_INVALID_FORMAT             -0x1E80  /**< PBE ASN.1 data not as expected. */
 #define POLARSSL_ERR_PKCS12_PASSWORD_MISMATCH              -0x1E00  /**< Given private key password does not allow for correct decryption. */
 
-#define PKCS12_DERIVE_KEY       1   /*< encryption/decryption key */
-#define PKCS12_DERIVE_IV        2   /*< initialization vector     */
-#define PKCS12_DERIVE_MAC_KEY   3   /*< integrity / MAC key       */
+#define PKCS12_DERIVE_KEY       1   /**< encryption/decryption key */
+#define PKCS12_DERIVE_IV        2   /**< initialization vector     */
+#define PKCS12_DERIVE_MAC_KEY   3   /**< integrity / MAC key       */
 
 #define PKCS12_PBE_DECRYPT      0
 #define PKCS12_PBE_ENCRYPT      1
diff --git a/include/polarssl/rsa.h b/include/polarssl/rsa.h
index e7b6191..504dde2 100644
--- a/include/polarssl/rsa.h
+++ b/include/polarssl/rsa.h
@@ -526,7 +526,6 @@
 
 /**
  * \brief          Perform a PKCS#1 v2.1 PSS verification (RSASSA-PSS-VERIFY)
- * \brief          Do a public RSA and check the message digest
  *
  * \param ctx      points to an RSA public key
  * \param f_rng    RNG function (Only needed for RSA_PRIVATE)
diff --git a/include/polarssl/ssl_ciphersuites.h b/include/polarssl/ssl_ciphersuites.h
index 3b13ef3..28a5855 100644
--- a/include/polarssl/ssl_ciphersuites.h
+++ b/include/polarssl/ssl_ciphersuites.h
@@ -226,7 +226,7 @@
 
 typedef struct _ssl_ciphersuite_t ssl_ciphersuite_t;
 
-#define POLARSSL_CIPHERSUITE_WEAK   0x01    /*<! Weak ciphersuite flag      */
+#define POLARSSL_CIPHERSUITE_WEAK   0x01    /**< Weak ciphersuite flag      */
 
 /**
  * \brief   This structure is used for storing ciphersuite information
diff --git a/include/polarssl/x509_crt.h b/include/polarssl/x509_crt.h
index 4e7bbb7..ee8f9e6 100644
--- a/include/polarssl/x509_crt.h
+++ b/include/polarssl/x509_crt.h
@@ -371,7 +371,7 @@
  *                  (e.g. POLARSSL_MD_SHA1)
  *
  * \param ctx       CRT context to use
- * \param md_ald    MD algorithm to use
+ * \param md_alg    MD algorithm to use
  */
 void x509write_crt_set_md_alg( x509write_cert *ctx, md_type_t md_alg );
 
@@ -467,7 +467,7 @@
  *                        return value to determine where you should start
  *                        using the buffer
  *
- * \param crt       certificate to write away
+ * \param ctx       certificate to write away
  * \param buf       buffer to write to
  * \param size      size of the buffer
  * \param f_rng     RNG function (for signature, see note)
@@ -489,7 +489,7 @@
 /**
  * \brief           Write a built up certificate to a X509 PEM string
  *
- * \param crt       certificate to write away
+ * \param ctx       certificate to write away
  * \param buf       buffer to write to
  * \param size      size of the buffer
  * \param f_rng     RNG function (for signature, see note)