- A error_strerror function() has been added to translate between error codes and their description.
- The error codes have been remapped and combining error codes is now done with a PLUS instead of an OR as error codes used are negative.
- Descriptions to all error codes have been added.
- Generation script for error.c has been created to automatically generate error.c from the available error definitions in the headers.
diff --git a/include/polarssl/dhm.h b/include/polarssl/dhm.h
index 4a479d6..94ad015 100644
--- a/include/polarssl/dhm.h
+++ b/include/polarssl/dhm.h
@@ -32,12 +32,12 @@
/*
* DHM Error codes
*/
-#define POLARSSL_ERR_DHM_BAD_INPUT_DATA 0x0480
-#define POLARSSL_ERR_DHM_READ_PARAMS_FAILED 0x0490
-#define POLARSSL_ERR_DHM_MAKE_PARAMS_FAILED 0x04A0
-#define POLARSSL_ERR_DHM_READ_PUBLIC_FAILED 0x04B0
-#define POLARSSL_ERR_DHM_MAKE_PUBLIC_FAILED 0x04C0
-#define POLARSSL_ERR_DHM_CALC_SECRET_FAILED 0x04D0
+#define POLARSSL_ERR_DHM_BAD_INPUT_DATA -0x3080 /**< Bad input parameters to function. */
+#define POLARSSL_ERR_DHM_READ_PARAMS_FAILED -0x3100 /**< Reading of the DHM parameters failed. */
+#define POLARSSL_ERR_DHM_MAKE_PARAMS_FAILED -0x3180 /**< Making of the DHM parameters failed. */
+#define POLARSSL_ERR_DHM_READ_PUBLIC_FAILED -0x3200 /**< Reading of the public values failed. */
+#define POLARSSL_ERR_DHM_MAKE_PUBLIC_FAILED -0x3280 /**< Makeing of the public value failed. */
+#define POLARSSL_ERR_DHM_CALC_SECRET_FAILED -0x3300 /**< Calculation of the DHM secret failed. */
/**
* \brief DHM context structure